32 const std::string &Theta,
33 const std::string ¶m_E,
34 const std::string ¶m_nu,
35 const std::string ¶m_epsilon,
36 const std::string ¶m_kappa,
41 std::string test_U =
"Test_" + sup_previous_and_dot_to_varname(U);
42 std::string test_Theta =
"Test_" + sup_previous_and_dot_to_varname(Theta);
43 std::string proj_Theta = (variant == 2) ?
44 (
"Elementary_transformation("+Theta+
",_2D_rotated_RT0_projection__434)")
46 std::string proj_test_Theta = (variant == 2) ?
47 (
"Elementary_transformation("+test_Theta
48 +
",_2D_rotated_RT0_projection__434)") : test_Theta;
50 std::string D =
"(("+param_E+
")*pow("+param_epsilon+
51 ",3))/(12*(1-sqr("+param_nu+
")))";
52 std::string G =
"(("+param_E+
")*("+param_epsilon+
"))*("+param_kappa+
53 ")/(2*(1+("+param_nu+
")))";
54 std::string E_theta =
"(Grad_" + Theta +
"+(Grad_" + Theta +
")')/2";
55 std::string E_test_Theta=
"(Grad_"+test_Theta+
"+(Grad_"+test_Theta+
")')/2";
57 std::string expr_left =
58 D+
"*(( 1-("+param_nu+
"))*("+E_theta+
"):("+E_test_Theta+
")+("+param_nu+
59 ")*Trace("+E_theta+
")*Trace("+E_test_Theta+
"))";
61 std::string expr_right =
62 "("+G+
")*(Grad_"+U+
"-"+proj_Theta+
").Grad_"+test_U+
63 "-("+G+
")*(Grad_"+U+
"-"+proj_Theta+
")."+proj_test_Theta;
67 return add_linear_generic_assembly_brick
68 (md, mim, expr_left+
"+"+expr_right, region,
false,
false,
69 "Reissner-Mindlin plate model brick");
71 add_linear_generic_assembly_brick
72 (md, mim, expr_left, region,
false,
false,
73 "Reissner-Mindlin plate model brick, rotation term");
74 return add_linear_generic_assembly_brick
75 (md, mim_red, expr_right, region,
false,
false,
76 "Reissner-Mindlin plate model brick, transverse shear term");
79 return add_linear_generic_assembly_brick
80 (md, mim, expr_left+
"+"+expr_right, region,
false,
false,
81 "Reissner-Mindlin plate model brick");
83 default: GMM_ASSERT1(
false,
"Invalid variant for Reissner-Mindlin brick.");
100 class _2D_Rotated_RT0_projection_transformation
101 :
public virtual_elementary_transformation {
106 base_matrix &M)
const{
108 DEFINE_STATIC_THREAD_LOCAL(base_matrix, M_old);
109 DEFINE_STATIC_THREAD_LOCAL_INITIALIZED(
pfem, pf_old, 0);
114 GMM_ASSERT1(pf1->dim() == 2,
"This projection is only defined " 115 "for two-dimensional elements");
118 bool simplex =
false;
121 }
else if (pf1->ref_convex(cv)
125 GMM_ASSERT1(
false,
"Cannot adapt the method for such an element.");
128 if (pf1 == pf_old && pf1->is_equivalent() && M.size() == M_old.size()) {
133 std::stringstream fem_desc;
134 fem_desc <<
"FEM_RT0" << (simplex ?
"":
"Q") <<
"(" << N <<
")";
138 size_type degree = pf1->estimated_degree() + pf2->estimated_degree();
140 papprox_integration pim
144 size_type ndof1 = pf1->nb_dof(cv) * qmult;
146 base_matrix M1(ndof1, ndof1), M2(ndof2, ndof2), B(ndof1, ndof2);
147 base_matrix aux0(ndof1, ndof1), aux1(ndof1, ndof2), aux2(ndof1, ndof2);
148 base_matrix aux3(ndof2, ndof2);
152 bgeot::vectors_to_base_matrix(G, mf.
linked_mesh().points_of_convex(cv));
157 base_matrix tv1, tv2;
159 for (
size_type i = 0; i < pim->nb_points_on_convex(); ++i) {
161 scalar_type coeff = pim->coeff(i);
162 ctx1.set_xref(pim->point(i));
164 pf1->real_base_value(ctx1, t1);
165 vectorize_base_tensor(t1, tv1, ndof1, pf1->target_dim(), N);
166 pf2->real_base_value(ctx2, t2);
167 vectorize_base_tensor(t2, tv2, ndof2, pf2->target_dim(), N);
168 for (
size_type j = 0; j < ndof2; ++j) std::swap(tv2(j,0), tv2(j,1));
170 gmm::mult(tv1, gmm::transposed(tv1), aux0);
171 gmm::add(gmm::scaled(aux0, coeff), M1);
172 gmm::mult(tv2, gmm::transposed(tv2), aux3);
173 gmm::add(gmm::scaled(aux3, coeff), M2);
174 gmm::mult(tv1, gmm::transposed(tv2), aux1);
175 gmm::add(gmm::scaled(aux1, coeff), B);
182 gmm::mult(M1, B, aux1);
183 gmm::mult(aux1, M2, aux2);
184 GMM_ASSERT1(gmm::mat_nrows(M) == ndof1,
185 "Element not convenient for projection");
186 gmm::mult(aux2, gmm::transposed(B), M);
187 gmm::clean(M, 1E-15);
188 M_old = M; pf_old = pf1;
195 pelementary_transformation
196 p = std::make_shared<_2D_Rotated_RT0_projection_transformation>();
pfem fem_descriptor(const std::string &name)
get a fem descriptor from its string name.
virtual pfem fem_of_element(size_type cv) const
Return the basic fem associated with an element (if no fem is associated, the function will crash! us...
Describe an integration method linked to a mesh.
``Model'' variables store the variables, the data and the description of a model. ...
size_t size_type
used as the common size type in the library
Reissner-Mindlin plate model brick.
structure passed as the argument of fem interpolation functions.
GEneric Tool for Finite Element Methods.
std::shared_ptr< const getfem::virtual_fem > pfem
type of pointer on a fem description
Describe a finite element method linked to a mesh.
size_type add_Mindlin_Reissner_plate_brick(model &md, const mesh_im &mim, const mesh_im &mim_reduced, const std::string &u3, const std::string &Theta, const std::string ¶m_E, const std::string ¶m_nu, const std::string ¶m_epsilon, const std::string ¶m_kappa, size_type variant=size_type(2), size_type region=size_type(-1))
Add a term corresponding to the classical Reissner-Mindlin plate model for which u3 is the transverse...
void add_2D_rotated_RT0_projection(model &md, std::string name)
Add the elementary transformation corresponding to the projection on rotated RT0 element for two-dime...
pconvex_ref parallelepiped_of_reference(dim_type nc, dim_type k)
parallelepiped of reference of dimension nc (and degree 1)
pintegration_method classical_approx_im(bgeot::pgeometric_trans pgt, dim_type degree)
try to find an approximate integration method for the geometric transformation pgt which is able to i...
void add_elementary_transformation(const std::string &name, pelementary_transformation ptrans)
Add an elementary transformation to the model to be used with the generic assembly.
void set_xref(const base_node &P)
change the current point (coordinates given in the reference convex)
const mesh & linked_mesh() const
Return a reference to the underlying mesh.
pconvex_ref simplex_of_reference(dim_type nc, short_type K)
returns a simplex of reference of dimension nc and degree k
std::shared_ptr< const bgeot::geometric_trans > pgeometric_trans
pointer type for a geometric transformation