an efficient C++ finite element environment
|
|
Go to the documentation of this file. 1 #include "rheolef/adapt.h"
22 #include "rheolef/form.h"
23 #include "rheolef/field_component.h"
24 #include "rheolef/field_expr.h"
29 template<
class T,
class M>
30 geo_basic<T,M>
adapt_gmsh (
const field_basic<T,M>& uh,
const adapt_option& opts);
31 template<
class T,
class M>
32 geo_basic<T,M>
adapt_bamg (
const field_basic<T,M>& uh,
const adapt_option& opts);
37 template<
class T,
class M>
42 if (Uh.get_approx() == approx)
return uh;
54 template<
class T,
class M>
58 check_macro (Xh.get_approx() ==
"P1",
"smooth: expect P1 approx, but have " << Xh.get_approx());
63 for (
size_t i = 0; i <
n; i++) {
71 template<
class T,
class M>
78 check_macro (Xh.valued() ==
"scalar",
"hessian: unexpected "<<Xh.valued()<<
"-valued field");
79 check_macro (Xh.get_approx() ==
"P1",
"hessian: unexpected "<<Xh.get_approx()<<
" approximation");
86 gh.set_u() = smv.
solve ((bv*uh).
u());
102 template<
class T,
class M>
117 for (
size_type i_comp = 0; i_comp <
d; i_comp++) {
118 for (
size_type j_comp = 0; j_comp <
d; j_comp++) {
119 hh_comp[i_comp][j_comp].
proxy_assign (hh(i_comp,j_comp));
120 mh_comp[i_comp][j_comp].
proxy_assign (mh(i_comp,j_comp));
125 for (
size_type i_comp = 0; i_comp <
d; i_comp++) {
126 for (
size_type j_comp = 0; j_comp <
d; j_comp++) {
127 h_value(i_comp,j_comp) = hh_comp[i_comp][j_comp].
dof (idof);
129 const bool use_svd_when_2d =
true;
131 if (use_svd_when_2d &&
d == 2) {
137 T h_min = std::numeric_limits<T>::max();
138 for (
size_type i_comp = 0; i_comp <
d; i_comp++) {
143 h_min = std::min (h_min,
h_local[i_comp]);
146 sh.
dof (idof) = h_min;
150 for (
size_type i_comp = 0; i_comp <
d; i_comp++) {
151 for (
size_type j_comp = 0; j_comp <
d; j_comp++) {
152 mh_comp[i_comp][j_comp].
dof (idof) = m_value(i_comp,j_comp);
156 T uh_scale = std::max(cut_off, fabs(uh.
max() - uh.
min()));
157 T factor = opts.
hcoef*sqrt(uh_scale)*
pow(opts.
err,1./(k+1));
170 template<
class T,
class M>
176 size_t d = uh.
get_geo().dimension();
188 #define _RHEOLEF_instanciation(T,M) \
189 template field_basic<T,M> proj (const field_basic<T,M>&, const std::string&); \
190 template field_basic<T,M> smooth (const field_basic<T,M>&, size_t); \
191 template field_basic<T,M> hessian (const field_basic<T,M>&); \
192 template field_basic<T,M> hessian_criterion (const field_basic<T,M>&, const adapt_option&); \
193 template geo_basic<T,M> adapt (const field_basic<T,M>&, const adapt_option&);
196 #ifdef _RHEOLEF_HAVE_MPI
198 #endif // _RHEOLEF_HAVE_MPI
size_type ndof(const basis_basic< T > &b, const geo_size &gs, size_type map_dim)
const space_type & get_space() const
geo_basic< T, M > adapt_bamg(const field_basic< T, M > &uh, const adapt_option &opts)
geo_basic< T, M > adapt(const field_basic< T, M > &uh, const adapt_option &opts)
adapt(uh,opts): see the adapt page for the full documentation
field gh(Float epsilon, Float t, const field &uh, const test &v)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
_RHEOLEF_instanciation(Float, sequential, std::allocator< Float >) _RHEOLEF_instanciation(Float
point_basic< T > eig(tensor_basic< T > &q, size_t dim=3) const
csr< T, M > diag(const vec< T, M > &d)
adapt_option: see the adapt page for the full documentation
details::field_expr_v2_nonlinear_terminal_function< details::h_local_pseudo_function< Float > > h_local()
h_local: see the expression page for the full documentation
field_component< T, M > & proxy_assign(field_component< T, M > &&uh_comp)
space_mult_list< T, M > pow(const space_basic< T, M > &X, size_t n)
const geo_type & get_geo() const
point_basic< T > svd(tensor_basic< T > &u, tensor_basic< T > &v, size_t dim=3) const
size_type n_smooth_metric
This file is part of Rheolef.
field_component_const< T, M > & proxy_assign(const field_component_const< T, M > &uh_comp)
const T & dof(size_type idof) const
see the Float page for the full documentation
field_basic< T, M > proj(const field_basic< T, M > &uh, const std::string &approx="P1")
const std::string & valued() const
field::size_type size_type
field_basic< T, M > hessian(const field_basic< T, M > &uh)
field_basic< T, M > smooth(const field_basic< T, M > &uh, size_t n=1)
csr< T, sequential > trans(const csr< T, sequential > &a)
trans(a): see the form page for the full documentation
field_basic< T, M > hessian_criterion(const field_basic< T, M > &uh0, const adapt_option &opts)
geo_basic< T, M > adapt_gmsh(const field_basic< T, M > &uh, const adapt_option &opts)
vec< T, M > solve(const vec< T, M > &b) const