Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
round.h
Go to the documentation of this file.
1#ifndef _RHEOLEF_ROUND_H
2#define _RHEOLEF_ROUND_H
23#include "rheolef/rounder.h"
24#include "rheolef/field_expr.h"
25
26namespace rheolef {
27
28template<class Expr, class T2>
29typename
30std::enable_if<
31 details::is_field_expr_affine_homogeneous<Expr>::value
32 ,field_basic<
33 typename Expr::scalar_type
34 ,typename Expr::memory_type
35 >
36>::type
38 const Expr& expr,
39 const T2& prec)
40{
41 typedef typename Expr::scalar_type T;
42 typedef typename Expr::memory_type M;
44 check_macro (expr.have_homogeneous_space (Xh),
45 "round(field_expr, prec): field_expr should have homogeneous space. HINT: use round(interpolate(Xh, field_expr), prec)");
46 field_basic<T,M> uh = expr; // create a tmp because expr has no expr.end_dof()
47 field_basic<T,M> vh (Xh);
48 std::transform (uh.begin_dof(), uh.end_dof(), vh.begin_dof(), rounder(prec));
49 return vh;
50}
51
52}//namespace rheolef
53#endif // _RHEOLEF_ROUND_H
iterator begin_dof()
Definition field.h:595
iterator end_dof()
Definition field.h:603
the finite element space
Definition space.h:382
Expr1::float_type T
Definition field_expr.h:230
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
std::enable_if< details::is_field_expr_affine_homogeneous< Expr >::value, field_basic< typenameExpr::scalar_type, typenameExpr::memory_type > >::type round(const Expr &expr, const T2 &prec)
Definition round.h:37
rounder_type< T > rounder(const T &prec)
Definition rounder.h:60
Expr1::memory_type M