37 void lagrange_vec_nodal_soln(
const Elem * elem,
39 const std::vector<Number> & elem_soln,
41 std::vector<Number> & nodal_soln)
43 const unsigned int n_nodes = elem->n_nodes();
46 const Order totalorder =
static_cast<Order>(order+elem->p_level());
59 libmesh_assert_equal_to (elem_soln.size(), 2*3);
60 libmesh_assert_equal_to (nodal_soln.size(), 2*6);
63 nodal_soln[0] = elem_soln[0];
64 nodal_soln[1] = elem_soln[1];
67 nodal_soln[2] = elem_soln[2];
68 nodal_soln[3] = elem_soln[3];
71 nodal_soln[4] = elem_soln[4];
72 nodal_soln[5] = elem_soln[5];
75 nodal_soln[6] = .5*(elem_soln[0] + elem_soln[2]);
76 nodal_soln[7] = .5*(elem_soln[1] + elem_soln[3]);
79 nodal_soln[8] = .5*(elem_soln[2] + elem_soln[4]);
80 nodal_soln[9] = .5*(elem_soln[3] + elem_soln[5]);
83 nodal_soln[10] = .5*(elem_soln[0] + elem_soln[4]);
84 nodal_soln[11] = .5*(elem_soln[1] + elem_soln[5]);
93 libmesh_assert_equal_to (elem_soln.size(), 2*4);
96 libmesh_assert_equal_to (nodal_soln.size(), 2*8);
98 libmesh_assert_equal_to (nodal_soln.size(), 2*9);
101 nodal_soln[0] = elem_soln[0];
102 nodal_soln[1] = elem_soln[1];
105 nodal_soln[2] = elem_soln[2];
106 nodal_soln[3] = elem_soln[3];
109 nodal_soln[4] = elem_soln[4];
110 nodal_soln[5] = elem_soln[5];
113 nodal_soln[6] = elem_soln[6];
114 nodal_soln[7] = elem_soln[7];
117 nodal_soln[8] = .5*(elem_soln[0] + elem_soln[2]);
118 nodal_soln[9] = .5*(elem_soln[1] + elem_soln[3]);
121 nodal_soln[10] = .5*(elem_soln[2] + elem_soln[4]);
122 nodal_soln[11] = .5*(elem_soln[3] + elem_soln[5]);
125 nodal_soln[12] = .5*(elem_soln[4] + elem_soln[6]);
126 nodal_soln[13] = .5*(elem_soln[5] + elem_soln[7]);
129 nodal_soln[14] = .5*(elem_soln[6] + elem_soln[0]);
130 nodal_soln[15] = .5*(elem_soln[7] + elem_soln[1]);
135 nodal_soln[16] = .25*(elem_soln[0] + elem_soln[2] + elem_soln[4] + elem_soln[6]);
136 nodal_soln[17] = .25*(elem_soln[1] + elem_soln[3] + elem_soln[5] + elem_soln[7]);
145 libmesh_assert_equal_to (elem_soln.size(), 3*4);
146 libmesh_assert_equal_to (nodal_soln.size(), 3*10);
149 nodal_soln[0] = elem_soln[0];
150 nodal_soln[1] = elem_soln[1];
151 nodal_soln[2] = elem_soln[2];
154 nodal_soln[3] = elem_soln[3];
155 nodal_soln[4] = elem_soln[4];
156 nodal_soln[5] = elem_soln[5];
159 nodal_soln[6] = elem_soln[6];
160 nodal_soln[7] = elem_soln[7];
161 nodal_soln[8] = elem_soln[8];
164 nodal_soln[9] = elem_soln[9];
165 nodal_soln[10] = elem_soln[10];
166 nodal_soln[11] = elem_soln[11];
169 nodal_soln[12] = .5*(elem_soln[0] + elem_soln[3]);
170 nodal_soln[13] = .5*(elem_soln[1] + elem_soln[4]);
171 nodal_soln[14] = .5*(elem_soln[2] + elem_soln[5]);
174 nodal_soln[15] = .5*(elem_soln[3] + elem_soln[6]);
175 nodal_soln[16] = .5*(elem_soln[4] + elem_soln[7]);
176 nodal_soln[17] = .5*(elem_soln[5] + elem_soln[8]);
179 nodal_soln[18] = .5*(elem_soln[6] + elem_soln[0]);
180 nodal_soln[19] = .5*(elem_soln[7] + elem_soln[1]);
181 nodal_soln[20] = .5*(elem_soln[8] + elem_soln[2]);
184 nodal_soln[21] = .5*(elem_soln[9] + elem_soln[0]);
185 nodal_soln[22] = .5*(elem_soln[10] + elem_soln[1]);
186 nodal_soln[23] = .5*(elem_soln[11] + elem_soln[2]);
189 nodal_soln[24] = .5*(elem_soln[9] + elem_soln[3]);
190 nodal_soln[25] = .5*(elem_soln[10] + elem_soln[4]);
191 nodal_soln[26] = .5*(elem_soln[11] + elem_soln[5]);
194 nodal_soln[27] = .5*(elem_soln[9] + elem_soln[6]);
195 nodal_soln[28] = .5*(elem_soln[10] + elem_soln[7]);
196 nodal_soln[29] = .5*(elem_soln[11] + elem_soln[8]);
205 libmesh_assert_equal_to (elem_soln.size(), 3*8);
208 libmesh_assert_equal_to (nodal_soln.size(), 3*20);
210 libmesh_assert_equal_to (nodal_soln.size(), 3*27);
213 nodal_soln[0] = elem_soln[0];
214 nodal_soln[1] = elem_soln[1];
215 nodal_soln[2] = elem_soln[2];
218 nodal_soln[3] = elem_soln[3];
219 nodal_soln[4] = elem_soln[4];
220 nodal_soln[5] = elem_soln[5];
223 nodal_soln[6] = elem_soln[6];
224 nodal_soln[7] = elem_soln[7];
225 nodal_soln[8] = elem_soln[8];
228 nodal_soln[9] = elem_soln[9];
229 nodal_soln[10] = elem_soln[10];
230 nodal_soln[11] = elem_soln[11];
233 nodal_soln[12] = elem_soln[12];
234 nodal_soln[13] = elem_soln[13];
235 nodal_soln[14] = elem_soln[14];
238 nodal_soln[15] = elem_soln[15];
239 nodal_soln[16] = elem_soln[16];
240 nodal_soln[17] = elem_soln[17];
243 nodal_soln[18] = elem_soln[18];
244 nodal_soln[19] = elem_soln[19];
245 nodal_soln[20] = elem_soln[20];
248 nodal_soln[21] = elem_soln[21];
249 nodal_soln[22] = elem_soln[22];
250 nodal_soln[23] = elem_soln[23];
253 nodal_soln[24] = .5*(elem_soln[0] + elem_soln[3]);
254 nodal_soln[25] = .5*(elem_soln[1] + elem_soln[4]);
255 nodal_soln[26] = .5*(elem_soln[2] + elem_soln[5]);
258 nodal_soln[27] = .5*(elem_soln[3] + elem_soln[6]);
259 nodal_soln[28] = .5*(elem_soln[4] + elem_soln[7]);
260 nodal_soln[29] = .5*(elem_soln[5] + elem_soln[8]);
263 nodal_soln[30] = .5*(elem_soln[6] + elem_soln[9]);
264 nodal_soln[31] = .5*(elem_soln[7] + elem_soln[10]);
265 nodal_soln[32] = .5*(elem_soln[8] + elem_soln[11]);
268 nodal_soln[33] = .5*(elem_soln[9] + elem_soln[0]);
269 nodal_soln[34] = .5*(elem_soln[10] + elem_soln[1]);
270 nodal_soln[35] = .5*(elem_soln[11] + elem_soln[2]);
273 nodal_soln[36] = .5*(elem_soln[0] + elem_soln[12]);
274 nodal_soln[37] = .5*(elem_soln[1] + elem_soln[13]);
275 nodal_soln[38] = .5*(elem_soln[2] + elem_soln[14]);
278 nodal_soln[39] = .5*(elem_soln[3] + elem_soln[15]);
279 nodal_soln[40] = .5*(elem_soln[4] + elem_soln[16]);
280 nodal_soln[41] = .5*(elem_soln[5] + elem_soln[17]);
283 nodal_soln[42] = .5*(elem_soln[6] + elem_soln[18]);
284 nodal_soln[43] = .5*(elem_soln[7] + elem_soln[19]);
285 nodal_soln[44] = .5*(elem_soln[8] + elem_soln[20]);
288 nodal_soln[45] = .5*(elem_soln[9] + elem_soln[21]);
289 nodal_soln[46] = .5*(elem_soln[10] + elem_soln[22]);
290 nodal_soln[47] = .5*(elem_soln[11] + elem_soln[23]);
293 nodal_soln[48] = .5*(elem_soln[12] + elem_soln[15]);
294 nodal_soln[49] = .5*(elem_soln[13] + elem_soln[16]);
295 nodal_soln[50] = .5*(elem_soln[14] + elem_soln[17]);
298 nodal_soln[51] = .5*(elem_soln[15] + elem_soln[18]);
299 nodal_soln[52] = .5*(elem_soln[16] + elem_soln[19]);
300 nodal_soln[53] = .5*(elem_soln[17] + elem_soln[20]);
303 nodal_soln[54] = .5*(elem_soln[18] + elem_soln[21]);
304 nodal_soln[55] = .5*(elem_soln[19] + elem_soln[22]);
305 nodal_soln[56] = .5*(elem_soln[20] + elem_soln[23]);
308 nodal_soln[57] = .5*(elem_soln[12] + elem_soln[21]);
309 nodal_soln[58] = .5*(elem_soln[13] + elem_soln[22]);
310 nodal_soln[59] = .5*(elem_soln[14] + elem_soln[23]);
315 nodal_soln[60] = .25*(elem_soln[0] + elem_soln[3] + elem_soln[6] + elem_soln[9]);
316 nodal_soln[61] = .25*(elem_soln[1] + elem_soln[4] + elem_soln[7] + elem_soln[10]);
317 nodal_soln[62] = .25*(elem_soln[2] + elem_soln[5] + elem_soln[8] + elem_soln[11]);
320 nodal_soln[63] = .25*(elem_soln[0] + elem_soln[3] + elem_soln[12] + elem_soln[15]);
321 nodal_soln[64] = .25*(elem_soln[1] + elem_soln[4] + elem_soln[13] + elem_soln[16]);
322 nodal_soln[65] = .25*(elem_soln[2] + elem_soln[5] + elem_soln[14] + elem_soln[17]);
325 nodal_soln[66] = .25*(elem_soln[3] + elem_soln[6] + elem_soln[15] + elem_soln[18]);
326 nodal_soln[67] = .25*(elem_soln[4] + elem_soln[7] + elem_soln[16] + elem_soln[19]);
327 nodal_soln[68] = .25*(elem_soln[5] + elem_soln[8] + elem_soln[17] + elem_soln[20]);
330 nodal_soln[69] = .25*(elem_soln[6] + elem_soln[9] + elem_soln[18] + elem_soln[21]);
331 nodal_soln[70] = .25*(elem_soln[7] + elem_soln[10] + elem_soln[19] + elem_soln[22]);
332 nodal_soln[71] = .25*(elem_soln[8] + elem_soln[11] + elem_soln[20] + elem_soln[23]);
335 nodal_soln[72] = .25*(elem_soln[9] + elem_soln[0] + elem_soln[21] + elem_soln[12]);
336 nodal_soln[73] = .25*(elem_soln[10] + elem_soln[1] + elem_soln[22] + elem_soln[13]);
337 nodal_soln[74] = .25*(elem_soln[11] + elem_soln[2] + elem_soln[23] + elem_soln[14]);
340 nodal_soln[75] = .25*(elem_soln[12] + elem_soln[15] + elem_soln[18] + elem_soln[21]);
341 nodal_soln[76] = .25*(elem_soln[13] + elem_soln[16] + elem_soln[19] + elem_soln[22]);
342 nodal_soln[77] = .25*(elem_soln[14] + elem_soln[17] + elem_soln[20] + elem_soln[23]);
345 nodal_soln[78] = .125*(elem_soln[0] + elem_soln[3] + elem_soln[6] + elem_soln[9] +
346 elem_soln[12] + elem_soln[15] + elem_soln[18] + elem_soln[21]);
348 nodal_soln[79] = .125*(elem_soln[1] + elem_soln[4] + elem_soln[7] + elem_soln[10] +
349 elem_soln[13] + elem_soln[16] + elem_soln[19] + elem_soln[22]);
351 nodal_soln[80] = .125*(elem_soln[2] + elem_soln[5] + elem_soln[8] + elem_soln[11] +
352 elem_soln[14] + elem_soln[17] + elem_soln[20] + elem_soln[23]);
362 libmesh_assert_equal_to (elem_soln.size(), 3*6);
365 libmesh_assert_equal_to (nodal_soln.size(), 3*15);
367 libmesh_assert_equal_to (nodal_soln.size(), 3*18);
370 nodal_soln[0] = elem_soln[0];
371 nodal_soln[1] = elem_soln[1];
372 nodal_soln[2] = elem_soln[2];
375 nodal_soln[3] = elem_soln[3];
376 nodal_soln[4] = elem_soln[4];
377 nodal_soln[5] = elem_soln[5];
380 nodal_soln[6] = elem_soln[6];
381 nodal_soln[7] = elem_soln[7];
382 nodal_soln[8] = elem_soln[8];
385 nodal_soln[9] = elem_soln[9];
386 nodal_soln[10] = elem_soln[10];
387 nodal_soln[11] = elem_soln[11];
390 nodal_soln[12] = elem_soln[12];
391 nodal_soln[13] = elem_soln[13];
392 nodal_soln[14] = elem_soln[14];
395 nodal_soln[15] = elem_soln[15];
396 nodal_soln[16] = elem_soln[16];
397 nodal_soln[17] = elem_soln[17];
400 nodal_soln[18] = .5*(elem_soln[0] + elem_soln[3]);
401 nodal_soln[19] = .5*(elem_soln[1] + elem_soln[4]);
402 nodal_soln[20] = .5*(elem_soln[2] + elem_soln[5]);
405 nodal_soln[21] = .5*(elem_soln[3] + elem_soln[6]);
406 nodal_soln[22] = .5*(elem_soln[4] + elem_soln[7]);
407 nodal_soln[23] = .5*(elem_soln[5] + elem_soln[8]);
410 nodal_soln[24] = .5*(elem_soln[0] + elem_soln[6]);
411 nodal_soln[25] = .5*(elem_soln[1] + elem_soln[7]);
412 nodal_soln[26] = .5*(elem_soln[2] + elem_soln[8]);
415 nodal_soln[27] = .5*(elem_soln[0] + elem_soln[9]);
416 nodal_soln[28] = .5*(elem_soln[1] + elem_soln[10]);
417 nodal_soln[29] = .5*(elem_soln[2] + elem_soln[11]);
420 nodal_soln[30] = .5*(elem_soln[3] + elem_soln[12]);
421 nodal_soln[31] = .5*(elem_soln[4] + elem_soln[13]);
422 nodal_soln[32] = .5*(elem_soln[5] + elem_soln[14]);
425 nodal_soln[33] = .5*(elem_soln[6] + elem_soln[15]);
426 nodal_soln[34] = .5*(elem_soln[7] + elem_soln[16]);
427 nodal_soln[35] = .5*(elem_soln[8] + elem_soln[17]);
430 nodal_soln[36] = .5*(elem_soln[9] + elem_soln[12]);
431 nodal_soln[37] = .5*(elem_soln[10] + elem_soln[13]);
432 nodal_soln[38] = .5*(elem_soln[11] + elem_soln[14]);
435 nodal_soln[39] = .5*(elem_soln[12] + elem_soln[15]);
436 nodal_soln[40] = .5*(elem_soln[13] + elem_soln[16]);
437 nodal_soln[41] = .5*(elem_soln[14] + elem_soln[17]);
440 nodal_soln[42] = .5*(elem_soln[12] + elem_soln[15]);
441 nodal_soln[43] = .5*(elem_soln[13] + elem_soln[16]);
442 nodal_soln[44] = .5*(elem_soln[14] + elem_soln[17]);
447 nodal_soln[45] = .25*(elem_soln[0] + elem_soln[3] + elem_soln[12] + elem_soln[9]);
448 nodal_soln[46] = .25*(elem_soln[1] + elem_soln[4] + elem_soln[13] + elem_soln[10]);
449 nodal_soln[47] = .25*(elem_soln[2] + elem_soln[5] + elem_soln[14] + elem_soln[11]);
452 nodal_soln[48] = .25*(elem_soln[3] + elem_soln[6] + elem_soln[15] + elem_soln[12]);
453 nodal_soln[49] = .25*(elem_soln[4] + elem_soln[7] + elem_soln[16] + elem_soln[13]);
454 nodal_soln[50] = .25*(elem_soln[5] + elem_soln[8] + elem_soln[17] + elem_soln[14]);
457 nodal_soln[51] = .25*(elem_soln[6] + elem_soln[0] + elem_soln[9] + elem_soln[15]);
458 nodal_soln[52] = .25*(elem_soln[7] + elem_soln[1] + elem_soln[10] + elem_soln[16]);
459 nodal_soln[53] = .25*(elem_soln[8] + elem_soln[2] + elem_soln[11] + elem_soln[17]);
469 nodal_soln = elem_soln;
484 nodal_soln = elem_soln;
509 const std::vector<Number> & elem_soln,
510 std::vector<Number> & nodal_soln)
516 const std::vector<Number> & elem_soln,
517 std::vector<Number> & nodal_soln)
523 const std::vector<Number> & elem_soln,
524 std::vector<Number> & nodal_soln)
525 { lagrange_vec_nodal_soln(elem, order, elem_soln, 2 , nodal_soln); }
530 const std::vector<Number> & elem_soln,
531 std::vector<Number> & nodal_soln)
532 { lagrange_vec_nodal_soln(elem, order, elem_soln, 3 , nodal_soln); }
539 const unsigned int i,
const Point & p)
545 const unsigned int i,
const unsigned int j,
552 const unsigned int i,
const unsigned int j,
561 const unsigned int i,
const Point & p)
567 const unsigned int i,
const unsigned int j,
574 const unsigned int i,
const unsigned int j,
583 const unsigned int i,
const Point & p)
596 libmesh_error_msg(
"i%2 must be either 0 or 1!");
603 const unsigned int i,
const unsigned int j,
617 libmesh_error_msg(
"i%2 must be either 0 or 1!");
624 const unsigned int i,
const unsigned int j,
638 libmesh_error_msg(
"i%2 must be either 0 or 1!");
648 const unsigned int i,
const Point & p)
664 libmesh_error_msg(
"i%3 must be 0, 1, or 2!");
671 const unsigned int i,
const unsigned int j,
688 libmesh_error_msg(
"i%3 must be 0, 1, or 2!");
695 const unsigned int i,
const unsigned int j,
712 libmesh_error_msg(
"i%3 must be 0, 1, or 2!");
723 const unsigned int i,
const Point & p)
729 const unsigned int i,
const unsigned int j,
736 const unsigned int i,
const unsigned int j,
745 const unsigned int i,
const Point & p)
751 const unsigned int i,
const unsigned int j,
758 const unsigned int i,
const unsigned int j,
767 const unsigned int i,
const Point & p)
780 libmesh_error_msg(
"i%2 must be either 0 or 1!");
787 const unsigned int i,
const unsigned int j,
801 libmesh_error_msg(
"i%2 must be either 0 or 1!");
808 const unsigned int i,
const unsigned int j,
822 libmesh_error_msg(
"i%2 must be either 0 or 1!");
831 const unsigned int i,
const Point & p)
847 libmesh_error_msg(
"i%3 must be 0, 1, or 2!");
854 const unsigned int i,
const unsigned int j,
871 libmesh_error_msg(
"i%3 must be 0, 1, or 2!");
878 const unsigned int i,
const unsigned int j,
895 libmesh_error_msg(
"i%3 must be 0, 1, or 2!");
948 #ifdef LIBMESH_ENABLE_AMR 952 const unsigned int variable_number,
961 const unsigned int variable_number,
966 #endif // LIBMESH_ENABLE_AMR static unsigned int n_dofs(const ElemType t, const Order o)
RealVectorValue RealGradient
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
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)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
unsigned int p_level() const
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 void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
static unsigned int n_dofs_per_elem(const ElemType t, const Order o)
virtual FEContinuity get_continuity() const override
static void compute_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
virtual ElemType type() const =0
A geometric point in (x,y,z) space.
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)