37 void l2_lagrange_nodal_soln(
const Elem * elem,
39 const std::vector<Number> & elem_soln,
40 std::vector<Number> & nodal_soln)
42 const unsigned int n_nodes = elem->n_nodes();
45 const Order totalorder =
static_cast<Order>(order+elem->p_level());
60 libmesh_assert_equal_to (elem_soln.size(), 2);
61 libmesh_assert_equal_to (nodal_soln.size(), 3);
63 nodal_soln[0] = elem_soln[0];
64 nodal_soln[1] = elem_soln[1];
65 nodal_soln[2] = .5*(elem_soln[0] + elem_soln[1]);
72 libmesh_assert_equal_to (elem_soln.size(), 2);
73 libmesh_assert_equal_to (nodal_soln.size(), 4);
75 nodal_soln[0] = elem_soln[0];
76 nodal_soln[1] = elem_soln[1];
77 nodal_soln[2] = (2.*elem_soln[0] + elem_soln[1])/3.;
78 nodal_soln[3] = (elem_soln[0] + 2.*elem_soln[1])/3.;
86 libmesh_assert_equal_to (elem_soln.size(), 3);
87 libmesh_assert_equal_to (nodal_soln.size(), 6);
89 nodal_soln[0] = elem_soln[0];
90 nodal_soln[1] = elem_soln[1];
91 nodal_soln[2] = elem_soln[2];
92 nodal_soln[3] = .5*(elem_soln[0] + elem_soln[1]);
93 nodal_soln[4] = .5*(elem_soln[1] + elem_soln[2]);
94 nodal_soln[5] = .5*(elem_soln[2] + elem_soln[0]);
103 libmesh_assert_equal_to (elem_soln.size(), 4);
106 libmesh_assert_equal_to (nodal_soln.size(), 8);
108 libmesh_assert_equal_to (nodal_soln.size(), 9);
111 nodal_soln[0] = elem_soln[0];
112 nodal_soln[1] = elem_soln[1];
113 nodal_soln[2] = elem_soln[2];
114 nodal_soln[3] = elem_soln[3];
115 nodal_soln[4] = .5*(elem_soln[0] + elem_soln[1]);
116 nodal_soln[5] = .5*(elem_soln[1] + elem_soln[2]);
117 nodal_soln[6] = .5*(elem_soln[2] + elem_soln[3]);
118 nodal_soln[7] = .5*(elem_soln[3] + elem_soln[0]);
121 nodal_soln[8] = .25*(elem_soln[0] + elem_soln[1] + elem_soln[2] + elem_soln[3]);
129 libmesh_assert_equal_to (elem_soln.size(), 4);
130 libmesh_assert_equal_to (nodal_soln.size(), 10);
132 nodal_soln[0] = elem_soln[0];
133 nodal_soln[1] = elem_soln[1];
134 nodal_soln[2] = elem_soln[2];
135 nodal_soln[3] = elem_soln[3];
136 nodal_soln[4] = .5*(elem_soln[0] + elem_soln[1]);
137 nodal_soln[5] = .5*(elem_soln[1] + elem_soln[2]);
138 nodal_soln[6] = .5*(elem_soln[2] + elem_soln[0]);
139 nodal_soln[7] = .5*(elem_soln[3] + elem_soln[0]);
140 nodal_soln[8] = .5*(elem_soln[3] + elem_soln[1]);
141 nodal_soln[9] = .5*(elem_soln[3] + elem_soln[2]);
150 libmesh_assert_equal_to (elem_soln.size(), 8);
153 libmesh_assert_equal_to (nodal_soln.size(), 20);
155 libmesh_assert_equal_to (nodal_soln.size(), 27);
157 nodal_soln[0] = elem_soln[0];
158 nodal_soln[1] = elem_soln[1];
159 nodal_soln[2] = elem_soln[2];
160 nodal_soln[3] = elem_soln[3];
161 nodal_soln[4] = elem_soln[4];
162 nodal_soln[5] = elem_soln[5];
163 nodal_soln[6] = elem_soln[6];
164 nodal_soln[7] = elem_soln[7];
165 nodal_soln[8] = .5*(elem_soln[0] + elem_soln[1]);
166 nodal_soln[9] = .5*(elem_soln[1] + elem_soln[2]);
167 nodal_soln[10] = .5*(elem_soln[2] + elem_soln[3]);
168 nodal_soln[11] = .5*(elem_soln[3] + elem_soln[0]);
169 nodal_soln[12] = .5*(elem_soln[0] + elem_soln[4]);
170 nodal_soln[13] = .5*(elem_soln[1] + elem_soln[5]);
171 nodal_soln[14] = .5*(elem_soln[2] + elem_soln[6]);
172 nodal_soln[15] = .5*(elem_soln[3] + elem_soln[7]);
173 nodal_soln[16] = .5*(elem_soln[4] + elem_soln[5]);
174 nodal_soln[17] = .5*(elem_soln[5] + elem_soln[6]);
175 nodal_soln[18] = .5*(elem_soln[6] + elem_soln[7]);
176 nodal_soln[19] = .5*(elem_soln[4] + elem_soln[7]);
180 nodal_soln[20] = .25*(elem_soln[0] + elem_soln[1] + elem_soln[2] + elem_soln[3]);
181 nodal_soln[21] = .25*(elem_soln[0] + elem_soln[1] + elem_soln[4] + elem_soln[5]);
182 nodal_soln[22] = .25*(elem_soln[1] + elem_soln[2] + elem_soln[5] + elem_soln[6]);
183 nodal_soln[23] = .25*(elem_soln[2] + elem_soln[3] + elem_soln[6] + elem_soln[7]);
184 nodal_soln[24] = .25*(elem_soln[3] + elem_soln[0] + elem_soln[7] + elem_soln[4]);
185 nodal_soln[25] = .25*(elem_soln[4] + elem_soln[5] + elem_soln[6] + elem_soln[7]);
187 nodal_soln[26] = .125*(elem_soln[0] + elem_soln[1] + elem_soln[2] + elem_soln[3] +
188 elem_soln[4] + elem_soln[5] + elem_soln[6] + elem_soln[7]);
198 libmesh_assert_equal_to (elem_soln.size(), 6);
201 libmesh_assert_equal_to (nodal_soln.size(), 15);
203 libmesh_assert_equal_to (nodal_soln.size(), 18);
205 nodal_soln[0] = elem_soln[0];
206 nodal_soln[1] = elem_soln[1];
207 nodal_soln[2] = elem_soln[2];
208 nodal_soln[3] = elem_soln[3];
209 nodal_soln[4] = elem_soln[4];
210 nodal_soln[5] = elem_soln[5];
211 nodal_soln[6] = .5*(elem_soln[0] + elem_soln[1]);
212 nodal_soln[7] = .5*(elem_soln[1] + elem_soln[2]);
213 nodal_soln[8] = .5*(elem_soln[0] + elem_soln[2]);
214 nodal_soln[9] = .5*(elem_soln[0] + elem_soln[3]);
215 nodal_soln[10] = .5*(elem_soln[1] + elem_soln[4]);
216 nodal_soln[11] = .5*(elem_soln[2] + elem_soln[5]);
217 nodal_soln[12] = .5*(elem_soln[3] + elem_soln[4]);
218 nodal_soln[13] = .5*(elem_soln[4] + elem_soln[5]);
219 nodal_soln[14] = .5*(elem_soln[3] + elem_soln[5]);
223 nodal_soln[15] = .25*(elem_soln[0] + elem_soln[1] + elem_soln[4] + elem_soln[3]);
224 nodal_soln[16] = .25*(elem_soln[1] + elem_soln[2] + elem_soln[5] + elem_soln[4]);
225 nodal_soln[17] = .25*(elem_soln[2] + elem_soln[0] + elem_soln[3] + elem_soln[5]);
237 nodal_soln = elem_soln;
250 libmesh_assert_equal_to (elem_soln.size(), 3);
251 libmesh_assert_equal_to (nodal_soln.size(), 4);
254 nodal_soln[0] = elem_soln[0];
255 nodal_soln[1] = elem_soln[1];
256 nodal_soln[2] = (2.*elem_soln[0] - elem_soln[1] +
258 nodal_soln[3] = (-elem_soln[0] + 2.*elem_soln[1] +
267 nodal_soln = elem_soln;
281 nodal_soln = elem_soln;
291 unsigned int l2_lagrange_n_dofs(
const ElemType t,
const Order o)
412 libmesh_error_msg(
"ERROR: Invalid Order " <<
Utility::enum_to_string(o) <<
" selected for L2_LAGRANGE FE family!");
425 const std::vector<Number> & elem_soln,
426 std::vector<Number> & nodal_soln)
427 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
432 const std::vector<Number> & elem_soln,
433 std::vector<Number> & nodal_soln)
434 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
439 const std::vector<Number> & elem_soln,
440 std::vector<Number> & nodal_soln)
441 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
446 const std::vector<Number> & elem_soln,
447 std::vector<Number> & nodal_soln)
448 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
493 #ifdef LIBMESH_ENABLE_AMR 507 #endif // LIBMESH_ENABLE_AMR static unsigned int n_dofs(const ElemType t, const Order o)
The base class for all geometric element types.
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
virtual bool shapes_need_reinit() const override
virtual bool is_hierarchic() const override
Manages the degrees of freedom (DOFs) in a simulation.
const dof_id_type n_nodes
static unsigned int n_dofs_per_elem(const ElemType t, const Order o)
virtual FEContinuity get_continuity() const override
std::string enum_to_string(const T e)
static void compute_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)