round.h
Go to the documentation of this file.
#ifndef _RHEOLEF_ROUND_H
#define _RHEOLEF_ROUND_H
#include "rheolef/rounder.h"
#include "rheolef/field_expr.h"
namespace rheolef {
template<class Expr, class T2>
typename
std::enable_if<
details::is_field_expr_affine_homogeneous<Expr>::value
,field_basic<
typename Expr::scalar_type
,typename Expr::memory_type
>
>::type
round (
const Expr& expr,
const T2& prec)
{
typedef typename Expr::scalar_type T;
typedef typename Expr::memory_type M;
space_basic<T,M> Xh;
check_macro (expr.have_homogeneous_space (Xh),
"round(field_expr, prec): field_expr should have homogeneous space. HINT: use round(interpolate(Xh, field_expr), prec)");
field_basic<T,M> uh = expr; // create a tmp because expr has no expr.end_dof()
field_basic<T,M> vh (Xh);
std::transform (uh.begin_dof(), uh.end_dof(), vh.begin_dof(), rounder(prec));
return vh;
}
}//namespace rheolef
#endif // _RHEOLEF_ROUND_H
mkgeo_ball.expr
expr
Definition: mkgeo_ball.sh:361
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
rheolef::space_basic
the finite element space
Definition: space.h:352
rheolef::type
rheolef::std type
rheolef::field_basic
Definition: field_expr_utilities.h:38
rheolef::field_basic::end_dof
iterator end_dof()
Definition: field.h:509
rheolef::field_basic::begin_dof
iterator begin_dof()
Definition: field.h:501
rheolef::round
std::enable_if< details::is_field_expr_affine_homogeneous< Expr >::value,field_basic< typename Expr::scalar_type,typename Expr::memory_type >>::type round(const Expr &expr, const T2 &prec)
Definition: round.h:37
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
M
Expr1::memory_type M
Definition: vec_expr_v2.h:385
T
Expr1::float_type T
Definition: field_expr.h:218
rheolef::rounder
rounder_type< T > rounder(const T &prec)
Definition: rounder.h:60