21#include "libmesh/fe.h"
22#include "libmesh/inf_fe.h"
23#include "libmesh/libmesh_logging.h"
26#include "libmesh/boundary_info.h"
27#include "libmesh/mesh_base.h"
28#include "libmesh/dense_matrix.h"
29#include "libmesh/dense_vector.h"
30#include "libmesh/dof_map.h"
31#include "libmesh/elem.h"
32#include "libmesh/fe_interface.h"
33#include "libmesh/int_range.h"
34#include "libmesh/numeric_vector.h"
35#include "libmesh/periodic_boundary_base.h"
36#include "libmesh/periodic_boundaries.h"
37#include "libmesh/quadrature.h"
38#include "libmesh/quadrature_gauss.h"
39#include "libmesh/tensor_value.h"
40#include "libmesh/threads.h"
41#include "libmesh/fe_type.h"
42#include "libmesh/enum_to_string.h"
53#ifdef LIBMESH_ENABLE_PERIODIC
56const Elem * primary_boundary_point_neighbor(
const Elem * elem,
59 const std::set<boundary_id_type> & boundary_ids)
63 const Elem * primary = elem;
66 std::vector<boundary_id_type> bc_ids;
69 std::unique_ptr<const Elem> periodic_side;
71 std::set<const Elem *> point_neighbors;
73 for (
const auto & pt_neighbor : point_neighbors)
79 if ((pt_neighbor->level() > primary->
level()) ||
80 (pt_neighbor->level() == primary->
level() &&
81 pt_neighbor->id() < primary->
id()))
87 bool vertex_on_periodic_side =
false;
88 for (
auto ns : pt_neighbor->side_index_range())
92 bool on_relevant_boundary =
false;
93 for (
const auto &
id : boundary_ids)
94 if (
std::find(bc_ids.begin(), bc_ids.end(), id) != bc_ids.end())
95 on_relevant_boundary = true;
97 if (!on_relevant_boundary)
100 pt_neighbor->build_side_ptr(periodic_side, ns);
101 if (!periodic_side->contains_point(p))
104 vertex_on_periodic_side =
true;
108 if (vertex_on_periodic_side)
109 primary = pt_neighbor;
116const Elem * primary_boundary_edge_neighbor(
const Elem * elem,
120 const std::set<boundary_id_type> & boundary_ids)
124 const Elem * primary = elem;
126 std::set<const Elem *> edge_neighbors;
130 std::vector<boundary_id_type> bc_ids;
133 std::unique_ptr<const Elem> periodic_side;
135 for (
const auto & e_neighbor : edge_neighbors)
141 if ((e_neighbor->level() > primary->
level()) ||
142 (e_neighbor->level() == primary->
level() &&
143 e_neighbor->id() < primary->
id()))
149 bool vertex_on_periodic_side =
false;
150 for (
auto ns : e_neighbor->side_index_range())
154 bool on_relevant_boundary =
false;
155 for (
const auto &
id : boundary_ids)
156 if (
std::find(bc_ids.begin(), bc_ids.end(), id) != bc_ids.end())
157 on_relevant_boundary = true;
159 if (!on_relevant_boundary)
162 e_neighbor->build_side_ptr(periodic_side, ns);
163 if (!(periodic_side->contains_point(p1) &&
164 periodic_side->contains_point(p2)))
167 vertex_on_periodic_side =
true;
171 if (vertex_on_periodic_side)
172 primary = e_neighbor;
190std::unique_ptr<FEGenericBase<Real>>
202 return std::make_unique<FE<0,CLOUGH>>(fet);
205 return std::make_unique<FE<0,HERMITE>>(fet);
208 return std::make_unique<FE<0,LAGRANGE>>(fet);
211 return std::make_unique<FE<0,L2_LAGRANGE>>(fet);
214 return std::make_unique<FE<0,L2_LAGRANGE_GLL>>(fet);
217 return std::make_unique<FE<0,LAGRANGE_GLL>>(fet);
220 return std::make_unique<FE<0,HIERARCHIC>>(fet);
223 return std::make_unique<FE<0,L2_HIERARCHIC>>(fet);
226 return std::make_unique<FE<0,SIDE_HIERARCHIC>>(fet);
229 return std::make_unique<FE<0,MONOMIAL>>(fet);
231#ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
233 return std::make_unique<FE<0,SZABAB>>(fet);
236 return std::make_unique<FE<0,BERNSTEIN>>(fet);
239 return std::make_unique<FE<0,RATIONAL_BERNSTEIN>>(fet);
243 return std::make_unique<FEXYZ<0>>(fet);
246 return std::make_unique<FEScalar<0>>(fet);
258 return std::make_unique<FE<1,CLOUGH>>(fet);
261 return std::make_unique<FE<1,HERMITE>>(fet);
264 return std::make_unique<FE<1,LAGRANGE>>(fet);
267 return std::make_unique<FE<1,L2_LAGRANGE>>(fet);
270 return std::make_unique<FE<1,L2_LAGRANGE_GLL>>(fet);
273 return std::make_unique<FE<1,LAGRANGE_GLL>>(fet);
276 return std::make_unique<FE<1,HIERARCHIC>>(fet);
279 return std::make_unique<FE<1,L2_HIERARCHIC>>(fet);
282 return std::make_unique<FE<1,SIDE_HIERARCHIC>>(fet);
285 return std::make_unique<FE<1,MONOMIAL>>(fet);
287#ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
289 return std::make_unique<FE<1,SZABAB>>(fet);
292 return std::make_unique<FE<1,BERNSTEIN>>(fet);
295 return std::make_unique<FE<1,RATIONAL_BERNSTEIN>>(fet);
299 return std::make_unique<FEXYZ<1>>(fet);
302 return std::make_unique<FEScalar<1>>(fet);
316 return std::make_unique<FE<2,CLOUGH>>(fet);
319 return std::make_unique<FE<2,HERMITE>>(fet);
322 return std::make_unique<FE<2,LAGRANGE>>(fet);
325 return std::make_unique<FE<2,L2_LAGRANGE>>(fet);
328 return std::make_unique<FE<2,L2_LAGRANGE_GLL>>(fet);
331 return std::make_unique<FE<2,LAGRANGE_GLL>>(fet);
334 return std::make_unique<FE<2,HIERARCHIC>>(fet);
337 return std::make_unique<FE<2,L2_HIERARCHIC>>(fet);
340 return std::make_unique<FE<2,SIDE_HIERARCHIC>>(fet);
343 return std::make_unique<FE<2,MONOMIAL>>(fet);
345#ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
347 return std::make_unique<FE<2,SZABAB>>(fet);
350 return std::make_unique<FE<2,BERNSTEIN>>(fet);
353 return std::make_unique<FE<2,RATIONAL_BERNSTEIN>>(fet);
357 return std::make_unique<FEXYZ<2>>(fet);
360 return std::make_unique<FEScalar<2>>(fet);
363 return std::make_unique<FESubdivision>(fet);
377 libmesh_error_msg(
"ERROR: Clough-Tocher elements currently only support 1D and 2D");
380 return std::make_unique<FE<3,HERMITE>>(fet);
383 return std::make_unique<FE<3,LAGRANGE>>(fet);
386 return std::make_unique<FE<3,L2_LAGRANGE>>(fet);
389 return std::make_unique<FE<3,L2_LAGRANGE_GLL>>(fet);
392 return std::make_unique<FE<3,LAGRANGE_GLL>>(fet);
395 return std::make_unique<FE<3,HIERARCHIC>>(fet);
398 return std::make_unique<FE<3,L2_HIERARCHIC>>(fet);
401 return std::make_unique<FE<3,SIDE_HIERARCHIC>>(fet);
404 return std::make_unique<FE<3,MONOMIAL>>(fet);
406#ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
408 return std::make_unique<FE<3,SZABAB>>(fet);
411 return std::make_unique<FE<3,BERNSTEIN>>(fet);
414 return std::make_unique<FE<3,RATIONAL_BERNSTEIN>>(fet);
418 return std::make_unique<FEXYZ<3>>(fet);
421 return std::make_unique<FEScalar<3>>(fet);
429 libmesh_error_msg(
"Invalid dimension dim = " <<
dim);
436std::unique_ptr<FEGenericBase<RealGradient>>
448 return std::make_unique<FEHierarchicVec<0>>(fet);
451 return std::make_unique<FEL2HierarchicVec<0>>(fet);
454 return std::make_unique<FELagrangeVec<0>>(fet);
457 return std::make_unique<FEL2LagrangeVec<0>>(fet);
460 return std::make_unique<FEMonomialVec<0>>(fet);
471 return std::make_unique<FEHierarchicVec<1>>(fet);
474 return std::make_unique<FEL2HierarchicVec<1>>(fet);
477 return std::make_unique<FELagrangeVec<1>>(fet);
480 return std::make_unique<FEL2LagrangeVec<1>>(fet);
483 return std::make_unique<FEMonomialVec<1>>(fet);
494 return std::make_unique<FEHierarchicVec<2>>(fet);
497 return std::make_unique<FEL2HierarchicVec<2>>(fet);
500 return std::make_unique<FELagrangeVec<2>>(fet);
503 return std::make_unique<FEL2LagrangeVec<2>>(fet);
506 return std::make_unique<FEMonomialVec<2>>(fet);
509 return std::make_unique<FENedelecOne<2>>(fet);
512 return std::make_unique<FERaviartThomas<2>>(fet);
515 return std::make_unique<FEL2RaviartThomas<2>>(fet);
526 return std::make_unique<FEHierarchicVec<3>>(fet);
529 return std::make_unique<FEL2HierarchicVec<3>>(fet);
532 return std::make_unique<FELagrangeVec<3>>(fet);
535 return std::make_unique<FEL2LagrangeVec<3>>(fet);
538 return std::make_unique<FEMonomialVec<3>>(fet);
541 return std::make_unique<FENedelecOne<3>>(fet);
544 return std::make_unique<FERaviartThomas<3>>(fet);
547 return std::make_unique<FEL2RaviartThomas<3>>(fet);
555 libmesh_error_msg(
"Invalid dimension dim = " <<
dim);
565#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
569std::unique_ptr<FEGenericBase<Real>>
589 return std::make_unique<InfFE<1,JACOBI_20_00,CARTESIAN>>(fet);
601 return std::make_unique<InfFE<1,JACOBI_30_00,CARTESIAN>>(fet);
613 return std::make_unique<InfFE<1,LEGENDRE,CARTESIAN>>(fet);
625 return std::make_unique<InfFE<1,LAGRANGE,CARTESIAN>>(fet);
653 return std::make_unique<InfFE<2,JACOBI_20_00,CARTESIAN>>(fet);
665 return std::make_unique<InfFE<2,JACOBI_30_00,CARTESIAN>>(fet);
677 return std::make_unique<InfFE<2,LEGENDRE,CARTESIAN>>(fet);
689 return std::make_unique<InfFE<2,LAGRANGE,CARTESIAN>>(fet);
717 return std::make_unique<InfFE<3,JACOBI_20_00,CARTESIAN>>(fet);
729 return std::make_unique<InfFE<3,JACOBI_30_00,CARTESIAN>>(fet);
741 return std::make_unique<InfFE<3,LEGENDRE,CARTESIAN>>(fet);
753 return std::make_unique<InfFE<3,LAGRANGE,CARTESIAN>>(fet);
766 libmesh_error_msg(
"Invalid dimension dim = " <<
dim);
773std::unique_ptr<FEGenericBase<RealGradient>>
778 libmesh_not_implemented();
779 return std::unique_ptr<FEVectorBase>();
785template <
typename OutputType>
787 const std::vector<Point> & qp)
795 LOG_ONE_ENTITY_SCOPE(
"compute_shape_functions()",
"FE");
797 this->determine_calculations();
800 this->_fe_trans->map_phi(this->dim, elem, qp, (*
this), this->phi, this->_add_p_level_in_reinit);
803 this->_fe_trans->map_dphi(this->dim, elem, qp, (*
this), this->dphi,
804 this->dphidx, this->dphidy, this->dphidz);
806#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
808 this->_fe_trans->map_d2phi(this->dim, qp, (*
this), this->d2phi,
809 this->d2phidx2, this->d2phidxdy, this->d2phidxdz,
810 this->d2phidy2, this->d2phidydz, this->d2phidz2);
815 this->_fe_trans->map_curl(this->dim, elem, qp, (*
this), this->curl_phi);
819 this->_fe_trans->map_div(this->dim, elem, qp, (*
this), this->div_phi);
831 LOG_SCOPE(
"compute_dual_shape_coeffs()",
"FE");
833 const unsigned int sz=phi_vals.size();
834 libmesh_error_msg_if(!sz,
"ERROR: cannot compute dual shape coefficients with empty phi values");
837 dual_coeff.resize(sz, sz);
843 D(i,i) += JxW[qp]*phi_vals[i][qp];
845 A(i,j) += JxW[qp]*phi_vals[i][qp]*phi_vals[j][qp];
859 (((_elem->type() ==
TRI6 || _elem->type() ==
TRI7) && sz == 6) ||
860 (_elem->type() ==
QUAD8 && sz == 8)))
865 for (
const auto m :
make_range(_elem->n_vertices(), sz))
866 for (
const auto v :
make_range(_elem->n_second_order_adjacent_vertices(m)))
868 const auto vertex = _elem->second_order_adjacent_vertex(m, v);
869 D(vertex, vertex) += alpha*D(m,m);
870 D(vertex, m) -= alpha*D(m,m);
880 A.cholesky_solve(Dcol, coeffcol);
883 dual_coeff(row, j)=coeffcol(row);
891 LOG_SCOPE(
"compute_dual_shape_functions()",
"FE");
903 dual_dphi[j][qp] = 0;
904#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
906 dual_d2phi[j][qp] = 0;
915 dual_phi[j][qp] += dual_coeff(i, j) * phi[i][qp];
917 dual_dphi[j][qp] += dual_coeff(i, j) * dphi[i][qp];
918#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
920 dual_d2phi[j][qp] += dual_coeff(i, j) * d2phi[i][qp];
925template <
typename OutputType>
930 os <<
" phi[" << i <<
"][" << j <<
"]=" << phi[i][j] << std::endl;
933template <
typename OutputType>
938 os <<
" dual_phi[" << i <<
"][" << j <<
"]=" << dual_phi[i][j] << std::endl;
944template <
typename OutputType>
949 os <<
" dphi[" << i <<
"][" << j <<
"]=" << dphi[i][j];
952template <
typename OutputType>
957 os <<
" dual_dphi[" << i <<
"][" << j <<
"]=" << dual_dphi[i][j];
962template <
typename OutputType>
965 this->calculations_started =
true;
970 this->calculate_nothing || this->calculate_phi || this->calculate_dphi ||
971 this->calculate_dphiref || this->calculate_curl_phi || this->calculate_div_phi ||
974#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
975 requested_ok = requested_ok || this->calculate_d2phi;
978 libmesh_error_msg_if(
980 "You must call one or more of the FE accessors "
981 "(e.g. get_phi(), get_dphi(), get_nothing()) "
982 "_before_ calling reinit()!");
985 if (this->calculate_phi)
986 this->_fe_trans->init_map_phi(*
this);
988 if (this->calculate_dphiref)
989 this->_fe_trans->init_map_dphi(*
this);
991#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
992 if (this->calculate_d2phi)
993 this->_fe_trans->init_map_d2phi(*
this);
999#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1002template <
typename OutputType>
1007 os <<
" d2phi[" << i <<
"][" << j <<
"]=" << d2phi[i][j];
1010template <
typename OutputType>
1015 os <<
" dual_d2phi[" << i <<
"][" << j <<
"]=" << dual_d2phi[i][j];
1022#ifdef LIBMESH_ENABLE_AMR
1024template <
typename OutputType>
1030 const unsigned int var,
1031 const bool use_old_dof_indices)
1034 std::vector<unsigned int> new_side_dofs, old_side_dofs;
1037 unsigned int dim = elem->
dim();
1040 const unsigned int n_children = elem->
n_children();
1045 std::unique_ptr<FEGenericBase<OutputShape>> fe
1047 std::unique_ptr<FEGenericBase<OutputShape>> fe_coarse
1053 std::vector<Point> coarse_qpoints;
1057 const std::vector<std::vector<OutputShape>> & phi_values =
1059 const std::vector<std::vector<OutputShape>> & phi_coarse =
1060 fe_coarse->get_phi();
1064 const std::vector<std::vector<OutputGradient>> * dphi_values =
1066 const std::vector<std::vector<OutputGradient>> * dphi_coarse =
1073 const std::vector<std::vector<OutputGradient>> &
1074 ref_dphi_values = fe->get_dphi();
1075 dphi_values = &ref_dphi_values;
1076 const std::vector<std::vector<OutputGradient>> &
1077 ref_dphi_coarse = fe_coarse->get_dphi();
1078 dphi_coarse = &ref_dphi_coarse;
1082 const std::vector<Real> & JxW =
1087 const std::vector<Point> & xyz_values =
1094 const unsigned int new_n_dofs =
1098 std::vector<char> dof_is_fixed(new_n_dofs,
false);
1099 std::vector<int> free_dof(new_n_dofs, 0);
1115 std::vector<dof_id_type> node_dof_indices;
1116 if (use_old_dof_indices)
1119 dof_map.
dof_indices (elem, node_dof_indices, var);
1121 unsigned int current_dof = 0;
1122 for (
unsigned int n=0; n!=
n_nodes; ++n)
1126 const unsigned int my_nc =
1130 current_dof += my_nc;
1139 int extra_order = 0;
1142 const unsigned int nc =
1144 for (
unsigned int i=0; i!= nc; ++i)
1147 old_vector(node_dof_indices[current_dof]);
1148 dof_is_fixed[current_dof] =
true;
1154 FEType fe_type = base_fe_type, temp_fe_type;
1164 const unsigned int n_new_side_dofs =
1165 cast_int<unsigned int>(new_side_dofs.size());
1169 unsigned int free_dofs = 0;
1170 for (
unsigned int i=0; i != n_new_side_dofs; ++i)
1171 if (!dof_is_fixed[new_side_dofs[i]])
1172 free_dof[free_dofs++] = i;
1180 for (
unsigned int c=0; c != n_children; ++c)
1186 std::vector<dof_id_type> child_dof_indices;
1187 if (use_old_dof_indices)
1189 child_dof_indices, var);
1192 child_dof_indices, var);
1193 const unsigned int child_n_dofs =
1194 cast_int<unsigned int>
1195 (child_dof_indices.size());
1197 temp_fe_type = base_fe_type;
1198 temp_fe_type.
order = temp_fe_type.order + child->
p_level();
1201 temp_fe_type, e, old_side_dofs);
1205 fe->attach_quadrature_rule (qedgerule.get());
1206 fe->edge_reinit (child, e);
1207 const unsigned int n_qp = qedgerule->n_points();
1212 fe_coarse->reinit(elem, &coarse_qpoints);
1215 for (
unsigned int qp=0; qp<n_qp; qp++)
1225 for (
unsigned int i=0; i<child_n_dofs;
1229 (old_vector(child_dof_indices[i])*
1232 finegrad += (*dphi_values)[i][qp] *
1233 old_vector(child_dof_indices[i]);
1237 for (
unsigned int sidei=0, freei=0; sidei != n_new_side_dofs; ++sidei)
1239 unsigned int i = new_side_dofs[sidei];
1241 if (dof_is_fixed[i])
1243 for (
unsigned int sidej=0, freej=0; sidej != n_new_side_dofs; ++sidej)
1246 new_side_dofs[sidej];
1247 if (dof_is_fixed[j])
1250 phi_coarse[j][qp]) *
1255 phi_coarse[j][qp]) *
1259 if (dof_is_fixed[j])
1262 (*dphi_coarse)[j][qp]) *
1267 (*dphi_coarse)[j][qp]) *
1270 if (!dof_is_fixed[j])
1285 for (
unsigned int i=0; i != free_dofs; ++i)
1287 Number & ui = Ue(new_side_dofs[free_dof[i]]);
1291 dof_is_fixed[new_side_dofs[free_dof[i]]] =
true;
1302 const unsigned int n_new_side_dofs =
1303 cast_int<unsigned int>(new_side_dofs.size());
1307 unsigned int free_dofs = 0;
1308 for (
unsigned int i=0; i != n_new_side_dofs; ++i)
1309 if (!dof_is_fixed[new_side_dofs[i]])
1310 free_dof[free_dofs++] = i;
1318 for (
unsigned int c=0; c != n_children; ++c)
1324 std::vector<dof_id_type> child_dof_indices;
1325 if (use_old_dof_indices)
1327 child_dof_indices, var);
1330 child_dof_indices, var);
1331 const unsigned int child_n_dofs =
1332 cast_int<unsigned int>
1333 (child_dof_indices.size());
1335 temp_fe_type = base_fe_type;
1336 temp_fe_type.
order = temp_fe_type.order + child->
p_level();
1339 temp_fe_type, s, old_side_dofs);
1343 fe->attach_quadrature_rule (qsiderule.get());
1344 fe->reinit (child, s);
1345 const unsigned int n_qp = qsiderule->n_points();
1350 fe_coarse->reinit(elem, &coarse_qpoints);
1353 for (
unsigned int qp=0; qp<n_qp; qp++)
1363 for (
unsigned int i=0; i<child_n_dofs;
1367 old_vector(child_dof_indices[i]) *
1370 finegrad += (*dphi_values)[i][qp] *
1371 old_vector(child_dof_indices[i]);
1375 for (
unsigned int sidei=0, freei=0; sidei != n_new_side_dofs; ++sidei)
1377 unsigned int i = new_side_dofs[sidei];
1379 if (dof_is_fixed[i])
1381 for (
unsigned int sidej=0, freej=0; sidej != n_new_side_dofs; ++sidej)
1384 new_side_dofs[sidej];
1385 if (dof_is_fixed[j])
1388 phi_coarse[j][qp]) *
1393 phi_coarse[j][qp]) *
1397 if (dof_is_fixed[j])
1400 (*dphi_coarse)[j][qp]) *
1405 (*dphi_coarse)[j][qp]) *
1408 if (!dof_is_fixed[j])
1422 for (
unsigned int i=0; i != free_dofs; ++i)
1424 Number & ui = Ue(new_side_dofs[free_dof[i]]);
1428 dof_is_fixed[new_side_dofs[free_dof[i]]] =
true;
1436 unsigned int free_dofs = 0;
1437 for (
unsigned int i=0; i != new_n_dofs; ++i)
1438 if (!dof_is_fixed[i])
1439 free_dof[free_dofs++] = i;
1448 std::vector<dof_id_type> child_dof_indices;
1449 if (use_old_dof_indices)
1451 child_dof_indices, var);
1454 child_dof_indices, var);
1455 const unsigned int child_n_dofs =
1456 cast_int<unsigned int>
1457 (child_dof_indices.size());
1461 fe->attach_quadrature_rule (qrule.get());
1462 fe->reinit (&child);
1463 const unsigned int n_qp = qrule->n_points();
1467 fe_coarse->reinit(elem, &coarse_qpoints);
1470 for (
unsigned int qp=0; qp<n_qp; qp++)
1480 for (
unsigned int i=0; i<child_n_dofs; i++)
1483 (old_vector(child_dof_indices[i]) *
1486 finegrad += (*dphi_values)[i][qp] *
1487 old_vector(child_dof_indices[i]);
1491 for (
unsigned int i=0, freei=0;
1492 i != new_n_dofs; ++i)
1495 if (dof_is_fixed[i])
1497 for (
unsigned int j=0, freej=0; j !=
1500 if (dof_is_fixed[j])
1503 phi_coarse[j][qp]) *
1508 phi_coarse[j][qp]) *
1512 if (dof_is_fixed[j])
1515 (*dphi_coarse)[j][qp]) *
1520 (*dphi_coarse)[j][qp]) *
1523 if (!dof_is_fixed[j])
1537 for (
unsigned int i=0; i != free_dofs; ++i)
1539 Number & ui = Ue(free_dof[i]);
1546 dof_is_fixed[free_dof[i]] =
true;
1552 for (
unsigned int i=0; i != new_n_dofs; ++i)
1559template <
typename OutputType>
1565 const bool use_old_dof_indices)
1573 coarsened_dof_values(old_vector, dof_map, elem, Usub,
1574 v, use_old_dof_indices);
1582template <
typename OutputType>
1586 const unsigned int variable_number,
1591 const unsigned int Dim = elem->
dim();
1606 std::unique_ptr<FEGenericBase<OutputShape>> my_fe
1608 my_fe->add_p_level_in_reinit(add_p_level);
1622 libmesh_not_implemented();
1624 std::unique_ptr<FEGenericBase<OutputShape>> neigh_fe
1626 neigh_fe->add_p_level_in_reinit(add_p_level);
1629 my_fe->attach_quadrature_rule (&my_qface);
1630 std::vector<Point> neigh_qface;
1632 const std::vector<Real> & JxW = my_fe->get_JxW();
1633 const std::vector<Point> & q_point = my_fe->get_xyz();
1634 const std::vector<std::vector<OutputShape>> & phi = my_fe->get_phi();
1635 const std::vector<std::vector<OutputShape>> & neigh_phi =
1636 neigh_fe->get_phi();
1637 const std::vector<Point> * face_normals =
nullptr;
1638 const std::vector<std::vector<OutputGradient>> * dphi =
nullptr;
1639 const std::vector<std::vector<OutputGradient>> * neigh_dphi =
nullptr;
1641 std::vector<dof_id_type> my_dof_indices, neigh_dof_indices;
1642 std::vector<unsigned int> my_side_dofs, neigh_side_dofs;
1646 const std::vector<Point> & ref_face_normals =
1647 my_fe->get_normals();
1648 face_normals = &ref_face_normals;
1649 const std::vector<std::vector<OutputGradient>> & ref_dphi =
1652 const std::vector<std::vector<OutputGradient>> & ref_neigh_dphi =
1653 neigh_fe->get_dphi();
1654 neigh_dphi = &ref_neigh_dphi;
1659 std::vector<DenseVector<Real>> Ue;
1681 libmesh_assert_less (s_neigh, neigh->
n_neighbors());
1687 const unsigned int min_p_level = add_p_level *
1691 const unsigned int old_elem_level = add_p_level * elem->
p_level();
1692 if (old_elem_level != min_p_level)
1693 my_fe->set_fe_order(my_fe->get_fe_type().order.get_order() + min_p_level - old_elem_level);
1694 const unsigned int old_neigh_level = add_p_level * neigh->
p_level();
1695 if (old_neigh_level != min_p_level)
1696 neigh_fe->set_fe_order(neigh_fe->get_fe_type().order.get_order() + min_p_level - old_neigh_level);
1698 my_fe->reinit(elem, s);
1706 my_dof_indices.reserve (elem->
n_nodes());
1707 neigh_dof_indices.reserve (neigh->
n_nodes());
1716 const unsigned int n_qp = my_qface.
n_points();
1720 neigh_fe->reinit(neigh, &neigh_qface);
1724 FEType elem_fe_type = base_fe_type;
1725 if (old_elem_level != min_p_level)
1727 FEType neigh_fe_type = base_fe_type;
1728 if (old_neigh_level != min_p_level)
1733 const unsigned int n_side_dofs =
1734 cast_int<unsigned int>(my_side_dofs.size());
1735 libmesh_assert_equal_to (n_side_dofs, neigh_side_dofs.size());
1738 for (
auto i : my_side_dofs)
1739 libmesh_assert_less(i, my_dof_indices.size());
1740 for (
auto i : neigh_side_dofs)
1741 libmesh_assert_less(i, neigh_dof_indices.size());
1744 Ke.
resize (n_side_dofs, n_side_dofs);
1745 Ue.resize(n_side_dofs);
1749 for (
unsigned int is = 0;
is != n_side_dofs; ++
is)
1751 const unsigned int i = my_side_dofs[
is];
1752 for (
unsigned int js = 0; js != n_side_dofs; ++js)
1754 const unsigned int j = my_side_dofs[js];
1755 for (
unsigned int qp = 0; qp != n_qp; ++qp)
1759 Ke(
is,js) += JxW[qp] *
1761 (*face_normals)[qp],
1763 (*face_normals)[qp]);
1770 for (
unsigned int is = 0;
is != n_side_dofs; ++
is)
1772 const unsigned int i = neigh_side_dofs[
is];
1774 for (
unsigned int js = 0; js != n_side_dofs; ++js)
1776 const unsigned int j = my_side_dofs[js];
1777 for (
unsigned int qp = 0; qp != n_qp; ++qp)
1785 (*face_normals)[qp],
1787 (*face_normals)[qp]);
1793 for (
unsigned int js = 0; js != n_side_dofs; ++js)
1795 const unsigned int j = my_side_dofs[js];
1801 bool self_constraint =
false;
1802 for (
unsigned int is = 0;
is != n_side_dofs; ++
is)
1804 const unsigned int i = neigh_side_dofs[
is];
1805 const dof_id_type their_dof_g = neigh_dof_indices[i];
1808 if (their_dof_g == my_dof_g)
1811 const Real their_dof_value = Ue[
is](js);
1812 libmesh_assert_less (std::abs(their_dof_value-1.),
1815 for (
unsigned int k = 0; k != n_side_dofs; ++k)
1817 std::abs(Ue[k](js)) <
1821 self_constraint =
true;
1826 if (self_constraint)
1840 constraint_row = &(constraints[my_dof_g]);
1844 for (
unsigned int is = 0;
is != n_side_dofs; ++
is)
1846 const unsigned int i = neigh_side_dofs[
is];
1847 const dof_id_type their_dof_g = neigh_dof_indices[i];
1849 libmesh_assert_not_equal_to (their_dof_g, my_dof_g);
1851 const Real their_dof_value = Ue[
is](js);
1853 if (std::abs(their_dof_value) < 10*
TOLERANCE)
1856 constraint_row->emplace(their_dof_g, their_dof_value);
1860 my_fe->set_fe_order(my_fe->get_fe_type().order.get_order() + old_elem_level - min_p_level);
1861 neigh_fe->set_fe_order(neigh_fe->get_fe_type().order.get_order() + old_neigh_level - min_p_level);
1870 const unsigned int min_p_level =
1872 if (min_p_level < elem->p_level())
1888#ifdef LIBMESH_ENABLE_PERIODIC
1889template <
typename OutputType>
1897 const unsigned int variable_number,
1901 if (boundaries.empty())
1911 libmesh_not_implemented();
1913 const unsigned int Dim = elem->
dim();
1917 const unsigned int sys_number = dof_map.
sys_number();
1922 std::unique_ptr<FEGenericBase<OutputShape>> my_fe
1933 const Real primary_hmin = elem->
hmin();
1935 std::unique_ptr<FEGenericBase<OutputShape>> neigh_fe
1939 my_fe->attach_quadrature_rule (&my_qface);
1940 std::vector<Point> neigh_qface;
1942 const std::vector<Real> & JxW = my_fe->get_JxW();
1943 const std::vector<Point> & q_point = my_fe->get_xyz();
1944 const std::vector<std::vector<OutputShape>> & phi = my_fe->get_phi();
1945 const std::vector<std::vector<OutputShape>> & neigh_phi =
1946 neigh_fe->get_phi();
1947 const std::vector<Point> * face_normals =
nullptr;
1948 const std::vector<std::vector<OutputGradient>> * dphi =
nullptr;
1949 const std::vector<std::vector<OutputGradient>> * neigh_dphi =
nullptr;
1950 std::vector<dof_id_type> my_dof_indices, neigh_dof_indices;
1951 std::vector<unsigned int> my_side_dofs, neigh_side_dofs;
1955 const std::vector<Point> & ref_face_normals =
1956 my_fe->get_normals();
1957 face_normals = &ref_face_normals;
1958 const std::vector<std::vector<OutputGradient>> & ref_dphi =
1961 const std::vector<std::vector<OutputGradient>> & ref_neigh_dphi =
1962 neigh_fe->get_dphi();
1963 neigh_dphi = &ref_neigh_dphi;
1968 std::vector<DenseVector<Real>> Ue;
1971 std::vector<boundary_id_type> bc_ids;
1975 const unsigned short int max_ns = elem->
n_sides();
1976 for (
unsigned short int s = 0; s != max_ns; ++s)
1983 for (
const auto & boundary_id : bc_ids)
1992 unsigned int s_neigh;
1993 const Elem * neigh = boundaries.
neighbor(boundary_id, *point_locator, elem, s, &s_neigh);
1995 libmesh_error_msg_if(neigh ==
nullptr,
1996 "PeriodicBoundaries point locator object returned nullptr!");
2004#ifdef LIBMESH_ENABLE_AMR
2009 const unsigned int min_p_level =
2017 const unsigned int old_elem_level = elem->
p_level();
2018 if (old_elem_level != min_p_level)
2019 (
const_cast<Elem *
>(elem))->hack_p_level(min_p_level);
2020 const unsigned int old_neigh_level = neigh->
p_level();
2021 if (old_neigh_level != min_p_level)
2022 (
const_cast<Elem *
>(neigh))->hack_p_level(min_p_level);
2031 my_fe->reinit(elem, s);
2041 std::vector<std::vector<dof_id_type>> neigh_dof_indices_all_variables;
2044 const std::set<unsigned int> & variables = periodic->
get_variables();
2045 neigh_dof_indices_all_variables.resize(variables.size());
2046 unsigned int index = 0;
2047 for(
unsigned int var : variables)
2049 dof_map.
dof_indices (neigh, neigh_dof_indices_all_variables[index],
2055 const unsigned int n_qp = my_qface.
n_points();
2059 std::vector<Point> neigh_point(q_point.size());
2066 neigh_fe->reinit(neigh, &neigh_qface);
2075#ifdef LIBMESH_ENABLE_AMR
2076 if (elem->
p_level() != old_elem_level)
2077 (
const_cast<Elem *
>(elem))->hack_p_level(old_elem_level);
2078 if (neigh->
p_level() != old_neigh_level)
2079 (
const_cast<Elem *
>(neigh))->hack_p_level(old_neigh_level);
2082 const unsigned int n_side_dofs =
2083 cast_int<unsigned int>
2084 (my_side_dofs.size());
2085 libmesh_assert_equal_to (n_side_dofs, neigh_side_dofs.size());
2087 Ke.
resize (n_side_dofs, n_side_dofs);
2088 Ue.resize(n_side_dofs);
2092 for (
unsigned int is = 0;
is != n_side_dofs; ++
is)
2094 const unsigned int i = my_side_dofs[
is];
2095 for (
unsigned int js = 0; js != n_side_dofs; ++js)
2097 const unsigned int j = my_side_dofs[js];
2098 for (
unsigned int qp = 0; qp != n_qp; ++qp)
2100 Ke(
is,js) += JxW[qp] *
2104 Ke(
is,js) += JxW[qp] *
2106 (*face_normals)[qp],
2108 (*face_normals)[qp]);
2115 for (
unsigned int is = 0;
is != n_side_dofs; ++
is)
2117 const unsigned int i = neigh_side_dofs[
is];
2119 for (
unsigned int js = 0; js != n_side_dofs; ++js)
2121 const unsigned int j = my_side_dofs[js];
2122 for (
unsigned int qp = 0; qp != n_qp; ++qp)
2130 (*face_normals)[qp],
2132 (*face_normals)[qp]);
2186 std::set<dof_id_type> my_constrained_dofs;
2189 std::vector<boundary_id_type> new_bc_ids;
2203 std::set<boundary_id_type> point_bcids;
2205 for (
unsigned int new_s = 0;
2206 new_s != max_ns; ++new_s)
2213 for (
const auto & new_boundary_id : new_bc_ids)
2216 if (new_periodic && new_periodic->
is_my_variable(variable_number))
2217 point_bcids.insert(new_boundary_id);
2223 if (primary_boundary_point_neighbor
2229 std::set<boundary_id_type> point_pairedids;
2230 for (
const auto & new_boundary_id : point_bcids)
2237 const Elem * primary_elem =
nullptr;
2238 const Elem * main_neigh =
nullptr;
2239 Point main_pt = my_node,
2240 primary_pt = my_node;
2242 for (
const auto & new_boundary_id : point_bcids)
2248 const Point neigh_pt =
2261 primary_elem = elem;
2263 const Elem * primary_neigh =
2264 primary_boundary_point_neighbor(neigh, neigh_pt,
2270 if (new_boundary_id == boundary_id)
2272 main_neigh = primary_neigh;
2279 if ((primary_neigh->
level() > primary_elem->
level()) ||
2284 (primary_neigh->
level() == primary_elem->
level() &&
2285 primary_neigh->
id() > primary_elem->
id()) ||
2289 (primary_neigh == primary_elem &&
2290 (neigh_pt > primary_pt)))
2293 primary_elem = primary_neigh;
2294 primary_pt = neigh_pt;
2297 if (!primary_elem ||
2298 primary_elem != main_neigh ||
2299 primary_pt != main_pt)
2305 unsigned int e=0, ne = elem->
n_edges();
2306 for (; e != ne; ++e)
2311 libmesh_assert_less (e, elem->
n_edges());
2340 std::set<boundary_id_type> edge_bcids;
2342 for (
unsigned int new_s = 0;
2343 new_s != max_ns; ++new_s)
2351 for (
const auto & new_boundary_id : new_bc_ids)
2354 if (new_periodic && new_periodic->
is_my_variable(variable_number))
2355 edge_bcids.insert(new_boundary_id);
2361 if (primary_boundary_edge_neighbor
2367 std::set<boundary_id_type> edge_pairedids;
2368 for (
const auto & new_boundary_id : edge_bcids)
2375 const Elem * primary_elem =
nullptr;
2376 const Elem * main_neigh =
nullptr;
2377 Point main_pt1 = *e1,
2382 for (
const auto & new_boundary_id : edge_bcids)
2396 neigh_pt2.absolute_fuzzy_equals
2403 primary_elem = elem;
2405 const Elem * primary_neigh = primary_boundary_edge_neighbor
2406 (neigh, neigh_pt1, neigh_pt2,
2411 if (new_boundary_id == boundary_id)
2413 main_neigh = primary_neigh;
2414 main_pt1 = neigh_pt1;
2415 main_pt2 = neigh_pt2;
2425 if (primary_neigh == primary_elem)
2427 if (primary_pt1 > primary_pt2)
2428 std::swap(primary_pt1, primary_pt2);
2429 if (neigh_pt1 > neigh_pt2)
2430 std::swap(neigh_pt1, neigh_pt2);
2432 if (neigh_pt2 >= primary_pt2)
2440 if ((primary_neigh->
level() > primary_elem->
level()) ||
2445 (primary_neigh->
level() == primary_elem->
level() &&
2446 primary_neigh->
id() > primary_elem->
id()))
2449 primary_elem = primary_neigh;
2450 primary_pt1 = neigh_pt1;
2451 primary_pt2 = neigh_pt2;
2454 if (!primary_elem ||
2455 primary_elem != main_neigh ||
2456 primary_pt1 != main_pt1 ||
2457 primary_pt2 != main_pt2)
2468 const Point neigh_pt =
2470 if (neigh_pt > my_node)
2484 neigh->
id() > elem->
id()))
2492 const unsigned int n_comp =
2493 my_node.
n_comp(sys_number, variable_number);
2495 for (
unsigned int i=0; i != n_comp; ++i)
2496 my_constrained_dofs.insert
2498 (sys_number, variable_number, i));
2535 for (
unsigned int js = 0; js != n_side_dofs; ++js)
2541 const unsigned int j = my_side_dofs[js];
2546 if (!my_constrained_dofs.count(my_dof_g))
2560 constraint_row = &(constraints[my_dof_g]);
2564 for (
unsigned int is = 0;
is != n_side_dofs; ++
is)
2566 const unsigned int i = neigh_side_dofs[
is];
2567 const dof_id_type their_dof_g = neigh_dof_indices[i];
2574 const Real their_dof_value = Ue[
is](js);
2576 if (their_dof_g == my_dof_g)
2578 libmesh_assert_less (std::abs(their_dof_value-1.), 1.e-5);
2579 for (
unsigned int k = 0; k != n_side_dofs; ++k)
2584 if (std::abs(their_dof_value) < 10*
TOLERANCE)
2589 constraint_row->emplace(their_dof_g, their_dof_value);
2599 const std::set<unsigned int> & variables = periodic->
get_variables();
2600 neigh_dof_indices_all_variables.resize(variables.size());
2601 unsigned int index = 0;
2602 for(
unsigned int other_var : variables)
2604 libmesh_assert_msg(base_fe_type == dof_map.
variable_type(other_var),
"FE types must match for all variables involved in constraint");
2607 constraint_row->emplace(neigh_dof_indices_all_variables[index][i],
2608 var_weighting*their_dof_value);
2620#ifdef LIBMESH_ENABLE_AMR
2621 const unsigned int min_p_level =
2623 if (min_p_level < elem->p_level())
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
Defines a dense matrix for use in Finite Element-type computations.
void cholesky_solve(const DenseVector< T2 > &b, DenseVector< T2 > &x)
For symmetric positive definite (SPD) matrices.
void resize(const unsigned int new_m, const unsigned int new_n)
Resizes the matrix to the specified size and calls zero().
virtual void zero() override final
Sets all elements of the matrix to 0 and resets any decomposition flag which may have been previously...
Defines a dense vector for use in Finite Element-type computations.
void resize(const unsigned int n)
Resize the vector.
virtual void zero() override final
Set every element in the vector to 0.
void append(const DenseVector< T2 > &other_vector)
Append additional entries to (resizing, but unchanging) the vector.
The constraint matrix storage format.
This class handles the numbering of degrees of freedom on a mesh.
void constrain_p_dofs(unsigned int var, const Elem *elem, unsigned int s, unsigned int p)
Constrains degrees of freedom on side s of element elem which correspond to variable number var and t...
unsigned int n_variables() const override
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
const FEType & variable_type(const unsigned int i) const
unsigned int sys_number() const
bool is_constrained_dof(const dof_id_type dof) const
const Variable & variable(const unsigned int c) const override
void old_dof_indices(const Elem &elem, unsigned int n, std::vector< dof_id_type > &di, const unsigned int vn) const
Appends to the vector di the old global degree of freedom indices for elem.node_ref(n),...
unsigned int n_comp(const unsigned int s, const unsigned int var) const
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
This is the base class from which all geometric element types are derived.
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
const Node & node_ref(const unsigned int i) const
virtual bool is_child_on_edge(const unsigned int c, const unsigned int e) const
virtual unsigned int n_nodes() const =0
const Elem * child_ptr(unsigned int i) const
unsigned int which_neighbor_am_i(const Elem *e) const
This function tells you which neighbor e is.
unsigned int n_neighbors() const
virtual bool is_face(const unsigned int i) const =0
void find_point_neighbors(const Point &p, std::set< const Elem * > &neighbor_set) const
This function finds all active elements (including this one) which are in the same manifold as this e...
virtual Real hmin() const
virtual unsigned short dim() const =0
void find_edge_neighbors(const Point &p1, const Point &p2, std::set< const Elem * > &neighbor_set) const
This function finds all active elements in the same manifold as this element which touch the current ...
subdomain_id_type subdomain_id() const
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
virtual bool is_edge(const unsigned int i) const =0
unsigned int level() const
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
const Node * node_ptr(const unsigned int i) const
IntRange< unsigned short > edge_index_range() const
virtual bool is_vertex(const unsigned int i) const =0
virtual unsigned int n_children() const =0
unsigned int max_descendant_p_level() const
IntRange< unsigned short > node_index_range() const
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const =0
virtual unsigned int n_edges() const =0
virtual unsigned int n_sides() const =0
unsigned int p_level() const
const Elem * neighbor_ptr(unsigned int i) const
virtual bool infinite() const =0
IntRange< unsigned short > side_index_range() const
This class forms the foundation from which generic finite elements may be derived.
virtual_for_inffe void determine_calculations()
Determine which values are to be calculated, for both the FE itself and for the FEMap.
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
void compute_dual_shape_coeffs(const std::vector< Real > &JxW, const std::vector< std::vector< OutputShape > > &phi)
Compute the dual basis coefficients dual_coeff we rely on the JxW (or weights) and the phi values,...
virtual void print_dphi(std::ostream &os) const override
Prints the value of each shape function's derivative at each quadrature point.
static void coarsened_dof_values(const NumericVector< Number > &global_vector, const DofMap &dof_map, const Elem *coarse_elem, DenseVector< Number > &coarse_dofs, const unsigned int var, const bool use_old_dof_indices=false)
Creates a local projection on coarse_elem, based on the DoF values in global_vector for it's children...
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to var...
static std::unique_ptr< FEGenericBase > build_InfFE(const unsigned int dim, const FEType &type)
Builds a specific infinite element type.
virtual void print_dual_d2phi(std::ostream &os) const override
virtual void print_d2phi(std::ostream &os) const override
Prints the value of each shape function's second derivatives at each quadrature point.
virtual void print_phi(std::ostream &os) const override
Prints the value of each shape function at each quadrature point.
static void compute_periodic_constraints(DofConstraints &constraints, DofMap &dof_map, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const unsigned int variable_number, const Elem *elem)
Computes the constraint matrix contributions (for meshes with periodic boundary conditions) correspon...
virtual void print_dual_phi(std::ostream &os) const override
TensorTools::MakeNumber< OutputShape >::type OutputNumber
virtual void compute_shape_functions(const Elem *elem, const std::vector< Point > &qp) override
After having updated the jacobian and the transformation from local to global coordinates in FEMap::c...
virtual void print_dual_dphi(std::ostream &os) const override
void compute_dual_shape_functions()
Compute dual_phi, dual_dphi, dual_d2phi It is only valid for this to be called after reinit has occur...
static void dofs_on_side(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int s, std::vector< unsigned int > &di, const bool add_p_level=true)
Fills the vector di with the local degree of freedom indices associated with side s of element elem A...
static unsigned int n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
static unsigned int n_dofs_at_node(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int n)
static void dofs_on_edge(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int e, std::vector< unsigned int > &di, const bool add_p_level=true)
Fills the vector di with the local degree of freedom indices associated with edge e of element elem A...
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
InfMapType inf_map
The coordinate mapping type of the infinite element.
std::unique_ptr< QBase > default_quadrature_rule(const unsigned int dim, const int extraorder=0) const
Order default_quadrature_order() const
OrderWrapper order
The approximation order of the element (at 0 p-refinement level).
bool p_refinement
Whether or not the finite elements for this type increase their p refinement level on geometric eleme...
FEFamily radial_family
The type of approximation in radial direction.
FEFamily family
The type of finite element.
This is the MeshBase class.
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
A Node is like a Point, but with more information.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
int get_order() const
Explicitly request the order as an int.
We're using a class instead of a typedef to allow forward declarations and future flexibility.
PeriodicBoundaryBase * boundary(boundary_id_type id)
const Elem * neighbor(boundary_id_type boundary_id, const PointLocatorBase &point_locator, const Elem *e, unsigned int side, unsigned int *neigh_side=nullptr) const
The base class for defining periodic boundaries.
bool has_transformation_matrix() const
const DenseMatrix< Real > & get_transformation_matrix() const
Get the transformation matrix, if it is defined.
bool is_my_variable(unsigned int var_num) const
const std::set< unsigned int > & get_variables() const
Get the set of variables for this periodic boundary condition.
virtual Point get_corresponding_pos(const Point &pt) const =0
This function should be overridden by derived classes to define how one finds corresponding nodes on ...
boundary_id_type pairedboundary
This is the base class for point locators.
A Point defines a location in LIBMESH_DIM dimensional Real space.
unsigned int n_points() const
This class implements specific orders of Gauss quadrature.
bool absolute_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
This class defines the notion of a variable in the system.
bool active_on_subdomain(subdomain_id_type sid) const
const FEType & type() const
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
std::string enum_to_string(const T e)
The libMesh namespace provides an interface to certain functionality in the library.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
std::map< dof_id_type, Real, std::less< dof_id_type >, Threads::scalable_allocator< std::pair< const dof_id_type, Real > > > DofConstraintRow
A row of the Dof constraint matrix.
PetscErrorCode PetscInt const PetscInt IS * is
static constexpr Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
const dof_id_type n_nodes