https://mooseframework.inl.gov
Assembly.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "DenseMatrix.h"
13 #include "MooseArray.h"
14 #include "MooseTypes.h"
15 #include "MooseVariableFE.h"
16 #include "ArbitraryQuadrature.h"
17 
18 #include "libmesh/dense_vector.h"
19 #include "libmesh/enum_quadrature_type.h"
20 #include "libmesh/fe_type.h"
21 #include "libmesh/point.h"
22 #include "libmesh/fe_base.h"
23 #include "libmesh/numeric_vector.h"
24 #include "libmesh/elem_side_builder.h"
25 
26 #include <unordered_map>
27 
28 // libMesh forward declarations
29 namespace libMesh
30 {
31 class DofMap;
32 class CouplingMatrix;
33 class Elem;
34 template <typename>
37 template <typename T>
41 class Node;
42 template <typename T>
43 class NumericVector;
44 template <typename T>
45 class SparseMatrix;
46 class StaticCondensation;
47 }
48 
49 // MOOSE Forward Declares
50 class FaceInfo;
51 class MooseMesh;
53 class SystemBase;
55 class MooseVariableBase;
56 template <typename>
57 class MooseVariableFE;
62 class XFEMInterface;
63 class SubProblem;
64 class NodeFaceConstraint;
65 
66 // Assembly.h does not import Moose.h nor libMeshReducedNamespace.h
67 using libMesh::FEBase;
68 using libMesh::FEFamily;
69 using libMesh::FEType;
72 using libMesh::Order;
74 
83 template <typename P, typename C>
84 void coordTransformFactor(const SubProblem & s,
85  SubdomainID sub_id,
86  const P & point,
87  C & factor,
89 
90 template <typename P, typename C>
91 void coordTransformFactor(const MooseMesh & mesh,
92  SubdomainID sub_id,
93  const P & point,
94  C & factor,
96 
101 class Assembly
102 {
103 public:
104  Assembly(SystemBase & sys, THREAD_ID tid);
105  virtual ~Assembly();
106 
111  template <typename T>
112  static const T * const & constify_ref(T * const & inref)
113  {
114  const T * const * ptr = &inref;
115  return *ptr;
116  }
117 
124  const FEBase * const & getFE(FEType type, unsigned int dim) const
125  {
126  buildFE(type);
127  return constify_ref(_fe[dim][type]);
128  }
129 
136  const FEBase * const & getFENeighbor(FEType type, unsigned int dim) const
137  {
138  buildNeighborFE(type);
139  return constify_ref(_fe_neighbor[dim][type]);
140  }
141 
148  const FEBase * const & getFEFace(FEType type, unsigned int dim) const
149  {
150  buildFaceFE(type);
151  return constify_ref(_fe_face[dim][type]);
152  }
153 
160  const FEBase * const & getFEFaceNeighbor(FEType type, unsigned int dim) const
161  {
162  buildFaceNeighborFE(type);
163  return constify_ref(_fe_face_neighbor[dim][type]);
164  }
165 
172  const FEVectorBase * const & getVectorFE(FEType type, unsigned int dim) const
173  {
174  buildVectorFE(type);
175  return constify_ref(_vector_fe[dim][type]);
176  }
177 
184  const FEVectorBase * const & getVectorFENeighbor(FEType type, unsigned int dim) const
185  {
186  buildVectorNeighborFE(type);
187  return constify_ref(_vector_fe_neighbor[dim][type]);
188  }
189 
196  const FEVectorBase * const & getVectorFEFace(FEType type, unsigned int dim) const
197  {
198  buildVectorFaceFE(type);
199  return constify_ref(_vector_fe_face[dim][type]);
200  }
201 
208  const FEVectorBase * const & getVectorFEFaceNeighbor(FEType type, unsigned int dim) const
209  {
212  }
213 
218  const libMesh::QBase * const & qRule() const { return constify_ref(_current_qrule); }
219 
225 
230  const MooseArray<Point> & qPoints() const { return _current_q_points; }
231 
236  const std::vector<Point> & qPointsMortar() const { return _fe_msm->get_xyz(); }
237 
243 
248  const MooseArray<Real> & JxW() const { return _current_JxW; }
249 
250  const MooseArray<ADReal> & adJxW() const { return _ad_JxW; }
251 
252  const MooseArray<ADReal> & adJxWFace() const { return _ad_JxW_face; }
253 
254  const MooseArray<ADReal> & adCurvatures() const;
255 
260  const MooseArray<Real> & coordTransformation() const { return _coord; }
261 
267 
273  {
274  // Coord values for non-cartesian coordinate systems are functions of the locations of the
275  // quadrature points in physical space. We also have no way of knowing whether this was called
276  // from a volumetric or face object so we should set both volumetric and face xyz to true
277  _calculate_xyz = true;
278  _calculate_face_xyz = true;
279 
280  _calculate_ad_coord = true;
281  return _ad_coord;
282  }
283 
289 
294  const libMesh::QBase * const & qRuleFace() const { return constify_ref(_current_qrule_face); }
295 
301 
307 
312  const MooseArray<Real> & JxWFace() const { return _current_JxW_face; }
313 
318  const MooseArray<Point> & normals() const { return _current_normals; }
319 
320  /***
321  * Returns the array of normals for quadrature points on a current side
322  */
323  const std::vector<Eigen::Map<RealDIMValue>> & mappedNormals() const { return _mapped_normals; }
324 
330 
334  unsigned int numExtraElemIntegers() const { return _extra_elem_ids.size() - 1; }
335 
339  const dof_id_type & extraElemID(unsigned int id) const
340  {
341  mooseAssert(id < _extra_elem_ids.size(), "An invalid extra element integer id");
342  return _extra_elem_ids[id];
343  }
344 
348  const dof_id_type & extraElemIDNeighbor(unsigned int id) const
349  {
350  mooseAssert(id < _neighbor_extra_elem_ids.size(), "An invalid extra element integer id");
351  return _neighbor_extra_elem_ids[id];
352  }
353 
354  const MooseArray<ADPoint> & adNormals() const { return _ad_normals; }
355 
357  {
358  _calculate_xyz = true;
359  return _ad_q_points;
360  }
361 
363  {
364  _calculate_face_xyz = true;
365  return _ad_q_points_face;
366  }
367 
368  template <bool is_ad>
370 
375  const Elem * const & elem() const { return _current_elem; }
376 
381 
386 
391 
396 
401  const Real & elemVolume() const { return _current_elem_volume; }
402 
407  const unsigned int & side() const { return _current_side; }
408 
413  const unsigned int & neighborSide() const { return _current_neighbor_side; }
414 
419  const Elem *& sideElem() { return _current_side_elem; }
420 
425  const Real & sideElemVolume() const { return _current_side_volume; }
426 
431  const Elem * const & neighbor() const { return _current_neighbor_elem; }
432 
437  const Elem * const & lowerDElem() const { return _current_lower_d_elem; }
438 
443  const Elem * const & neighborLowerDElem() const { return _current_neighbor_lower_d_elem; }
444 
445  /*
446  * @return The current lower-dimensional element volume
447  */
448  const Real & lowerDElemVolume() const;
449 
450  /*
451  * @return The current neighbor lower-dimensional element volume
452  */
453  const Real & neighborLowerDElemVolume() const;
454 
459 
464 
470  {
473  }
474 
479  const libMesh::QBase * const & qRuleNeighbor() const
480  {
482  }
483 
489 
494  const MooseArray<Real> & JxWNeighbor() const;
495 
501 
506  const Node * const & node() const { return _current_node; }
507 
512  const Node * const & nodeNeighbor() const { return _current_neighbor_node; }
513 
522  void createQRules(QuadratureType type,
523  Order order,
524  Order volume_order,
525  Order face_order,
526  SubdomainID block,
527  bool allow_negative_qweights = true);
528 
535  void bumpVolumeQRuleOrder(Order volume_order, SubdomainID block);
536 
544  void bumpAllQRuleOrder(Order order, SubdomainID block);
545 
554  void setVolumeQRule(libMesh::QBase * qrule, unsigned int dim);
555 
564  void setFaceQRule(libMesh::QBase * qrule, unsigned int dim);
565 
573  void setMortarQRule(Order order);
574 
578  void activateDual() { _need_dual = true; }
579 
584  bool needDual() const { return _need_dual; }
585 
589  void clearCachedQRules();
590 
591 private:
598  void setLowerQRule(libMesh::QBase * qrule, unsigned int dim);
599 
600 public:
609  void setNeighborQRule(libMesh::QBase * qrule, unsigned int dim);
610 
616  void reinit(const Elem * elem);
617 
621  void setVolumeQRule(const Elem * elem);
622 
627  void reinitElemFaceRef(const Elem * elem,
628  unsigned int elem_side,
629  Real tolerance,
630  const std::vector<Point> * const pts = nullptr,
631  const std::vector<Real> * const weights = nullptr);
632 
637  void reinitNeighborFaceRef(const Elem * neighbor_elem,
638  unsigned int neighbor_side,
639  Real tolerance,
640  const std::vector<Point> * const pts,
641  const std::vector<Real> * const weights = nullptr);
642 
646  void reinitDual(const Elem * elem, const std::vector<Point> & pts, const std::vector<Real> & JxW);
647 
651  void reinitLowerDElem(const Elem * elem,
652  const std::vector<Point> * const pts = nullptr,
653  const std::vector<Real> * const weights = nullptr);
654 
658  void reinitNeighborLowerDElem(const Elem * elem);
659 
663  void reinitMortarElem(const Elem * elem);
664 
668  const std::vector<Real> & jxWMortar() const { return *_JxW_msm; }
669 
673  const libMesh::QBase * const & qRuleMortar() const { return constify_ref(_qrule_msm); }
674 
675 private:
679  void computeADFace(const Elem & elem, const unsigned int side);
680 
681 public:
685  void reinitAtPhysical(const Elem * elem, const std::vector<Point> & physical_points);
686 
690  void reinit(const Elem * elem, const std::vector<Point> & reference_points);
691 
695  void setFaceQRule(const Elem * const elem, const unsigned int side);
696 
700  void reinit(const Elem * elem, unsigned int side);
701 
705  void reinit(const Elem * elem, unsigned int side, const std::vector<Point> & reference_points);
706 
707  void reinitFVFace(const FaceInfo & fi);
708 
720  void reinitElemAndNeighbor(const Elem * elem,
721  unsigned int side,
722  const Elem * neighbor,
723  unsigned int neighbor_side,
724  const std::vector<Point> * neighbor_reference_points = nullptr);
725 
729  void reinitNeighborAtPhysical(const Elem * neighbor,
730  unsigned int neighbor_side,
731  const std::vector<Point> & physical_points);
732 
736  void reinitNeighborAtPhysical(const Elem * neighbor, const std::vector<Point> & physical_points);
737 
741  void reinitNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
742 
746  void reinit(const Node * node);
747 
751  void init(const libMesh::CouplingMatrix * cm);
752 
754  void initNonlocalCoupling();
755 
757  void prepareJacobianBlock();
758 
760  void prepareResidual();
761 
762  void prepare();
763  void prepareNonlocal();
764 
772  void prepareNeighbor();
773 
778  void prepareLowerD();
779 
780  void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector<dof_id_type> & dof_indices);
781  void prepareBlockNonlocal(unsigned int ivar,
782  unsigned jvar,
783  const std::vector<dof_id_type> & idof_indices,
784  const std::vector<dof_id_type> & jdof_indices);
785  void prepareScalar();
786  void prepareOffDiagScalar();
787 
788  template <typename T>
790  void copyShapes(unsigned int var);
791 
792  template <typename T>
794  void copyFaceShapes(unsigned int var);
795 
796  template <typename T>
798  void copyNeighborShapes(unsigned int var);
799 
806  {
807  // Blessed classes
808  friend class Assembly;
809  friend class SubProblem;
810  friend class FEProblemBase;
811  friend class DisplacedProblem;
812  friend class ComputeMortarFunctor;
813  friend class NonlinearSystemBase;
816  };
817 
824  {
825  // Blessed classes
826  friend class Assembly;
827  friend class TaggingInterface;
830  };
831 
836  void addResidual(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
841  void addResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
846  void addResidualLower(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
847 
852  void addResidualScalar(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
853 
858  void cacheResidual(GlobalDataKey, const std::vector<VectorTag> & tags);
859 
864  void cacheResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & tags);
865 
869  void cacheResidualLower(GlobalDataKey, const std::vector<VectorTag> & tags);
870 
876  void addCachedResiduals(GlobalDataKey, const std::vector<VectorTag> & tags);
877 
886  void clearCachedResiduals(GlobalDataKey);
887 
896  GlobalDataKey,
897  const VectorTag & vector_tag);
898 
902  void setResidual(NumericVector<Number> & residual, GlobalDataKey, const VectorTag & vector_tag);
903 
908  GlobalDataKey,
909  const VectorTag & vector_tag);
910 
914  void addJacobian(GlobalDataKey);
915 
919  void addJacobianNonlocal(GlobalDataKey);
920 
925  void addJacobianNeighbor(GlobalDataKey);
926 
930  void addJacobianScalar(GlobalDataKey);
931 
936  void addJacobianOffDiagScalar(unsigned int ivar, GlobalDataKey);
937 
942  unsigned int ivar,
943  unsigned int jvar,
944  const libMesh::DofMap & dof_map,
945  std::vector<dof_id_type> & dof_indices,
946  GlobalDataKey,
947  TagID tag);
948 
954  unsigned int ivar,
955  unsigned int jvar,
956  const libMesh::DofMap & dof_map,
957  std::vector<dof_id_type> & dof_indices,
958  GlobalDataKey,
959  const std::set<TagID> & tags);
960 
965  unsigned int ivar,
966  unsigned int jvar,
967  const libMesh::DofMap & dof_map,
968  const std::vector<dof_id_type> & idof_indices,
969  const std::vector<dof_id_type> & jdof_indices,
970  GlobalDataKey,
971  TagID tag);
972 
977  unsigned int ivar,
978  unsigned int jvar,
979  const libMesh::DofMap & dof_map,
980  const std::vector<dof_id_type> & idof_indices,
981  const std::vector<dof_id_type> & jdof_indices,
982  GlobalDataKey,
983  const std::set<TagID> & tags);
984 
993  void addJacobianNeighborLowerD(GlobalDataKey);
994 
1000  void addJacobianLowerD(GlobalDataKey);
1001 
1010  void cacheJacobianMortar(GlobalDataKey);
1011 
1017  unsigned int ivar,
1018  unsigned int jvar,
1019  const libMesh::DofMap & dof_map,
1020  std::vector<dof_id_type> & dof_indices,
1021  std::vector<dof_id_type> & neighbor_dof_indices,
1022  GlobalDataKey,
1023  TagID tag);
1024 
1030  unsigned int ivar,
1031  unsigned int jvar,
1032  const libMesh::DofMap & dof_map,
1033  std::vector<dof_id_type> & dof_indices,
1034  std::vector<dof_id_type> & neighbor_dof_indices,
1035  GlobalDataKey,
1036  const std::set<TagID> & tags);
1037 
1041  void cacheJacobian(GlobalDataKey);
1042 
1046  void cacheJacobianNonlocal(GlobalDataKey);
1047 
1052  void cacheJacobianNeighbor(GlobalDataKey);
1053 
1060  void addCachedJacobian(GlobalDataKey);
1061 
1065  void setCachedJacobian(GlobalDataKey);
1066 
1070  void zeroCachedJacobian(GlobalDataKey);
1071 
1076  DenseVector<Number> & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
1077  {
1078  return _sub_Re[tag_id][var_num];
1079  }
1080 
1086  {
1087  return _sub_Rn[tag_id][var_num];
1088  }
1089 
1095  {
1096  return _sub_Rl[tag_id][var_num];
1097  }
1098 
1103  DenseMatrix<Number> & jacobianBlock(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1104  {
1105  jacobianBlockUsed(tag, ivar, jvar, true);
1106  return _sub_Kee[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1107  }
1108 
1114  jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1115  {
1116  jacobianBlockNonlocalUsed(tag, ivar, jvar, true);
1117  return _sub_Keg[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1118  }
1119 
1125  Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag);
1126 
1135  unsigned int ivar,
1136  unsigned int jvar,
1137  LocalDataKey,
1138  TagID tag);
1139 
1144  void cacheResidualNodes(const DenseVector<Number> & res,
1145  const std::vector<dof_id_type> & dof_index,
1146  LocalDataKey,
1147  TagID tag);
1148 
1160  void
1161  cacheJacobian(numeric_index_type i, numeric_index_type j, Real value, LocalDataKey, TagID tag);
1162 
1176  Real value,
1177  LocalDataKey,
1178  const std::set<TagID> & tags);
1179 
1186  void cacheJacobianBlock(DenseMatrix<Number> & jac_block,
1187  const std::vector<dof_id_type> & idof_indices,
1188  const std::vector<dof_id_type> & jdof_indices,
1189  Real scaling_factor,
1190  LocalDataKey,
1191  TagID tag);
1192 
1202  template <typename Residuals, typename Indices>
1203  void cacheResiduals(const Residuals & residuals,
1204  const Indices & row_indices,
1205  Real scaling_factor,
1206  LocalDataKey,
1207  const std::set<TagID> & vector_tags);
1208 
1216  template <typename Residuals, typename Indices>
1217  void cacheJacobian(const Residuals & residuals,
1218  const Indices & row_indices,
1219  Real scaling_factor,
1220  LocalDataKey,
1221  const std::set<TagID> & matrix_tags);
1222 
1233  template <typename Residuals, typename Indices>
1234  void cacheResidualsWithoutConstraints(const Residuals & residuals,
1235  const Indices & row_indices,
1236  Real scaling_factor,
1237  LocalDataKey,
1238  const std::set<TagID> & vector_tags);
1239 
1247  template <typename Residuals, typename Indices>
1248  void cacheJacobianWithoutConstraints(const Residuals & residuals,
1249  const Indices & row_indices,
1250  Real scaling_factor,
1251  LocalDataKey,
1252  const std::set<TagID> & matrix_tags);
1253 
1254  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> & couplingEntries()
1255  {
1256  return _cm_ff_entry;
1257  }
1258  const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1260  {
1261  return _cm_ff_entry;
1262  }
1263  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1265  {
1266  return _cm_nonlocal_entry;
1267  }
1268  const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> &
1270  {
1271  return _cm_fs_entry;
1272  }
1273  const std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> &
1275  {
1276  return _cm_sf_entry;
1277  }
1278 
1279  // Read-only references
1280  const VariablePhiValue & phi() const { return _phi; }
1281  template <typename T>
1283  {
1284  return _ad_grad_phi_data.at(v.feType());
1285  }
1286  const VariablePhiValue & phi(const MooseVariableField<Real> &) const { return _phi; }
1287  const VariablePhiGradient & gradPhi() const { return _grad_phi; }
1289  const VariablePhiSecond & secondPhi() const { return _second_phi; }
1291  {
1292  return _second_phi;
1293  }
1294 
1295  const VariablePhiValue & phiFace() const { return _phi_face; }
1296  const VariablePhiValue & phiFace(const MooseVariableField<Real> &) const { return _phi_face; }
1297  const VariablePhiGradient & gradPhiFace() const { return _grad_phi_face; }
1299  {
1300  return _grad_phi_face;
1301  }
1303  {
1304  return _second_phi_face;
1305  }
1306 
1308  {
1309  return _phi_neighbor;
1310  }
1312  {
1313  return _grad_phi_neighbor;
1314  }
1316  {
1317  return _second_phi_neighbor;
1318  }
1319 
1321  {
1322  return _phi_face_neighbor;
1323  }
1325  {
1326  return _grad_phi_face_neighbor;
1327  }
1329  {
1331  }
1332 
1334  {
1335  return _vector_phi;
1336  }
1338  {
1339  return _vector_grad_phi;
1340  }
1342  {
1343  return _vector_second_phi;
1344  }
1346  {
1347  return _vector_curl_phi;
1348  }
1350  {
1351  return _vector_div_phi;
1352  }
1353 
1355  {
1356  return _vector_phi_face;
1357  }
1359  {
1360  return _vector_grad_phi_face;
1361  }
1363  {
1364  return _vector_second_phi_face;
1365  }
1367  {
1368  return _vector_curl_phi_face;
1369  }
1371  {
1372  return _vector_div_phi_face;
1373  }
1374 
1376  {
1377  return _vector_phi_neighbor;
1378  }
1381  {
1383  }
1384  const VectorVariablePhiSecond &
1386  {
1388  }
1390  {
1392  }
1395  {
1396  return _vector_div_phi_neighbor;
1397  }
1398 
1400  {
1402  }
1405  {
1407  }
1408  const VectorVariablePhiSecond &
1410  {
1412  }
1413  const VectorVariablePhiCurl &
1415  {
1417  }
1420  {
1422  }
1423 
1424  // Writeable references
1428 
1432 
1435  {
1436  return _grad_phi_neighbor;
1437  }
1439  {
1440  return _second_phi_neighbor;
1441  }
1442 
1444  {
1445  return _phi_face_neighbor;
1446  }
1448  {
1449  return _grad_phi_face_neighbor;
1450  }
1452  {
1454  }
1455 
1456  // Writeable references with vector variable
1459  {
1460  return _vector_grad_phi;
1461  }
1463  {
1464  return _vector_second_phi;
1465  }
1467  {
1468  return _vector_curl_phi;
1469  }
1471  {
1472  return _vector_div_phi;
1473  }
1474 
1476  {
1477  return _vector_phi_face;
1478  }
1480  {
1481  return _vector_grad_phi_face;
1482  }
1484  {
1485  return _vector_second_phi_face;
1486  }
1488  {
1489  return _vector_curl_phi_face;
1490  }
1492  {
1493  return _vector_div_phi_face;
1494  }
1495 
1497  {
1498  return _vector_phi_neighbor;
1499  }
1501  {
1503  }
1505  {
1507  }
1509  {
1511  }
1513  {
1514  return _vector_div_phi_neighbor;
1515  }
1517  {
1519  }
1521  {
1523  }
1525  {
1527  }
1529  {
1531  }
1533  {
1535  }
1536 
1537  // Writeable references with array variable
1541 
1544  {
1545  return _grad_phi_face;
1546  }
1548  {
1549  return _second_phi_face;
1550  }
1551 
1553  {
1554  return _phi_neighbor;
1555  }
1557  {
1558  return _grad_phi_neighbor;
1559  }
1561  {
1562  return _second_phi_neighbor;
1563  }
1564 
1566  {
1567  return _phi_face_neighbor;
1568  }
1570  {
1571  return _grad_phi_face_neighbor;
1572  }
1574  {
1576  }
1577 
1578  template <typename OutputType>
1580  {
1581  buildFE(type);
1582  return _fe_shape_data[type]->_phi;
1583  }
1584 
1585  template <typename OutputType>
1587  {
1588  buildFE(type);
1589  return _fe_shape_data[type]->_grad_phi;
1590  }
1591 
1592  template <typename OutputType>
1594  {
1595  return _ad_grad_phi_data[type];
1596  }
1597 
1598  template <typename OutputType>
1600  {
1601  _need_second_derivative.insert(type);
1602  buildFE(type);
1603  return _fe_shape_data[type]->_second_phi;
1604  }
1605 
1606  template <typename OutputType>
1607  const typename OutputTools<OutputType>::VariablePhiValue & fePhiLower(FEType type) const;
1608 
1609  template <typename OutputType>
1611 
1612  template <typename OutputType>
1614 
1615  template <typename OutputType>
1617  feGradDualPhiLower(FEType type) const;
1618 
1619  template <typename OutputType>
1621  {
1622  buildFaceFE(type);
1623  return _fe_shape_data_face[type]->_phi;
1624  }
1625 
1626  template <typename OutputType>
1628  {
1629  buildFaceFE(type);
1630  return _fe_shape_data_face[type]->_grad_phi;
1631  }
1632 
1633  template <typename OutputType>
1635  {
1636  return _ad_grad_phi_data_face[type];
1637  }
1638 
1639  template <typename OutputType>
1641  {
1642  _need_second_derivative.insert(type);
1643  buildFaceFE(type);
1644  return _fe_shape_data_face[type]->_second_phi;
1645  }
1646 
1647  template <typename OutputType>
1649  {
1650  buildNeighborFE(type);
1651  return _fe_shape_data_neighbor[type]->_phi;
1652  }
1653 
1654  template <typename OutputType>
1656  {
1657  buildNeighborFE(type);
1658  return _fe_shape_data_neighbor[type]->_grad_phi;
1659  }
1660 
1661  template <typename OutputType>
1663  {
1664  _need_second_derivative_neighbor.insert(type);
1665  buildNeighborFE(type);
1666  return _fe_shape_data_neighbor[type]->_second_phi;
1667  }
1668 
1669  template <typename OutputType>
1671  {
1672  buildFaceNeighborFE(type);
1673  return _fe_shape_data_face_neighbor[type]->_phi;
1674  }
1675 
1676  template <typename OutputType>
1679  {
1680  buildFaceNeighborFE(type);
1681  return _fe_shape_data_face_neighbor[type]->_grad_phi;
1682  }
1683 
1684  template <typename OutputType>
1687  {
1688  _need_second_derivative_neighbor.insert(type);
1689  buildFaceNeighborFE(type);
1690  return _fe_shape_data_face_neighbor[type]->_second_phi;
1691  }
1692 
1693  template <typename OutputType>
1695  {
1696  _need_curl.insert(type);
1697  buildFE(type);
1698  return _fe_shape_data[type]->_curl_phi;
1699  }
1700 
1701  template <typename OutputType>
1703  {
1704  _need_curl.insert(type);
1705  buildFaceFE(type);
1706  return _fe_shape_data_face[type]->_curl_phi;
1707  }
1708 
1709  template <typename OutputType>
1711  {
1712  _need_curl.insert(type);
1713  buildNeighborFE(type);
1714  return _fe_shape_data_neighbor[type]->_curl_phi;
1715  }
1716 
1717  template <typename OutputType>
1719  {
1720  _need_curl.insert(type);
1721  buildFaceNeighborFE(type);
1722  return _fe_shape_data_face_neighbor[type]->_curl_phi;
1723  }
1724 
1725  template <typename OutputType>
1727  {
1728  buildFE(type);
1729  return _fe_shape_data[type]->_div_phi;
1730  }
1731 
1732  template <typename OutputType>
1734  {
1735  buildFaceFE(type);
1736  return _fe_shape_data_face[type]->_div_phi;
1737  }
1738 
1739  template <typename OutputType>
1742  {
1743  buildNeighborFE(type);
1744  return _fe_shape_data_neighbor[type]->_div_phi;
1745  }
1746 
1747  template <typename OutputType>
1750  {
1751  buildFaceNeighborFE(type);
1752  return _fe_shape_data_face_neighbor[type]->_div_phi;
1753  }
1754 
1756  Real elementVolume(const Elem * elem) const;
1757 
1761  void setXFEM(std::shared_ptr<XFEMInterface> xfem) { _xfem = xfem; }
1762 
1766  void assignDisplacements(
1767  std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions);
1768 
1778  unsigned int i,
1779  unsigned int ntest,
1780  const RealEigenVector & v) const
1781  {
1782  for (unsigned int j = 0; j < v.size(); ++j, i += ntest)
1783  re(i) += v(j);
1784  }
1785 
1797  unsigned int i,
1798  unsigned int ntest,
1799  unsigned int j,
1800  unsigned int nphi,
1801  unsigned int ivar,
1802  const RealEigenVector & v) const
1803  {
1804  unsigned int pace = (_component_block_diagonal[ivar] ? 0 : nphi);
1805  for (unsigned int k = 0; k < v.size(); ++k, i += ntest, j += pace)
1806  ke(i, j) += v(k);
1807  }
1808 
1822  unsigned int i,
1823  unsigned int ntest,
1824  unsigned int j,
1825  unsigned int nphi,
1826  unsigned int ivar,
1827  unsigned int jvar,
1828  const RealEigenMatrix & v) const
1829  {
1830  if (ivar == jvar && _component_block_diagonal[ivar])
1831  {
1832  for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1833  ke(i, j) += v(k, k);
1834  }
1835  else
1836  {
1837  const unsigned int saved_j = j;
1838  for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1839  {
1840  j = saved_j;
1841  for (unsigned int l = 0; l < v.cols(); ++l, j += nphi)
1842  ke(i, j) += v(k, l);
1843  }
1844  }
1845  }
1846 
1848  {
1849  unsigned int rows = ke.m();
1850  unsigned int cols = ke.n();
1851  DenseVector<Real> diag(rows);
1852  for (unsigned int i = 0; i < rows; i++)
1853  // % operation is needed to account for cases of no component coupling of array variables
1854  diag(i) = ke(i, i % cols);
1855  return diag;
1856  }
1857 
1863  inline const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase & fe)
1864  {
1865  auto qrule = qrules(dim).vol.get();
1866  fe.attach_quadrature_rule(qrule);
1867  return qrule;
1868  }
1869 
1875  inline const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase & fe)
1876  {
1877  auto qrule = qrules(dim).face.get();
1878  fe.attach_quadrature_rule(qrule);
1879  return qrule;
1880  }
1881 
1886  void hasScalingVector();
1887 
1896  void modifyArbitraryWeights(const std::vector<Real> & weights);
1897 
1901  bool computingResidual() const { return _computing_residual; }
1902 
1906  bool computingJacobian() const { return _computing_jacobian; }
1907 
1912 
1916  const Elem * const & msmElem() const { return _msm_elem; }
1917 
1927  void havePRefinement(const std::unordered_set<FEFamily> & disable_p_refinement_for_families);
1928 
1932  void setCurrentLowerDElem(const Elem * const lower_d_elem);
1933 
1934 private:
1940  void reinitFE(const Elem * elem);
1941 
1948  void reinitFEFace(const Elem * elem, unsigned int side);
1949 
1950  void computeFaceMap(const Elem & elem, const unsigned int side, const std::vector<Real> & qw);
1951 
1952  void reinitFEFaceNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1953 
1954  void reinitFENeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1955 
1956  template <typename Points, typename Coords>
1957  void setCoordinateTransformation(const libMesh::QBase * qrule,
1958  const Points & q_points,
1959  Coords & coord,
1960  SubdomainID sub_id);
1961 
1962  void computeCurrentElemVolume();
1963 
1964  void computeCurrentFaceVolume();
1965 
1967 
1973  void modifyWeightsDueToXFEM(const Elem * elem);
1974 
1981  void modifyFaceWeightsDueToXFEM(const Elem * elem, unsigned int side = 0);
1982 
1987  template <typename OutputType>
1988  void computeGradPhiAD(const Elem * elem,
1989  unsigned int n_qp,
1992 
1996  void resizeADMappingObjects(unsigned int n_qp, unsigned int dim);
1997 
2002  void
2003  computeSinglePointMapAD(const Elem * elem, const std::vector<Real> & qw, unsigned p, FEBase * fe);
2004 
2008  void addResidual(const VectorTag & vector_tag);
2012  void addResidualNeighbor(const VectorTag & vector_tag);
2017  void addResidualLower(const VectorTag & vector_tag);
2021  void addResidualScalar(const VectorTag & vector_tag);
2022 
2026  void clearCachedResiduals(const VectorTag & vector_tag);
2027 
2036  void cacheResidual(dof_id_type dof, Real value, TagID tag_id);
2037 
2046  void cacheResidual(dof_id_type dof, Real value, const std::set<TagID> & tags);
2047 
2052  void processLocalResidual(DenseVector<Number> & res_block,
2053  std::vector<dof_id_type> & dof_indices,
2054  const std::vector<Real> & scaling_factor,
2055  bool is_nodal);
2056 
2060  void addResidualBlock(NumericVector<Number> & residual,
2061  DenseVector<Number> & res_block,
2062  const std::vector<dof_id_type> & dof_indices,
2063  const std::vector<Real> & scaling_factor,
2064  bool is_nodal);
2065 
2069  void cacheResidualBlock(std::vector<Real> & cached_residual_values,
2070  std::vector<dof_id_type> & cached_residual_rows,
2071  DenseVector<Number> & res_block,
2072  const std::vector<dof_id_type> & dof_indices,
2073  const std::vector<Real> & scaling_factor,
2074  bool is_nodal);
2075 
2079  void setResidualBlock(NumericVector<Number> & residual,
2080  DenseVector<Number> & res_block,
2081  const std::vector<dof_id_type> & dof_indices,
2082  const std::vector<Real> & scaling_factor,
2083  bool is_nodal);
2084 
2089  DenseMatrix<Number> & jac_block,
2090  const MooseVariableBase & ivar,
2091  const MooseVariableBase & jvar,
2092  const std::vector<dof_id_type> & idof_indices,
2093  const std::vector<dof_id_type> & jdof_indices);
2094 
2098  void cacheJacobianBlock(DenseMatrix<Number> & jac_block,
2099  const MooseVariableBase & ivar,
2100  const MooseVariableBase & jvar,
2101  const std::vector<dof_id_type> & idof_indices,
2102  const std::vector<dof_id_type> & jdof_indices,
2103  TagID tag);
2104 
2109  const MooseVariableBase & ivar,
2110  const MooseVariableBase & jvar,
2111  const std::vector<dof_id_type> & idof_indices,
2112  const std::vector<dof_id_type> & jdof_indices,
2113  TagID tag);
2114 
2118  void addJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2119 
2123  void cacheJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2124 
2130  void clearCachedJacobian();
2131 
2136  void buildFE(FEType type) const;
2137 
2142  void buildFaceFE(FEType type) const;
2143 
2148  void buildNeighborFE(FEType type) const;
2149 
2154  void buildFaceNeighborFE(FEType type) const;
2155 
2160  void buildLowerDFE(FEType type) const;
2161 
2162  void buildLowerDDualFE(FEType type) const;
2163 
2168  void buildVectorFE(FEType type) const;
2169 
2174  void buildVectorFaceFE(FEType type) const;
2175 
2180  void buildVectorNeighborFE(FEType type) const;
2181 
2186  void buildVectorFaceNeighborFE(FEType type) const;
2187 
2192  void buildVectorLowerDFE(FEType type) const;
2193  void buildVectorDualLowerDFE(FEType type) const;
2194 
2199  void jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2200  {
2201  _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2202  }
2203 
2208  char jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2209  {
2210  return _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2211  }
2212 
2217  void jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2218  {
2219  _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2220  }
2221 
2226  char jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2227  {
2228  return _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2229  }
2230 
2235  void jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2236  {
2237  _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2238  }
2239 
2244  char jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2245  {
2246  return _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2247  }
2248 
2253  void jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2254  {
2255  _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2256  }
2257 
2262  char jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2263  {
2264  return _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2265  }
2266 
2270  void helpersRequestData();
2271 
2274 
2275  const bool _displaced;
2276 
2280 
2282  const bool & _computing_residual;
2283 
2285  const bool & _computing_jacobian;
2286 
2289 
2291  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_ff_entry;
2293  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> _cm_fs_entry;
2295  std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> _cm_sf_entry;
2297  std::vector<std::pair<MooseVariableScalar *, MooseVariableScalar *>> _cm_ss_entry;
2299  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_nonlocal_entry;
2301  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_used;
2302  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_nonlocal_used;
2304  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_neighbor_used;
2306  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_lower_used;
2311 
2313 
2314  unsigned int _mesh_dimension;
2315 
2319 
2326 
2329  std::vector<std::unique_ptr<FEBase>> _unique_fe_helper;
2330  std::vector<std::unique_ptr<FEBase>> _unique_fe_face_helper;
2331  std::vector<std::unique_ptr<FEBase>> _unique_fe_face_neighbor_helper;
2332  std::vector<std::unique_ptr<FEBase>> _unique_fe_neighbor_helper;
2333  std::vector<std::unique_ptr<FEBase>> _unique_fe_lower_helper;
2334 
2337 
2339  std::shared_ptr<XFEMInterface> _xfem;
2340 
2342  std::map<FEType, FEBase *> _current_fe;
2344  std::map<FEType, FEBase *> _current_fe_face;
2346  std::map<FEType, FEBase *> _current_fe_neighbor;
2348  std::map<FEType, FEBase *> _current_fe_face_neighbor;
2349 
2351  std::map<FEType, FEVectorBase *> _current_vector_fe;
2353  std::map<FEType, FEVectorBase *> _current_vector_fe_face;
2355  std::map<FEType, FEVectorBase *> _current_vector_fe_neighbor;
2357  std::map<FEType, FEVectorBase *> _current_vector_fe_face_neighbor;
2358 
2359  /**** Volume Stuff ****/
2360 
2362  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe;
2364  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe;
2366  std::map<unsigned int, FEBase *> _holder_fe_helper;
2387 
2390  struct QRules
2391  {
2393  : vol(nullptr),
2394  face(nullptr),
2395  arbitrary_vol(nullptr),
2396  arbitrary_face(nullptr),
2397  neighbor(nullptr)
2398  {
2399  }
2400 
2402  std::unique_ptr<libMesh::QBase> vol;
2404  std::unique_ptr<libMesh::QBase> face;
2406  std::unique_ptr<libMesh::QBase> fv_face;
2408  std::unique_ptr<ArbitraryQuadrature> arbitrary_vol;
2410  std::unique_ptr<ArbitraryQuadrature> arbitrary_face;
2412  std::unique_ptr<ArbitraryQuadrature> neighbor;
2413  };
2414 
2419  std::unordered_map<SubdomainID, std::vector<QRules>> _qrules;
2420 
2427  libMesh::QBase * qruleFace(const Elem * elem, unsigned int side);
2428  ArbitraryQuadrature * qruleArbitraryFace(const Elem * elem, unsigned int side);
2429 
2430  template <typename T>
2431  T * qruleFaceHelper(const Elem * elem, unsigned int side, std::function<T *(QRules &)> rule_fn)
2432  {
2433  auto dim = elem->dim();
2434  auto neighbor = elem->neighbor_ptr(side);
2435  auto q = rule_fn(qrules(dim, elem->subdomain_id()));
2436  if (!neighbor)
2437  return q;
2438 
2439  // find the maximum face quadrature order for all blocks the face is in
2440  auto neighbor_block = neighbor->subdomain_id();
2441  if (neighbor_block == elem->subdomain_id())
2442  return q;
2443 
2444  auto q_neighbor = rule_fn(qrules(dim, neighbor_block));
2445  if (q->get_order() > q_neighbor->get_order())
2446  return q;
2447  return q_neighbor;
2448  }
2449 
2450  inline QRules & qrules(unsigned int dim) { return qrules(dim, _current_subdomain_id); }
2451 
2455  inline QRules & qrules(unsigned int dim, SubdomainID block)
2456  {
2457  if (_qrules.find(block) == _qrules.end())
2458  {
2459  mooseAssert(_qrules.find(Moose::ANY_BLOCK_ID) != _qrules.end(),
2460  "missing quadrature rules for specified block");
2461  mooseAssert(_qrules[Moose::ANY_BLOCK_ID].size() > dim,
2462  "quadrature rules not sized property for dimension");
2463  return _qrules[Moose::ANY_BLOCK_ID][dim];
2464  }
2465  mooseAssert(_qrules.find(block) != _qrules.end(),
2466  "missing quadrature rules for specified block");
2467  mooseAssert(_qrules[block].size() > dim, "quadrature rules not sized property for dimension");
2468  return _qrules[block][dim];
2469  }
2470 
2471  /**** Face Stuff ****/
2472 
2474  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face;
2476  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face;
2478  std::map<unsigned int, FEBase *> _holder_fe_face_helper;
2492  std::vector<Eigen::Map<RealDIMValue>> _mapped_normals;
2495 
2497  std::vector<dof_id_type> _extra_elem_ids;
2499  std::vector<dof_id_type> _neighbor_extra_elem_ids;
2501  std::map<unsigned int, const std::vector<Point> *> _holder_normals;
2502 
2503  /**** Neighbor Stuff ****/
2504 
2506  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_neighbor;
2507  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face_neighbor;
2508  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_neighbor;
2509  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face_neighbor;
2510 
2512  std::map<unsigned int, FEBase *> _holder_fe_neighbor_helper;
2513  std::map<unsigned int, FEBase *> _holder_fe_face_neighbor_helper;
2514 
2516  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_lower;
2518  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_lower;
2520  std::map<unsigned int, FEBase *> _holder_fe_lower_helper;
2521 
2527  mutable bool _need_JxW_neighbor;
2535 
2536  /********** mortar stuff *************/
2537 
2539  const std::vector<Real> * _JxW_msm;
2541  std::unique_ptr<FEBase> _fe_msm;
2549 
2553 
2554 protected:
2556  const Elem * _current_elem;
2564  unsigned int _current_side;
2566  const Elem * _current_side_elem;
2582  const Node * _current_node;
2589 
2604 
2607 
2608  /*
2609  * Residual contributions <tag_index, ivar>
2610  *
2611  * tag_index is the index into _residual_vector_tags, that is, _sub_Re[0] corresponds to the tag
2612  * with TagID _residual_vector_tags[0]._id
2613  *
2614  * When ivar corresponds to an array variable, the dense vector is in size of ndof * count,
2615  * where count is the number of components of the array variable. The local residual is ordered
2616  * as (r_i,j, i = 1,...,ndof; j = 1,...,count).
2617  *
2618  * Dense vectors for variables (ivar+i, i = 1,...,count) are empty.
2619  */
2620  std::vector<std::vector<DenseVector<Number>>> _sub_Re;
2621  std::vector<std::vector<DenseVector<Number>>> _sub_Rn;
2623  std::vector<std::vector<DenseVector<Number>>> _sub_Rl;
2624 
2627 
2628  /*
2629  * Jacobian contributions <Tag, ivar, jvar>
2630  * When ivar corresponds to an array variable, the number of rows of the dense matrix is in size
2631  * of indof * icount, where icount is the number of components of ivar. When jvar corresponds to
2632  * an array variable, the number of columns of the dense matrix is in size of jndof * jcount,
2633  * where jcount is the number of components of jvar. The local residual is ordered as
2634  * (K_(i,j,k,l), k=1,...,jndof; l = 1,...,jcout; i = 1,...,indof; j = 1,...,icount).
2635  *
2636  * Dense matrices for variables (ivar+i, i = 1,...,icount) or (jvar+j, j = 1,...,jcount) are
2637  * empty.
2638  */
2639  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kee;
2640  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Keg;
2641 
2643  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Ken;
2645  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kne;
2647  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knn;
2649  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kll;
2651  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kle;
2653  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kln;
2655  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kel;
2657  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knl;
2658 
2661 
2662  // Shape function values, gradients. second derivatives
2666 
2670 
2674 
2678 
2679  // Shape function values, gradients, second derivatives
2685 
2691 
2697 
2703 
2705  {
2706  public:
2712  };
2713 
2715  {
2716  public:
2722  };
2723 
2725  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data;
2726  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face;
2727  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_neighbor;
2728  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face_neighbor;
2729  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_lower;
2730  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_dual_lower;
2731 
2733  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data;
2734  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face;
2735  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_neighbor;
2736  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face_neighbor;
2737  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_lower;
2738  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_dual_lower;
2739 
2740  mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data;
2741  mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>> _ad_vector_grad_phi_data;
2742  mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data_face;
2743  mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>>
2745 
2755  const std::vector<VectorTag> & _residual_vector_tags;
2756 
2758  std::vector<std::vector<Real>> _cached_residual_values;
2759 
2761  std::vector<std::vector<dof_id_type>> _cached_residual_rows;
2762 
2764 
2766  std::vector<std::vector<Real>> _cached_jacobian_values;
2768  std::vector<std::vector<dof_id_type>> _cached_jacobian_rows;
2770  std::vector<std::vector<dof_id_type>> _cached_jacobian_cols;
2771 
2773 
2778  std::vector<bool> _component_block_diagonal;
2779 
2781  std::vector<dof_id_type> _temp_dof_indices;
2782 
2784  std::vector<Point> _temp_reference_points;
2785 
2787  std::vector<VectorValue<ADReal>> _ad_dxyzdxi_map;
2788  std::vector<VectorValue<ADReal>> _ad_dxyzdeta_map;
2789  std::vector<VectorValue<ADReal>> _ad_dxyzdzeta_map;
2790  std::vector<VectorValue<ADReal>> _ad_d2xyzdxi2_map;
2791  std::vector<VectorValue<ADReal>> _ad_d2xyzdxideta_map;
2792  std::vector<VectorValue<ADReal>> _ad_d2xyzdeta2_map;
2793  std::vector<ADReal> _ad_jac;
2796  std::vector<ADReal> _ad_dxidx_map;
2797  std::vector<ADReal> _ad_dxidy_map;
2798  std::vector<ADReal> _ad_dxidz_map;
2799  std::vector<ADReal> _ad_detadx_map;
2800  std::vector<ADReal> _ad_detady_map;
2801  std::vector<ADReal> _ad_detadz_map;
2802  std::vector<ADReal> _ad_dzetadx_map;
2803  std::vector<ADReal> _ad_dzetady_map;
2804  std::vector<ADReal> _ad_dzetadz_map;
2805 
2811 
2815  std::vector<std::pair<unsigned int, unsigned short>> _disp_numbers_and_directions;
2816 
2817  mutable bool _calculate_xyz;
2818  mutable bool _calculate_face_xyz;
2820 
2823  mutable bool _calculate_ad_coord;
2824 
2825  mutable std::set<FEType> _need_second_derivative;
2826  mutable std::set<FEType> _need_second_derivative_neighbor;
2827  mutable std::set<FEType> _need_curl;
2828  mutable std::set<FEType> _need_div;
2829  mutable std::set<FEType> _need_face_div;
2830  mutable std::set<FEType> _need_neighbor_div;
2831  mutable std::set<FEType> _need_face_neighbor_div;
2832 
2834  const NumericVector<Real> * _scaling_vector = nullptr;
2835 
2842 
2843  const Elem * _msm_elem = nullptr;
2844 
2849 
2854 
2858  std::vector<dof_id_type> _row_indices, _column_indices;
2859 
2862 
2864  std::vector<Point> _current_neighbor_ref_points;
2865 };
2866 
2867 template <typename OutputType>
2870 {
2871  buildLowerDFE(type);
2872  return _fe_shape_data_lower[type]->_phi;
2873 }
2874 
2875 template <typename OutputType>
2878 {
2879  buildLowerDDualFE(type);
2880  return _fe_shape_data_dual_lower[type]->_phi;
2881 }
2882 
2883 template <typename OutputType>
2886 {
2887  buildLowerDFE(type);
2888  return _fe_shape_data_lower[type]->_grad_phi;
2889 }
2890 
2891 template <typename OutputType>
2894 {
2895  buildLowerDDualFE(type);
2896  return _fe_shape_data_dual_lower[type]->_grad_phi;
2897 }
2898 
2899 template <>
2901 Assembly::feADGradPhi<RealVectorValue>(FEType type) const
2902 {
2903  return _ad_vector_grad_phi_data[type];
2904 }
2905 
2906 template <>
2908 Assembly::feADGradPhiFace<RealVectorValue>(FEType type) const
2909 {
2910  return _ad_vector_grad_phi_data_face[type];
2911 }
2912 
2913 template <>
2915 Assembly::fePhi<VectorValue<Real>>(FEType type) const;
2916 
2917 template <>
2919 Assembly::feGradPhi<VectorValue<Real>>(FEType type) const;
2920 
2921 template <>
2923 Assembly::feSecondPhi<VectorValue<Real>>(FEType type) const;
2924 
2925 template <>
2927 Assembly::fePhiLower<VectorValue<Real>>(FEType type) const;
2928 
2929 template <>
2931 Assembly::feDualPhiLower<VectorValue<Real>>(FEType type) const;
2932 
2933 template <>
2935 Assembly::feGradPhiLower<VectorValue<Real>>(FEType type) const;
2936 
2937 template <>
2939 Assembly::feGradDualPhiLower<VectorValue<Real>>(FEType type) const;
2940 
2941 template <>
2943 Assembly::fePhiFace<VectorValue<Real>>(FEType type) const;
2944 
2945 template <>
2947 Assembly::feGradPhiFace<VectorValue<Real>>(FEType type) const;
2948 
2949 template <>
2951 Assembly::feSecondPhiFace<VectorValue<Real>>(FEType type) const;
2952 
2953 template <>
2955 Assembly::fePhiNeighbor<VectorValue<Real>>(FEType type) const;
2956 
2957 template <>
2959 Assembly::feGradPhiNeighbor<VectorValue<Real>>(FEType type) const;
2960 
2961 template <>
2963 Assembly::feSecondPhiNeighbor<VectorValue<Real>>(FEType type) const;
2964 
2965 template <>
2967 Assembly::fePhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
2968 
2969 template <>
2971 Assembly::feGradPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
2972 
2973 template <>
2975 Assembly::feSecondPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
2976 
2977 template <>
2979 Assembly::feCurlPhi<VectorValue<Real>>(FEType type) const;
2980 
2981 template <>
2983 Assembly::feCurlPhiFace<VectorValue<Real>>(FEType type) const;
2984 
2985 template <>
2987 Assembly::feCurlPhiNeighbor<VectorValue<Real>>(FEType type) const;
2988 
2989 template <>
2991 Assembly::feCurlPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
2992 
2993 template <>
2995 Assembly::feDivPhi<VectorValue<Real>>(FEType type) const;
2996 
2997 template <>
2999 Assembly::feDivPhiFace<VectorValue<Real>>(FEType type) const;
3000 
3001 template <>
3003 Assembly::feDivPhiNeighbor<VectorValue<Real>>(FEType type) const;
3004 
3005 template <>
3007 Assembly::feDivPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3008 
3009 template <>
3011 Assembly::adGradPhi<RealVectorValue>(const MooseVariableFE<RealVectorValue> & v) const
3012 {
3013  return _ad_vector_grad_phi_data.at(v.feType());
3014 }
3015 
3016 template <typename Residuals, typename Indices>
3017 void
3018 Assembly::cacheResiduals(const Residuals & residuals,
3019  const Indices & input_row_indices,
3020  const Real scaling_factor,
3021  LocalDataKey,
3022  const std::set<TagID> & vector_tags)
3023 {
3024  mooseAssert(residuals.size() == input_row_indices.size(),
3025  "The number of residuals should match the number of dof indices");
3026  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3027 
3028  if (!computingResidual() || vector_tags.empty())
3029  return;
3030 
3031  if (residuals.size() == 1)
3032  {
3033  // No constraining is required. (This is likely a finite volume computation if we only have a
3034  // single dof)
3036  residuals, input_row_indices, scaling_factor, LocalDataKey{}, vector_tags);
3037  return;
3038  }
3039 
3040  // Need to make a copy because we might modify this in constrain_element_vector
3041  _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3042 
3044  for (const auto i : index_range(_row_indices))
3045  _element_vector(i) = MetaPhysicL::raw_value(residuals[i]) * scaling_factor;
3046 
3047  // At time of writing, this method doesn't do anything with the asymmetric_constraint_rows
3048  // argument, but we set it to false to be consistent with processLocalResidual
3050  _element_vector, _row_indices, /*asymmetric_constraint_rows=*/false);
3051 
3052  for (const auto i : index_range(_row_indices))
3053  cacheResidual(_row_indices[i], _element_vector(i), vector_tags);
3054 }
3055 
3056 template <typename Residuals, typename Indices>
3057 void
3059  const Indices & row_indices,
3060  const Real scaling_factor,
3061  LocalDataKey,
3062  const std::set<TagID> & vector_tags)
3063 {
3064  mooseAssert(residuals.size() == row_indices.size(),
3065  "The number of residuals should match the number of dof indices");
3066  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3067 
3068  if (computingResidual() && !vector_tags.empty())
3069  for (const auto i : index_range(row_indices))
3070  cacheResidual(
3071  row_indices[i], MetaPhysicL::raw_value(residuals[i]) * scaling_factor, vector_tags);
3072 }
3073 
3074 template <typename Residuals, typename Indices>
3075 void
3076 Assembly::cacheJacobian(const Residuals & residuals,
3077  const Indices & input_row_indices,
3078  const Real scaling_factor,
3079  LocalDataKey,
3080  const std::set<TagID> & matrix_tags)
3081 {
3082  if (!computingJacobian() || matrix_tags.empty())
3083  return;
3084 
3085  if (residuals.size() == 1)
3086  {
3087  // No constraining is required. (This is likely a finite volume computation if we only have a
3088  // single dof)
3090  residuals, input_row_indices, scaling_factor, LocalDataKey{}, matrix_tags);
3091  return;
3092  }
3093 
3094  const auto & compare_dofs = residuals[0].derivatives().nude_indices();
3095 #ifndef NDEBUG
3096  auto compare_dofs_set = std::set<dof_id_type>(compare_dofs.begin(), compare_dofs.end());
3097 
3098  for (const auto i : make_range(decltype(residuals.size())(1), residuals.size()))
3099  {
3100  const auto & residual = residuals[i];
3101  auto current_dofs_set = std::set<dof_id_type>(residual.derivatives().nude_indices().begin(),
3102  residual.derivatives().nude_indices().end());
3103  mooseAssert(compare_dofs_set == current_dofs_set,
3104  "We're going to see whether the dof sets are the same. IIRC the degree of freedom "
3105  "dependence (as indicated by the dof index set held by the ADReal) has to be the "
3106  "same for every residual passed to this method otherwise constrain_element_matrix "
3107  "will not work.");
3108  }
3109 #endif
3110  _column_indices.assign(compare_dofs.begin(), compare_dofs.end());
3111 
3112  // If there's no derivatives then there is nothing to do. Moreover, if we pass zero size column
3113  // indices to constrain_element_matrix then we will potentially get errors out of BLAS
3114  if (!_column_indices.size())
3115  return;
3116 
3117  // Need to make a copy because we might modify this in constrain_element_matrix
3118  _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3119 
3121  for (const auto i : index_range(_row_indices))
3122  {
3123  const auto & sparse_derivatives = residuals[i].derivatives();
3124 
3125  for (const auto j : index_range(_column_indices))
3126  _element_matrix(i, j) = sparse_derivatives[_column_indices[j]] * scaling_factor;
3127  }
3128 
3130 
3131  for (const auto i : index_range(_row_indices))
3132  for (const auto j : index_range(_column_indices))
3133  cacheJacobian(_row_indices[i], _column_indices[j], _element_matrix(i, j), {}, matrix_tags);
3134 }
3135 
3136 template <typename Residuals, typename Indices>
3137 void
3138 Assembly::cacheJacobianWithoutConstraints(const Residuals & residuals,
3139  const Indices & row_indices,
3140  const Real scaling_factor,
3141  LocalDataKey,
3142  const std::set<TagID> & matrix_tags)
3143 {
3144  mooseAssert(residuals.size() == row_indices.size(),
3145  "The number of residuals should match the number of dof indices");
3146  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3147 
3148  if (!computingJacobian() || matrix_tags.empty())
3149  return;
3150 
3151  for (const auto i : index_range(row_indices))
3152  {
3153  const auto row_index = row_indices[i];
3154 
3155  const auto & sparse_derivatives = residuals[i].derivatives();
3156  const auto & column_indices = sparse_derivatives.nude_indices();
3157  const auto & raw_derivatives = sparse_derivatives.nude_data();
3158 
3159  for (std::size_t j = 0; j < column_indices.size(); ++j)
3160  cacheJacobian(
3161  row_index, column_indices[j], raw_derivatives[j] * scaling_factor, {}, matrix_tags);
3162  }
3163 }
3164 
3165 inline const Real &
3167 {
3170 }
3171 
3172 inline const Real &
3174 {
3177 }
3178 
3179 inline void
3181  std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions)
3182 {
3183  _disp_numbers_and_directions = std::move(disp_numbers_and_directions);
3184 }
3185 
3186 inline void
3187 Assembly::setCurrentLowerDElem(const Elem * const lower_d_elem)
3188 {
3189  _current_lower_d_elem = lower_d_elem;
3190 }
const Real & neighborVolume()
Returns the reference to the current neighbor volume.
Definition: Assembly.h:469
VariablePhiSecond _second_phi_face
Definition: Assembly.h:2669
const Elem *const & elem() const
Return the current element.
Definition: Assembly.h:375
VariablePhiSecond _second_phi_face_neighbor
Definition: Assembly.h:2677
MooseArray< VectorValue< ADReal > > _ad_normals
Definition: Assembly.h:2807
const VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1333
const FEVectorBase *const & getVectorFEFace(FEType type, unsigned int dim) const
GetVector a reference to a pointer that will contain the current "face" FE.
Definition: Assembly.h:196
void copyShapes(MooseVariableField< T > &v)
Definition: Assembly.C:2995
libMesh::ElemSideBuilder _compute_face_map_side_elem_builder
In place side element builder for computeFaceMap()
Definition: Assembly.h:2841
const FEVectorBase *const & getVectorFE(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current volume FEVector.
Definition: Assembly.h:172
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition: Assembly.h:2474
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition: Assembly.h:2578
void cacheResidualNeighbor(GlobalDataKey, const std::vector< VectorTag > &tags)
Takes the values that are currently in _sub_Rn of all field variables and appends them to the cached ...
Definition: Assembly.C:3455
const unsigned int & neighborSide() const
Returns the current neighboring side.
Definition: Assembly.h:413
VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1462
ArbitraryQuadrature * _current_qrule_arbitrary
The current arbitrary quadrature rule used within the element interior.
Definition: Assembly.h:2374
std::map< FEType, FEBase * > _current_fe
The "volume" fe object that matches the current elem.
Definition: Assembly.h:2342
MooseArray< Real > _curvatures
Definition: Assembly.h:2809
std::vector< ADReal > _ad_detadz_map
Definition: Assembly.h:2801
VectorVariablePhiValue _phi
Definition: Assembly.h:2717
SystemBase & _sys
Definition: Assembly.h:2272
std::vector< std::vector< dof_id_type > > _cached_residual_rows
Where the cached values should go (the first vector is for TIME vs NONTIME)
Definition: Assembly.h:2761
std::vector< std::vector< dof_id_type > > _cached_jacobian_rows
Row where the corresponding cached value should go.
Definition: Assembly.h:2768
unsigned int _max_cached_residuals
Definition: Assembly.h:2763
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data_face
Definition: Assembly.h:2742
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhi(FEType type) const
Definition: Assembly.h:1694
bool _user_added_fe_lower_of_helper_type
Definition: Assembly.h:2325
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called...
Definition: Assembly.h:2606
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1560
const VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1324
const libMesh::FEType & feType() const
Get the type of finite element object.
std::vector< std::unique_ptr< FEBase > > _unique_fe_lower_helper
Definition: Assembly.h:2333
MooseArray< ADReal > _ad_coord
The AD version of the current coordinate transformation coefficients.
Definition: Assembly.h:2386
const MooseArray< ADPoint > & adQPointsFace() const
Definition: Assembly.h:362
void setResidualBlock(NumericVector< Number > &residual, DenseVector< Number > &res_block, const std::vector< dof_id_type > &dof_indices, const std::vector< Real > &scaling_factor, bool is_nodal)
Set a local residual block to a global residual vector with proper scaling.
Definition: Assembly.C:3289
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries()
Definition: Assembly.h:1254
void buildNeighborFE(FEType type) const
Build FEs for a neighbor with a type.
Definition: Assembly.C:314
const VariablePhiSecond & secondPhi() const
Definition: Assembly.h:1289
void setMortarQRule(Order order)
Specifies a custom qrule for integration on mortar segment mesh.
Definition: Assembly.C:735
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe
Each dimension&#39;s actual vector fe objects indexed on type.
Definition: Assembly.h:2364
typename OutputTools< typename Moose::ADType< T >::type >::VariablePhiGradient ADTemplateVariablePhiGradient
Definition: MooseTypes.h:638
void buildVectorLowerDFE(FEType type) const
Build Vector FEs for a lower dimensional element with a type.
Definition: Assembly.C:403
MooseArray< Real > _coord_neighbor
The current coordinate transformation coefficients.
Definition: Assembly.h:2531
const FEBase *const & getFENeighbor(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current &#39;neighbor&#39; FE.
Definition: Assembly.h:136
void buildFE(FEType type) const
Build FEs with a type.
Definition: Assembly.C:266
T * qruleFaceHelper(const Elem *elem, unsigned int side, std::function< T *(QRules &)> rule_fn)
Definition: Assembly.h:2431
libMesh::QBase *const & writeableQRule()
Returns the reference to the current quadrature being used.
Definition: Assembly.h:224
const bool & _computing_residual
Whether we are currently computing the residual.
Definition: Assembly.h:2282
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kle
dlower/dsecondary (or dlower/delement)
Definition: Assembly.h:2651
VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1479
void setCurrentBoundaryID(BoundaryID i)
set the current boundary ID
Definition: Assembly.h:395
void cacheResidualLower(GlobalDataKey, const std::vector< VectorTag > &tags)
Takes the values that are currently in _sub_Rl and appends them to the cached values.
Definition: Assembly.C:3470
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > & fieldScalarCouplingEntries() const
Definition: Assembly.h:1269
const OutputTools< OutputType >::VariablePhiValue & fePhi(FEType type) const
Definition: Assembly.h:1579
void setFaceQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for face integration.
Definition: Assembly.C:674
libMesh::QBase *const & writeableQRuleNeighbor()
Returns the reference to the current quadrature being used on a current neighbor. ...
Definition: Assembly.h:488
Keeps track of stuff related to assembling.
Definition: Assembly.h:101
Assembly(SystemBase &sys, THREAD_ID tid)
Definition: Assembly.C:79
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data
Shape function values, gradients, second derivatives for each FE type.
Definition: Assembly.h:2725
Class for stuff related to variables.
Definition: Adaptivity.h:31
const MooseArray< ADReal > & adJxW() const
Definition: Assembly.h:250
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhiFace(FEType type) const
Definition: Assembly.h:1634
void buildLowerDDualFE(FEType type) const
Definition: Assembly.C:382
VariablePhiGradient & gradPhiFace(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1543
unsigned int TagID
Definition: MooseTypes.h:210
VectorVariablePhiValue _vector_phi
Definition: Assembly.h:2680
MooseArray< Real > _current_JxW_neighbor
The current transformed jacobian weights on a neighbor&#39;s face.
Definition: Assembly.h:2529
std::shared_ptr< XFEMInterface > _xfem
The XFEM controller.
Definition: Assembly.h:2339
void reinitNeighborLowerDElem(const Elem *elem)
reinitialize a neighboring lower dimensional element
Definition: Assembly.C:2381
virtual ~Assembly()
Definition: Assembly.C:186
void setCurrentLowerDElem(const Elem *const lower_d_elem)
Set the current lower dimensional element.
Definition: Assembly.h:3187
const VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1394
void prepareJacobianBlock()
Sizes and zeroes the Jacobian blocks used for the current element.
Definition: Assembly.C:2682
const libMesh::QBase *const & qRuleFace() const
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:294
DenseMatrix< Number > & jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
Get local Jacobian block from non-local contribution for a pair of variables and a tag...
Definition: Assembly.h:1114
VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &)
Definition: Assembly.h:1431
VectorValue< Real > RealVectorValue
Definition: SubProblem.h:33
VariablePhiSecond & secondPhi(const MooseVariableField< Real > &)
Definition: Assembly.h:1427
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kel
dsecondary/dlower (or delement/dlower)
Definition: Assembly.h:2655
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition: Assembly.h:2384
const OutputTools< OutputType >::VariablePhiValue & fePhiLower(FEType type) const
Definition: Assembly.h:2869
VariablePhiDivergence _div_phi
Definition: Assembly.h:2711
DenseMatrix< Number > & jacobianBlockNeighbor(Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
Get local Jacobian block of a DG Jacobian type for a pair of variables and a tag. ...
Definition: Assembly.C:3112
void reinitFE(const Elem *elem)
Just an internal helper function to reinit the volume FE objects.
Definition: Assembly.C:760
libMesh::QBase * _current_qrule_neighbor
quadrature rule used on neighbors
Definition: Assembly.h:2523
const Real & neighborLowerDElemVolume() const
Definition: Assembly.h:3173
void saveDiagLocalArrayJacobian(DenseMatrix< Number > &ke, unsigned int i, unsigned int ntest, unsigned int j, unsigned int nphi, unsigned int ivar, const RealEigenVector &v) const
Helper function for assembling diagonal Jacobian contriubutions on local quadrature points for an arr...
Definition: Assembly.h:1796
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1569
void jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
Sets whether or not Jacobian coupling between ivar and jvar is used to the value used.
Definition: Assembly.h:2199
const MooseArray< Point > & physicalPoints() const
The current points in physical space where we have reinited through reinitAtPhysical() ...
Definition: Assembly.h:242
VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1500
void prepareNonlocal()
Definition: Assembly.C:2720
VariablePhiGradient _grad_phi
Definition: Assembly.h:2664
std::map< unsigned int, FEBase * > _holder_fe_neighbor_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2512
const VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1341
std::unique_ptr< FEBase > _fe_msm
A FE object for working on mortar segement elements.
Definition: Assembly.h:2541
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face_neighbor
Definition: Assembly.h:2728
const VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1375
VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1475
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & nonlocalCouplingEntries()
Definition: Assembly.h:1264
void createQRules(QuadratureType type, Order order, Order volume_order, Order face_order, SubdomainID block, bool allow_negative_qweights=true)
Creates block-specific volume, face and arbitrary qrules based on the orders and the flag of whether ...
Definition: Assembly.C:617
VariablePhiSecond _second_phi_neighbor
Definition: Assembly.h:2673
void setXFEM(std::shared_ptr< XFEMInterface > xfem)
Set the pointer to the XFEM controller object.
Definition: Assembly.h:1761
const MooseArray< ADPoint > & adQPoints() const
Definition: Assembly.h:356
void reinitAtPhysical(const Elem *elem, const std::vector< Point > &physical_points)
Reinitialize the assembly data at specific physical point in the given element.
Definition: Assembly.C:1790
void addCachedResidualDirectly(NumericVector< Number > &residual, GlobalDataKey, const VectorTag &vector_tag)
Adds the values that have been cached by calling cacheResidual(), cacheResidualNeighbor(), and/or cacheResidualLower() to a user-defined residual (that is, not necessarily the vector that vector_tag points to)
Definition: Assembly.C:3530
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition: Assembly.h:2586
std::vector< ADReal > _ad_detady_map
Definition: Assembly.h:2800
void jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
Sets whether or not lower Jacobian coupling between ivar and jvar is used to the value used...
Definition: Assembly.h:2235
MooseVariableFE< Real > MooseVariable
Definition: Assembly.h:58
const VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1349
VectorVariablePhiGradient _vector_grad_phi_neighbor
Definition: Assembly.h:2693
const MooseArray< Point > & qPointsFaceNeighbor() const
Returns the reference to the current quadrature points being used on the neighbor face...
Definition: Assembly.h:500
std::vector< ADReal > _ad_dzetadz_map
Definition: Assembly.h:2804
std::vector< std::unique_ptr< FEBase > > _unique_fe_neighbor_helper
Definition: Assembly.h:2332
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kll
dlower/dlower
Definition: Assembly.h:2649
VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1516
VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1466
bool _user_added_fe_face_neighbor_of_helper_type
Definition: Assembly.h:2323
void setResidualNeighbor(NumericVector< Number > &residual, GlobalDataKey, const VectorTag &vector_tag)
Sets local neighbor residuals of all field variables to the global residual vector for a tag...
Definition: Assembly.C:3561
bool _have_p_refinement
Whether we have ever conducted p-refinement.
Definition: Assembly.h:2861
VariablePhiValue _phi
Definition: Assembly.h:2707
Real _current_neighbor_volume
Volume of the current neighbor.
Definition: Assembly.h:2580
void resize(const unsigned int n)
void jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
Sets whether or not nonlocal Jacobian coupling between ivar and jvar is used to the value used...
Definition: Assembly.h:2253
ArbitraryQuadrature * qruleArbitraryFace(const Elem *elem, unsigned int side)
Definition: Assembly.C:1921
std::map< FEType, FEBase * > _current_fe_face
The "face" fe object that matches the current elem.
Definition: Assembly.h:2344
VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1458
const VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1345
std::vector< Point > _current_neighbor_ref_points
The current reference points on the neighbor element.
Definition: Assembly.h:2864
void coordTransformFactor(const SubProblem &s, SubdomainID sub_id, const P &point, C &factor, SubdomainID neighbor_sub_id=libMesh::Elem::invalid_subdomain_id)
Computes a conversion multiplier for use when computing integraals for the current coordinate system ...
Definition: Assembly.C:41
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kln
dlower/dprimary (or dlower/dneighbor)
Definition: Assembly.h:2653
MooseVariableFE< RealVectorValue > VectorMooseVariable
Definition: Assembly.h:60
void setVolumeQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for volume integration.
Definition: Assembly.C:655
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition: Assembly.h:2570
void addJacobianNonlocal(GlobalDataKey)
Adds non-local Jacobian to the global Jacobian matrices.
Definition: Assembly.C:3885
VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1520
VariablePhiValue & phiFace(const MooseVariableField< Real > &)
Definition: Assembly.h:1429
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
Definition: Assembly.h:2621
const OutputTools< OutputType >::VariablePhiValue & feDualPhiLower(FEType type) const
Definition: Assembly.h:2877
MooseMesh & _mesh
Definition: Assembly.h:2312
const VariablePhiValue & phi() const
Definition: Assembly.h:1280
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_neighbor
Definition: Assembly.h:2727
std::map< unsigned int, FEBase * > _holder_fe_face_neighbor_helper
Definition: Assembly.h:2513
auto raw_value(const Eigen::Map< T > &in)
Definition: EigenADReal.h:73
const VariablePhiGradient & gradPhi() const
Definition: Assembly.h:1287
MooseArray< Real > _current_JxW_face
The current transformed jacobian weights on a face.
Definition: Assembly.h:2488
void modifyWeightsDueToXFEM(const Elem *elem)
Update the integration weights for XFEM partial elements.
Definition: Assembly.C:4533
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:2660
const Elem * _current_elem
The current "element" we are currently on.
Definition: Assembly.h:2556
VectorVariablePhiCurl _vector_curl_phi_neighbor
Definition: Assembly.h:2695
VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1508
const VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1315
const FEBase *const & getFEFace(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current "face" FE.
Definition: Assembly.h:148
const MooseArray< Moose::GenericType< Point, is_ad > > & genericQPoints() const
const libMesh::QBase *const & qRuleMortar() const
Returns a reference to the quadrature rule for the mortar segments.
Definition: Assembly.h:673
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:2310
void reinitFEFaceNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition: Assembly.C:1571
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:159
VectorVariablePhiGradient _vector_grad_phi
Definition: Assembly.h:2681
void reinitNeighborAtPhysical(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points)
Reinitializes the neighbor at the physical coordinates on neighbor side given.
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_helper
Definition: Assembly.h:2330
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_nonlocal_used
Definition: Assembly.h:2302
std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > _cm_sf_entry
Entries in the coupling matrix for scalar variables vs field variables.
Definition: Assembly.h:2295
VectorVariablePhiValue _vector_phi_neighbor
Definition: Assembly.h:2692
void prepareNeighbor()
Definition: Assembly.C:2799
void resizeADMappingObjects(unsigned int n_qp, unsigned int dim)
resize any objects that contribute to automatic differentiation-related mapping calculations ...
Definition: Assembly.C:971
OutputTools< Real >::VariablePhiValue VariablePhiValue
Definition: MooseTypes.h:320
char jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
Return a flag to indicate if a particular coupling lower Jacobian block between ivar and jvar is used...
Definition: Assembly.h:2244
unsigned int m() const
VariablePhiValue & phi(const MooseVariableField< Real > &)
Definition: Assembly.h:1425
void setCoordinateTransformation(const libMesh::QBase *qrule, const Points &q_points, Coords &coord, SubdomainID sub_id)
Definition: Assembly.C:1729
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face_neighbor
Definition: Assembly.h:2509
const VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1320
std::vector< bool > _component_block_diagonal
An flag array Indiced by variable index to show if there is no component-wise coupling for the variab...
Definition: Assembly.h:2778
Real _current_elem_volume
Volume of the current element.
Definition: Assembly.h:2562
OutputTools< RealVectorValue >::VariablePhiGradient VectorVariablePhiGradient
Definition: MooseTypes.h:338
std::map< FEType, FEBase * > _current_fe_face_neighbor
The "neighbor face" fe object that matches the current elem.
Definition: Assembly.h:2348
const MooseArray< ADReal > & adCurvatures() const
Definition: Assembly.C:4813
This class provides an interface for common operations on field variables of both FE and FV types wit...
const MooseArray< Point > & qPoints() const
Returns the reference to the quadrature points.
Definition: Assembly.h:230
std::map< FEType, FEVectorBase * > _current_vector_fe_face
The "face" vector fe object that matches the current elem.
Definition: Assembly.h:2353
std::vector< std::unique_ptr< FEBase > > _unique_fe_helper
Containers for holding unique FE helper types if we are doing p-refinement.
Definition: Assembly.h:2329
void processLocalResidual(DenseVector< Number > &res_block, std::vector< dof_id_type > &dof_indices, const std::vector< Real > &scaling_factor, bool is_nodal)
Appling scaling, constraints to the local residual block and populate the full DoF indices for array ...
Definition: Assembly.C:3213
const FEType _helper_type
The finite element type of the FE helper classes.
Definition: Assembly.h:2318
const Elem *const & msmElem() const
Definition: Assembly.h:1916
void addResidualLower(GlobalDataKey, const std::vector< VectorTag > &vector_tags)
Add local neighbor residuals of all field variables for a set of tags onto the global residual vector...
Definition: Assembly.C:3372
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
Get local Jacobian block for a pair of variables and a tag.
Definition: Assembly.h:1103
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
void addJacobianScalar(GlobalDataKey)
Add Jacobians for pairs of scalar variables into the global Jacobian matrices.
Definition: Assembly.C:4455
const bool & _computing_residual_and_jacobian
Whether we are currently computing the residual and Jacobian.
Definition: Assembly.h:2288
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knn
jacobian contributions from the neighbor <Tag, ivar, jvar>
Definition: Assembly.h:2647
void saveLocalArrayResidual(DenseVector< Number > &re, unsigned int i, unsigned int ntest, const RealEigenVector &v) const
Helper function for assembling residual contriubutions on local quadrature points for an array kernel...
Definition: Assembly.h:1777
const ADTemplateVariablePhiGradient< T > & adGradPhi(const MooseVariableFE< T > &v) const
Definition: Assembly.h:1282
Base class for a system (of equations)
Definition: SystemBase.h:84
const std::vector< Eigen::Map< RealDIMValue > > & mappedNormals() const
Definition: Assembly.h:323
libMesh::QBase * _current_qrule_face
quadrature rule used on faces
Definition: Assembly.h:2482
const VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1307
FEGenericBase< RealGradient > FEVectorBase
VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1524
unsigned int numExtraElemIntegers() const
Number of extra element integers Assembly tracked.
Definition: Assembly.h:334
static const T *const & constify_ref(T *const &inref)
Workaround for C++ compilers thinking they can&#39;t just cast a const-reference-to-pointer to const-refe...
Definition: Assembly.h:112
std::set< FEType > _need_second_derivative_neighbor
Definition: Assembly.h:2826
std::vector< std::vector< Real > > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition: Assembly.h:2766
char jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
Return a flag to indicate if a particular coupling Jacobian block between ivar and jvar is used...
Definition: Assembly.h:2208
VariablePhiValue _phi
Definition: Assembly.h:2663
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1686
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_ff_entry
Entries in the coupling matrix for field variables.
Definition: Assembly.h:2291
void addJacobianNeighborLowerD(GlobalDataKey)
Add all portions of the Jacobian except PrimaryPrimary, e.g.
Definition: Assembly.C:3945
const MooseArray< Real > & mortarCoordTransformation() const
Returns the reference to the coordinate transformation coefficients on the mortar segment mesh...
Definition: Assembly.h:266
std::map< FEType, FEVectorBase * > _current_vector_fe
The "volume" vector fe object that matches the current elem.
Definition: Assembly.h:2351
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1556
VariablePhiGradient _grad_phi
Definition: Assembly.h:2708
std::vector< VectorValue< ADReal > > _ad_dxyzdeta_map
Definition: Assembly.h:2788
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1438
void prepareScalar()
Definition: Assembly.C:2945
DenseVector< Real > getJacobianDiagonal(DenseMatrix< Number > &ke)
Definition: Assembly.h:1847
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const dof_id_type & extraElemID(unsigned int id) const
Returns an integer ID of the current element given the index associated with the integer.
Definition: Assembly.h:339
void modifyFaceWeightsDueToXFEM(const Elem *elem, unsigned int side=0)
Update the face integration weights for XFEM partial elements.
Definition: Assembly.C:4553
void reinitElemAndNeighbor(const Elem *elem, unsigned int side, const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > *neighbor_reference_points=nullptr)
Reinitialize an element and its neighbor along a particular side.
Definition: Assembly.C:1992
const VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1385
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFace(FEType type) const
Definition: Assembly.h:1627
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1749
OutputTools< Real >::VariablePhiSecond VariablePhiSecond
Definition: MooseTypes.h:322
std::unique_ptr< libMesh::QBase > face
area/face (meshdim-1) quadrature rule
Definition: Assembly.h:2404
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:2626
unsigned int _mesh_dimension
Definition: Assembly.h:2314
std::vector< Eigen::Map< RealDIMValue > > _mapped_normals
Mapped normals.
Definition: Assembly.h:2492
VectorVariablePhiDivergence _vector_div_phi_face
Definition: Assembly.h:2690
VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1528
void cacheJacobian(GlobalDataKey)
Takes the values that are currently in _sub_Kee and appends them to the cached values.
Definition: Assembly.C:4060
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiNeighbor(FEType type) const
Definition: Assembly.h:1741
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
const NumericVector< Real > * _scaling_vector
The map from global index to variable scaling factor.
Definition: Assembly.h:2834
void assignDisplacements(std::vector< std::pair< unsigned int, unsigned short >> &&disp_numbers_and_directions)
Assign the displacement numbers and directions.
Definition: Assembly.h:3180
void addCachedResiduals(GlobalDataKey, const std::vector< VectorTag > &tags)
Pushes all cached residuals to the global residual vectors associated with each tag.
Definition: Assembly.C:3485
Data structure for tracking/grouping a set of quadrature rules for a particular dimensionality of mes...
Definition: Assembly.h:2390
unsigned int _max_cached_jacobians
Definition: Assembly.h:2772
DenseMatrix< Number > & jacobianBlockMortar(Moose::ConstraintJacobianType type, unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
Returns the jacobian block for the given mortar Jacobian type.
Definition: Assembly.C:3153
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Ken
jacobian contributions from the element and neighbor <Tag, ivar, jvar>
Definition: Assembly.h:2643
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_dual_lower
Definition: Assembly.h:2738
Nonlinear system to be solved.
VectorVariablePhiValue _vector_phi_face
Definition: Assembly.h:2686
std::vector< VectorValue< ADReal > > _ad_dxyzdzeta_map
Definition: Assembly.h:2789
const VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1362
std::vector< Point > _temp_reference_points
Temporary work data for reinitAtPhysical()
Definition: Assembly.h:2784
std::vector< std::pair< MooseVariableScalar *, MooseVariableScalar * > > _cm_ss_entry
Entries in the coupling matrix for scalar variables.
Definition: Assembly.h:2297
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kne
jacobian contributions from the neighbor and element <Tag, ivar, jvar>
Definition: Assembly.h:2645
const Elem * _current_neighbor_lower_d_elem
The current neighboring lower dimensional element.
Definition: Assembly.h:2593
OutputTools< RealVectorValue >::VariablePhiDivergence VectorVariablePhiDivergence
Definition: MooseTypes.h:341
unsigned int _current_neighbor_side
The current side of the selected neighboring element (valid only when working with sides) ...
Definition: Assembly.h:2574
void cacheResidualNodes(const DenseVector< Number > &res, const std::vector< dof_id_type > &dof_index, LocalDataKey, TagID tag)
Lets an external class cache residual at a set of nodes.
Definition: Assembly.C:3437
void init(const libMesh::CouplingMatrix *cm)
Initialize the Assembly object and set the CouplingMatrix for use throughout.
Definition: Assembly.C:2465
VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1504
void prepareLowerD()
Prepare the Jacobians and residuals for a lower dimensional element.
Definition: Assembly.C:2838
bool _user_added_fe_neighbor_of_helper_type
Definition: Assembly.h:2324
void buildFaceNeighborFE(FEType type) const
Build FEs for a neighbor face with a type.
Definition: Assembly.C:336
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face
Definition: Assembly.h:2734
void reinitLowerDElem(const Elem *elem, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr)
Reinitialize FE data for a lower dimenesional element with a given set of reference points...
Definition: Assembly.C:2288
void computeCurrentFaceVolume()
Definition: Assembly.C:1771
const VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1389
std::vector< std::vector< DenseVector< Number > > > _sub_Rl
residual contributions for each variable from the lower dimensional element
Definition: Assembly.h:2623
VariablePhiCurl _curl_phi
Definition: Assembly.h:2710
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:36
QRules & qrules(unsigned int dim)
Definition: Assembly.h:2450
static const subdomain_id_type invalid_subdomain_id
VectorVariablePhiGradient _vector_grad_phi_face_neighbor
Definition: Assembly.h:2699
std::unique_ptr< libMesh::QBase > vol
volume/elem (meshdim) quadrature rule
Definition: Assembly.h:2402
void prepareOffDiagScalar()
Definition: Assembly.C:2969
VectorVariablePhiSecond _second_phi
Definition: Assembly.h:2719
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFace(FEType type) const
Definition: Assembly.h:1733
bool needDual() const
Indicates whether dual shape functions are used (computation is now repeated on each element so expen...
Definition: Assembly.h:584
Implements a fake quadrature rule where you can specify the locations (in the reference domain) of th...
void addJacobianCoupledVarPair(const MooseVariableBase &ivar, const MooseVariableBase &jvar)
Adds element matrices for ivar rows and jvar columns to the global Jacobian matrices.
Definition: Assembly.C:3857
std::vector< ADReal > _ad_dzetadx_map
Definition: Assembly.h:2802
void addJacobianLowerD(GlobalDataKey)
Add portions of the Jacobian of LowerLower, LowerSecondary, and SecondaryLower for boundary condition...
Definition: Assembly.C:4023
char jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
Return a flag to indicate if a particular coupling nonlocal Jacobian block between ivar and jvar is u...
Definition: Assembly.h:2262
VectorVariablePhiGradient _grad_phi
Definition: Assembly.h:2718
MooseArray< ADReal > _ad_curvatures
Definition: Assembly.h:2810
void computeGradPhiAD(const Elem *elem, unsigned int n_qp, ADTemplateVariablePhiGradient< OutputType > &grad_phi, libMesh::FEGenericBase< OutputType > *fe)
compute gradient of phi possibly with derivative information with respect to nonlinear displacement v...
ArbitraryQuadrature * _current_qrule_arbitrary_face
The current arbitrary quadrature rule used on the element face.
Definition: Assembly.h:2376
const MooseArray< ADReal > & adCoordTransformation() const
Returns the reference to the AD version of the coordinate transformation coefficients.
Definition: Assembly.h:272
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1718
void modifyArbitraryWeights(const std::vector< Real > &weights)
Modify the weights when using the arbitrary quadrature rule.
Definition: Assembly.C:4580
FEBase * _current_fe_face_helper
helper object for transforming coordinates
Definition: Assembly.h:2480
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > _cm_fs_entry
Entries in the coupling matrix for field variables vs scalar variables.
Definition: Assembly.h:2293
const std::vector< Real > * _JxW_msm
A JxW for working on mortar segement elements.
Definition: Assembly.h:2539
std::vector< ADReal > _ad_dzetady_map
Definition: Assembly.h:2803
dof_id_type numeric_index_type
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data
Definition: Assembly.h:2740
std::unordered_map< SubdomainID, std::vector< QRules > > _qrules
Holds quadrature rules for each dimension.
Definition: Assembly.h:2419
const MooseArray< Point > & normals() const
Returns the array of normals for quadrature points on a current side.
Definition: Assembly.h:318
MooseVariableFE< RealEigenVector > ArrayMooseVariable
Definition: Assembly.h:61
const VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1337
void prepareResidual()
Sizes and zeroes the residual for the current element.
Definition: Assembly.C:2704
VectorVariablePhiCurl _curl_phi
Definition: Assembly.h:2720
std::map< FEType, FEBase * > _current_fe_neighbor
The "neighbor" fe object that matches the current elem.
Definition: Assembly.h:2346
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhi(FEType type) const
Definition: Assembly.h:1593
Real elementVolume(const Elem *elem) const
On-demand computation of volume element accounting for RZ/RSpherical.
Definition: Assembly.C:3782
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1451
void cacheJacobianNeighbor(GlobalDataKey)
Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached val...
Definition: Assembly.C:4112
SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition: Assembly.h:2572
VectorVariablePhiValue _vector_phi_face_neighbor
Definition: Assembly.h:2698
VariablePhiSecond & secondPhi(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1540
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1443
const VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1366
std::vector< std::vector< DenseVector< Number > > > _sub_Re
Definition: Assembly.h:2620
VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1483
OutputTools< RealVectorValue >::VariablePhiSecond VectorVariablePhiSecond
Definition: MooseTypes.h:339
boundary_id_type BoundaryID
void reinitNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Reinitializes the neighbor side using reference coordinates.
Definition: Assembly.C:1685
A NodeFaceConstraint is used when you need to create constraints between two surfaces in a mesh...
const MooseArray< Real > & coordTransformation() const
Returns the reference to the coordinate transformation coefficients.
Definition: Assembly.h:260
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiNeighbor(FEType type) const
Definition: Assembly.h:1710
std::vector< ADReal > _ad_dxidz_map
Definition: Assembly.h:2798
const Real & lowerDElemVolume() const
Definition: Assembly.h:3166
VectorVariablePhiDivergence _vector_div_phi_neighbor
Definition: Assembly.h:2696
QRules & qrules(unsigned int dim, SubdomainID block)
This is a helper function for accessing quadrature rules for a particular dimensionality of element...
Definition: Assembly.h:2455
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:2301
void prepare()
Definition: Assembly.C:2713
void cacheJacobianWithoutConstraints(const Residuals &residuals, const Indices &row_indices, Real scaling_factor, LocalDataKey, const std::set< TagID > &matrix_tags)
Process the derivatives() data of a vector of ADReals.
Definition: Assembly.h:3138
VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &)
Definition: Assembly.h:1430
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
libMesh::QBase * _current_qrule_lower
quadrature rule used on lower dimensional elements.
Definition: Assembly.h:2552
SubProblem & _subproblem
Definition: Assembly.h:2273
const VariablePhiGradient & gradPhi(const MooseVariableField< Real > &) const
Definition: Assembly.h:1288
std::vector< ADReal > _ad_detadx_map
Definition: Assembly.h:2799
void buildFaceFE(FEType type) const
Build FEs for a face with a type.
Definition: Assembly.C:292
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition: Assembly.h:2506
DenseVector< Number > & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
Get residual block for lower.
Definition: Assembly.h:1094
void cacheResidual(GlobalDataKey, const std::vector< VectorTag > &tags)
Takes the values that are currently in _sub_Re of all field variables and appends them to the cached ...
Definition: Assembly.C:3404
bool _calculate_xyz
Definition: Assembly.h:2817
void addJacobianBlockNonlocalTags(libMesh::SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const libMesh::DofMap &dof_map, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, GlobalDataKey, const std::set< TagID > &tags)
Adds non-local element matrix for ivar rows and jvar columns to the global Jacobian matrix...
Definition: Assembly.C:4356
MooseArray< std::vector< Point > > _current_tangents
The current tangent vectors at the quadrature points.
Definition: Assembly.h:2494
bool _calculate_curvatures
Definition: Assembly.h:2819
VariablePhiGradient _grad_phi_face_neighbor
Definition: Assembly.h:2676
const std::vector< VectorTag > & _residual_vector_tags
The residual vector tags that Assembly could possibly contribute to.
Definition: Assembly.h:2755
std::map< FEType, FEVectorBase * > _current_vector_fe_face_neighbor
The "neighbor face" vector fe object that matches the current elem.
Definition: Assembly.h:2357
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFace(FEType type) const
Definition: Assembly.h:1702
std::vector< dof_id_type > _neighbor_extra_elem_ids
Extra element IDs of neighbor.
Definition: Assembly.h:2499
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition: Assembly.h:2380
std::vector< VectorValue< ADReal > > _ad_dxyzdxi_map
AD quantities.
Definition: Assembly.h:2787
std::vector< std::pair< unsigned int, unsigned short > > _disp_numbers_and_directions
Container of displacement numbers and directions.
Definition: Assembly.h:2815
VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1470
std::vector< dof_id_type > _temp_dof_indices
Temporary work vector to keep from reallocating it.
Definition: Assembly.h:2781
std::set< FEType > _need_neighbor_div
Definition: Assembly.h:2830
OutputTools< Real >::VariablePhiCurl VariablePhiCurl
Definition: MooseTypes.h:323
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kee
Definition: Assembly.h:2639
std::vector< VectorValue< ADReal > > _ad_d2xyzdxi2_map
Definition: Assembly.h:2790
std::vector< ADReal > _ad_jac
Definition: Assembly.h:2793
std::set< FEType > _need_curl
Definition: Assembly.h:2827
void addJacobianBlockNonlocal(libMesh::SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const libMesh::DofMap &dof_map, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, GlobalDataKey, TagID tag)
Adds non-local element matrix for ivar rows and jvar columns to the global Jacobian matrix...
Definition: Assembly.C:4298
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_lower
Definition: Assembly.h:2737
VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1496
const VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &) const
Definition: Assembly.h:1302
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data
Definition: Assembly.h:2741
VariablePhiGradient _grad_phi_neighbor
Definition: Assembly.h:2672
ArbitraryQuadrature * _current_qface_arbitrary
The current arbitrary quadrature rule used on element faces.
Definition: Assembly.h:2484
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face
types of vector finite elements
Definition: Assembly.h:2476
VariablePhiValue _phi_face
Definition: Assembly.h:2667
VectorVariablePhiSecond _vector_second_phi
Definition: Assembly.h:2682
libMesh::QBase * _current_qrule_volume
The current volumetric quadrature for the element.
Definition: Assembly.h:2372
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries() const
Definition: Assembly.h:1259
const OutputTools< OutputType >::VariablePhiGradient & feGradPhi(FEType type) const
Definition: Assembly.h:1586
const Elem * _msm_elem
Definition: Assembly.h:2843
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealEigenMatrix
Definition: MooseTypes.h:149
libMesh::QBase * qruleFace(const Elem *elem, unsigned int side)
This is an abstraction over the internal qrules function.
Definition: Assembly.C:1915
bool _calculate_ad_coord
Whether to calculate coord with AD.
Definition: Assembly.h:2823
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_lower
Definition: Assembly.h:2729
const Elem * _current_lower_d_elem
The current lower dimensional element.
Definition: Assembly.h:2591
GlobalDataKey(const GlobalDataKey &)
Definition: Assembly.h:815
void addResidualBlock(NumericVector< Number > &residual, DenseVector< Number > &res_block, const std::vector< dof_id_type > &dof_indices, const std::vector< Real > &scaling_factor, bool is_nodal)
Add a local residual block to a global residual vector with proper scaling.
Definition: Assembly.C:3249
void addResidual(GlobalDataKey, const std::vector< VectorTag > &vector_tags)
Add local residuals of all field variables for a set of tags onto the global residual vectors associa...
Definition: Assembly.C:3322
const VariablePhiValue & phiFace() const
Definition: Assembly.h:1295
std::set< FEType > _need_second_derivative
Definition: Assembly.h:2825
bool computingResidualAndJacobian() const
Definition: Assembly.h:1911
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_lower
FE objects for lower dimensional elements.
Definition: Assembly.h:2516
const VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1414
std::set< FEType > _need_face_neighbor_div
Definition: Assembly.h:2831
FEGenericBase< Real > FEBase
libMesh::QBase * _qrule_msm
A qrule object for working on mortar segement elements.
Definition: Assembly.h:2546
void cacheResiduals(const Residuals &residuals, const Indices &row_indices, Real scaling_factor, LocalDataKey, const std::set< TagID > &vector_tags)
Process the supplied residual values.
Definition: Assembly.h:3018
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiLower(FEType type) const
Definition: Assembly.h:2885
VariablePhiValue _phi_face_neighbor
Definition: Assembly.h:2675
libMesh::ElemSideBuilder _current_neighbor_side_elem_builder
In place side element builder for _current_neighbor_side_elem.
Definition: Assembly.h:2839
OutputTools< Real >::VariablePhiDivergence VariablePhiDivergence
Definition: MooseTypes.h:324
const Moose::CoordinateSystemType & coordSystem() const
Get the coordinate system type.
Definition: Assembly.h:288
Real _current_lower_d_elem_volume
The current lower dimensional element volume.
Definition: Assembly.h:2597
const OutputTools< OutputType >::VariablePhiValue & fePhiNeighbor(FEType type) const
Definition: Assembly.h:1648
libMesh::QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition: Assembly.h:2370
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension&#39;s actual fe objects indexed on type.
Definition: Assembly.h:2362
const VariablePhiSecond & secondPhi(const MooseVariableField< Real > &) const
Definition: Assembly.h:1290
VariablePhiValue _phi_neighbor
Definition: Assembly.h:2671
const Node *const & nodeNeighbor() const
Returns the reference to the neighboring node.
Definition: Assembly.h:512
const MooseArray< Real > & JxW() const
Returns the reference to the transformed jacobian weights.
Definition: Assembly.h:248
void reinitMortarElem(const Elem *elem)
reinitialize a mortar segment mesh element in order to get a proper JxW
Definition: Assembly.C:2402
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1678
Real _current_side_volume
Volume of the current side element.
Definition: Assembly.h:2568
std::set< FEType > _need_div
Definition: Assembly.h:2828
VectorVariablePhiCurl _vector_curl_phi
Definition: Assembly.h:2683
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:2758
const bool _displaced
Definition: Assembly.h:2275
void buildVectorFE(FEType type) const
Build Vector FEs with a type.
Definition: Assembly.C:453
VectorVariablePhiCurl _vector_curl_phi_face_neighbor
Definition: Assembly.h:2701
void addJacobianNeighborTags(libMesh::SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const libMesh::DofMap &dof_map, std::vector< dof_id_type > &dof_indices, std::vector< dof_id_type > &neighbor_dof_indices, GlobalDataKey, const std::set< TagID > &tags)
Adds three neighboring element matrices for ivar rows and jvar columns to the global Jacobian matrix...
Definition: Assembly.C:4440
void reinitFVFace(const FaceInfo &fi)
Definition: Assembly.C:1855
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_lower
Vector FE objects for lower dimensional elements.
Definition: Assembly.h:2518
const MooseArray< Real > & JxWFace() const
Returns the reference to the transformed jacobian weights on a current face.
Definition: Assembly.h:312
const MooseArray< Real > & JxWNeighbor() const
Returns the reference to the transformed jacobian weights on a current face.
Definition: Assembly.C:259
const Node * _current_node
The current node we are working with.
Definition: Assembly.h:2582
bool _building_helpers
Whether we are currently building the FE classes for the helpers.
Definition: Assembly.h:2336
bool _calculate_face_xyz
Definition: Assembly.h:2818
This is the XFEMInterface class.
Definition: XFEMInterface.h:37
DGJacobianType
Definition: MooseTypes.h:750
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
Definition: MooseTypes.h:321
std::vector< ADReal > _ad_dxidx_map
Definition: Assembly.h:2796
std::vector< ADReal > _ad_dxidy_map
Definition: Assembly.h:2797
std::vector< VectorValue< ADReal > > _ad_d2xyzdxideta_map
Definition: Assembly.h:2791
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face_neighbor
Definition: Assembly.h:2736
void addJacobian(GlobalDataKey)
Adds all local Jacobian to the global Jacobian matrices.
Definition: Assembly.C:3872
MooseArray< Point > _current_normals
The current Normal vectors at the quadrature points.
Definition: Assembly.h:2490
void buildVectorFaceFE(FEType type) const
Build Vector FEs for a face with a type.
Definition: Assembly.C:484
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.C:19
void havePRefinement(const std::unordered_set< FEFamily > &disable_p_refinement_for_families)
Indicate that we have p-refinement.
Definition: Assembly.C:4859
void setCurrentSubdomainID(SubdomainID i)
set the current subdomain ID
Definition: Assembly.h:385
const std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > & scalarFieldCouplingEntries() const
Definition: Assembly.h:1274
const MooseArray< ADReal > & adJxWFace() const
Definition: Assembly.h:252
MooseArray< VectorValue< ADReal > > _ad_q_points
Definition: Assembly.h:2795
const VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1311
VectorVariablePhiGradient _vector_grad_phi_face
Definition: Assembly.h:2687
MooseArray< VectorValue< ADReal > > _ad_q_points_face
Definition: Assembly.h:2808
VariablePhiValue & phiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1552
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const libMesh::CouplingMatrix * _cm
Coupling matrices.
Definition: Assembly.h:2278
const VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1370
const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase &fe)
Attaches the current elem/volume quadrature rule to the given fe.
Definition: Assembly.h:1863
void hasScalingVector()
signals this object that a vector containing variable scaling factors should be used when doing resid...
Definition: Assembly.C:4574
void addJacobianBlock(libMesh::SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const libMesh::DofMap &dof_map, std::vector< dof_id_type > &dof_indices, GlobalDataKey, TagID tag)
Adds element matrix for ivar rows and jvar columns to the global Jacobian matrix. ...
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
const VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1419
VariablePhiGradient & gradPhi(const MooseVariableField< Real > &)
Definition: Assembly.h:1426
OutputTools< RealVectorValue >::VariablePhiValue VectorVariablePhiValue
Definition: MooseTypes.h:337
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhi(FEType type) const
Definition: Assembly.h:1726
std::unique_ptr< libMesh::QBase > fv_face
finite volume face/flux quadrature rule (meshdim-1)
Definition: Assembly.h:2406
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_dual_lower
Definition: Assembly.h:2730
void zeroCachedJacobian(GlobalDataKey)
Zero out previously-cached Jacobian rows.
Definition: Assembly.C:4512
CoordinateSystemType
Definition: MooseTypes.h:810
const VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1380
void reinitNeighborFaceRef(const Elem *neighbor_elem, unsigned int neighbor_side, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr)
Reinitialize FE data for the given neighbor_element on the given side with a given set of reference p...
Definition: Assembly.C:2192
void constrain_element_vector(DenseVector< Number > &rhs, std::vector< dof_id_type > &dofs, bool asymmetric_constraint_rows=true) const
void setNeighborQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for neighbor integration.
Definition: Assembly.C:709
bool computingResidual() const
Definition: Assembly.h:1901
void activateDual()
Indicates that dual shape functions are used for mortar constraint.
Definition: Assembly.h:578
void prepareVariableNonlocal(MooseVariableFieldBase *var)
Definition: Assembly.C:2772
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face
Definition: Assembly.h:2726
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data
Shape function values, gradients, second derivatives for each vector FE type.
Definition: Assembly.h:2733
const VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &) const
Definition: Assembly.h:1298
void addResidualScalar(GlobalDataKey, const std::vector< VectorTag > &vector_tags)
Add residuals of all scalar variables for a set of tags onto the global residual vectors associated w...
Definition: Assembly.C:3396
MooseArray< Real > _coord_msm
The coordinate transformation coefficients evaluated on the quadrature points of the mortar segment m...
Definition: Assembly.h:2534
DenseVector< Number > & residualBlockNeighbor(unsigned int var_num, LocalDataKey, TagID tag_id)
Get local neighbor residual block for a variable and a tag.
Definition: Assembly.h:1085
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Keg
Definition: Assembly.h:2640
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1565
bool _need_lower_d_elem_volume
Whether we need to compute the lower dimensional element volume.
Definition: Assembly.h:2595
LocalDataKey(const LocalDataKey &)
Definition: Assembly.h:829
bool _user_added_fe_face_of_helper_type
Definition: Assembly.h:2322
const MooseArray< Point > & qPointsFace() const
Returns the reference to the current quadrature being used.
Definition: Assembly.h:306
DenseVector< Number > & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
Get local residual block for a variable and a tag.
Definition: Assembly.h:1076
VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1457
void buildVectorNeighborFE(FEType type) const
Build Vector FEs for a neighbor with a type.
Definition: Assembly.C:514
std::unique_ptr< ArbitraryQuadrature > arbitrary_vol
volume/elem (meshdim) custom points quadrature rule
Definition: Assembly.h:2408
void reinitFENeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition: Assembly.C:1630
const VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1354
void initNonlocalCoupling()
Create pair of variables requiring nonlocal jacobian contributions.
Definition: Assembly.C:2647
ConstraintJacobianType
Definition: MooseTypes.h:797
const VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1404
std::map< unsigned int, FEBase * > _holder_fe_face_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2478
const bool & _computing_jacobian
Whether we are currently computing the Jacobian.
Definition: Assembly.h:2285
void computeCurrentNeighborVolume()
VariablePhiSecond & secondPhiFace(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1547
const Elem *const & neighbor() const
Return the neighbor element.
Definition: Assembly.h:431
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_neighbor
Definition: Assembly.h:2508
char jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
Return a flag to indicate if a particular coupling neighbor Jacobian block between ivar and jvar is u...
Definition: Assembly.h:2226
void resize(const unsigned int new_m, const unsigned int new_n)
const OutputTools< OutputType >::VariablePhiValue & fePhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1670
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1447
void cacheJacobianNonlocal(GlobalDataKey)
Takes the values that are currently in _sub_Keg and appends them to the cached values.
Definition: Assembly.C:4090
Class for scalar variables (they are different).
IntRange< T > make_range(T beg, T end)
const VariablePhiValue & phiFace(const MooseVariableField< Real > &) const
Definition: Assembly.h:1296
VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1433
VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1512
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_neighbor_helper
Definition: Assembly.h:2331
void computeSinglePointMapAD(const Elem *elem, const std::vector< Real > &qw, unsigned p, FEBase *fe)
compute the finite element reference-physical mapping quantities (such as JxW) with possible dependen...
Definition: Assembly.C:1001
void helpersRequestData()
request phi, dphi, xyz, JxW, etc.
Definition: Assembly.C:4826
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_nonlocal_entry
Entries in the coupling matrix for field variables for nonlocal calculations.
Definition: Assembly.h:2299
void addJacobianOffDiagScalar(unsigned int ivar, GlobalDataKey)
Add Jacobians for a scalar variables with all other field variables into the global Jacobian matrices...
Definition: Assembly.C:4462
std::vector< dof_id_type > _row_indices
Working vectors to avoid repeated heap allocations when caching residuals/Jacobians that must have li...
Definition: Assembly.h:2858
VectorVariablePhiSecond _vector_second_phi_face_neighbor
Definition: Assembly.h:2700
void buildLowerDFE(FEType type) const
Build FEs for a lower dimensional element with a type.
Definition: Assembly.C:358
unsigned int _current_side
The current side of the selected element (valid only when working with sides)
Definition: Assembly.h:2564
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
Definition: Assembly.h:218
const VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1409
void setCachedJacobian(GlobalDataKey)
Sets previously-cached Jacobian values via SparseMatrix::set() calls.
Definition: Assembly.C:4492
VariablePhiSecond _second_phi
Definition: Assembly.h:2709
std::map< unsigned int, FEBase * > _holder_fe_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2366
const libMesh::CouplingMatrix & _nonlocal_cm
Definition: Assembly.h:2279
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiNeighbor(FEType type) const
Definition: Assembly.h:1662
const FEVectorBase *const & getVectorFEFaceNeighbor(FEType type, unsigned int dim) const
GetVector a reference to a pointer that will contain the current "neighbor" FE.
Definition: Assembly.h:208
BoundaryID _current_boundary_id
The current boundary ID.
Definition: Assembly.h:2560
const OutputTools< OutputType >::VariablePhiGradient & feGradDualPhiLower(FEType type) const
Definition: Assembly.h:2893
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFace(FEType type) const
Definition: Assembly.h:1640
void prepareVariable(MooseVariableFieldBase *var)
Used for preparing the dense residual and jacobian blocks for one particular variable.
Definition: Assembly.C:2744
const Elem * _current_neighbor_side_elem
The current side element of the ncurrent neighbor element.
Definition: Assembly.h:2576
DenseMatrix< Number > _element_matrix
A working matrix to avoid repeated heap allocations when caching Jacobians that must have libMesh-lev...
Definition: Assembly.h:2853
void reinitElemFaceRef(const Elem *elem, unsigned int elem_side, Real tolerance, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr)
Reinitialize FE data for the given element on the given side, optionally with a given set of referenc...
Definition: Assembly.C:2017
void copyFaceShapes(MooseVariableField< T > &v)
Definition: Assembly.C:3032
std::vector< dof_id_type > _extra_elem_ids
Extra element IDs.
Definition: Assembly.h:2497
const libMesh::QBase *const & qRuleNeighbor() const
Returns the reference to the current quadrature being used on a current neighbor. ...
Definition: Assembly.h:479
void clearCachedQRules()
Set the cached quadrature rules to nullptr.
Definition: Assembly.C:726
void addJacobianBlockTags(libMesh::SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const libMesh::DofMap &dof_map, std::vector< dof_id_type > &dof_indices, GlobalDataKey, const std::set< TagID > &tags)
Add element matrix for ivar rows and jvar columns to the global Jacobian matrix for given tags...
Definition: Assembly.C:4230
void addResidualNeighbor(GlobalDataKey, const std::vector< VectorTag > &vector_tags)
Add local neighbor residuals of all field variables for a set of tags onto the global residual vector...
Definition: Assembly.C:3347
bool _current_side_volume_computed
Boolean to indicate whether current element side volumes has been computed.
Definition: Assembly.h:2588
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data_face
Definition: Assembly.h:2744
std::vector< dof_id_type > _column_indices
Definition: Assembly.h:2858
void jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
Sets whether or not neighbor Jacobian coupling between ivar and jvar is used to the value used...
Definition: Assembly.h:2217
std::unique_ptr< ArbitraryQuadrature > arbitrary_face
area/face (meshdim-1) custom points quadrature rule
Definition: Assembly.h:2410
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:146
const VariablePhiValue & phi(const MooseVariableField< Real > &) const
Definition: Assembly.h:1286
const std::vector< Point > & qPointsMortar() const
Returns the reference to the mortar segment element quadrature points.
Definition: Assembly.h:236
const SubdomainID & currentSubdomainID() const
Return the current subdomain ID.
Definition: Assembly.h:380
const Real & elemVolume() const
Returns the reference to the current element volume.
Definition: Assembly.h:401
void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector< dof_id_type > &dof_indices)
Definition: Assembly.C:2894
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
Definition: Assembly.h:2507
void addJacobianNeighbor(GlobalDataKey)
Add ElementNeighbor, NeighborElement, and NeighborNeighbor portions of the Jacobian for compute objec...
Definition: Assembly.C:3907
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_lower_used
Flag that indicates if the jacobian block for the lower dimensional element was used.
Definition: Assembly.h:2306
VectorVariablePhiDivergence _div_phi
Definition: Assembly.h:2721
VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1491
OutputTools< RealVectorValue >::VariablePhiCurl VectorVariablePhiCurl
Definition: MooseTypes.h:340
void cacheJacobianBlock(DenseMatrix< Number > &jac_block, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, Real scaling_factor, LocalDataKey, TagID tag)
Cache a local Jacobian block with the provided rows (idof_indices) and columns (jdof_indices) for eve...
bool _custom_mortar_qrule
Flag specifying whether a custom quadrature rule has been specified for mortar segment mesh...
Definition: Assembly.h:2548
const unsigned int & side() const
Returns the current side.
Definition: Assembly.h:407
const FEBase *const & getFE(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current volume FE.
Definition: Assembly.h:124
void computeCurrentElemVolume()
Definition: Assembly.C:1752
void cacheJacobianBlockNonzero(DenseMatrix< Number > &jac_block, const MooseVariableBase &ivar, const MooseVariableBase &jvar, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, TagID tag)
Push non-zeros of a local Jacobian block with proper scaling into cache for a certain tag...
Definition: Assembly.C:3689
bool computingJacobian() const
Definition: Assembly.h:1906
Real _current_neighbor_lower_d_elem_volume
The current neighboring lower dimensional element volume.
Definition: Assembly.h:2601
bool _need_neighbor_lower_d_elem_volume
Whether we need to compute the neighboring lower dimensional element volume.
Definition: Assembly.h:2599
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition: Assembly.h:2378
bool _user_added_fe_of_helper_type
Whether user code requested a FEType the same as our _helper_type.
Definition: Assembly.h:2321
void setLowerQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for lower dimensional integration.
Definition: Assembly.C:690
Moose::CoordinateSystemType _coord_type
The coordinate system.
Definition: Assembly.h:2382
void cacheJacobianMortar(GlobalDataKey)
Cache all portions of the Jacobian, e.g.
Definition: Assembly.C:4150
std::unique_ptr< ArbitraryQuadrature > neighbor
area/face (meshdim-1) custom points quadrature rule for DG
Definition: Assembly.h:2412
unsigned int n() const
void buildVectorFaceNeighborFE(FEType type) const
Build Vector FEs for a neighbor face with a type.
Definition: Assembly.C:544
void buildVectorDualLowerDFE(FEType type) const
Definition: Assembly.C:428
void bumpVolumeQRuleOrder(Order volume_order, SubdomainID block)
Increases the element/volume quadrature order for the specified mesh block if and only if the current...
Definition: Assembly.C:575
const SubdomainID & currentNeighborSubdomainID() const
Return the current subdomain ID.
Definition: Assembly.h:458
VectorVariablePhiSecond _vector_second_phi_neighbor
Definition: Assembly.h:2694
void saveFullLocalArrayJacobian(DenseMatrix< Number > &ke, unsigned int i, unsigned int ntest, unsigned int j, unsigned int nphi, unsigned int ivar, unsigned int jvar, const RealEigenMatrix &v) const
Helper function for assembling full Jacobian contriubutions on local quadrature points for an array k...
Definition: Assembly.h:1821
Storage for all of the information pretaining to a vector tag.
Definition: VectorTag.h:17
VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1532
const Node *const & node() const
Returns the reference to the node.
Definition: Assembly.h:506
VariablePhiSecond _second_phi
Definition: Assembly.h:2665
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_neighbor_used
Flag that indicates if the jacobian block for neighbor was used.
Definition: Assembly.h:2304
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiNeighbor(FEType type) const
Definition: Assembly.h:1655
std::map< unsigned int, FEBase * > _holder_fe_lower_helper
helper object for transforming coordinates for lower dimensional element quadrature points ...
Definition: Assembly.h:2520
const libMesh::DofMap & _dof_map
DOF map.
Definition: Assembly.h:2308
VectorVariablePhiDivergence _vector_div_phi
Definition: Assembly.h:2684
void setCurrentNeighborSubdomainID(SubdomainID i)
set the current subdomain ID
Definition: Assembly.h:463
void computeADFace(const Elem &elem, const unsigned int side)
compute AD things on an element face
Definition: Assembly.C:2109
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_neighbor
Definition: Assembly.h:2735
void setResidual(NumericVector< Number > &residual, GlobalDataKey, const VectorTag &vector_tag)
Sets local residuals of all field variables to the global residual vector for a tag.
Definition: Assembly.C:3548
std::vector< std::vector< dof_id_type > > _cached_jacobian_cols
Column where the corresponding cached value should go.
Definition: Assembly.h:2770
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
Definition: Assembly.C:3815
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition: Assembly.h:2486
void cacheResidualBlock(std::vector< Real > &cached_residual_values, std::vector< dof_id_type > &cached_residual_rows, DenseVector< Number > &res_block, const std::vector< dof_id_type > &dof_indices, const std::vector< Real > &scaling_factor, bool is_nodal)
Push a local residual block with proper scaling into cache.
Definition: Assembly.C:3265
void prepareBlockNonlocal(unsigned int ivar, unsigned jvar, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices)
Definition: Assembly.C:2919
void bumpAllQRuleOrder(Order order, SubdomainID block)
Increases the element/volume and face/area quadrature orders for the specified mesh block if and only...
Definition: Assembly.C:598
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition: Assembly.h:437
const VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1328
const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase &fe)
Attaches the current face/area quadrature rule to the given fe.
Definition: Assembly.h:1875
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition: Assembly.h:2566
const MooseArray< std::vector< Point > > & tangents() const
Returns the array of tangents for quadrature points on a current side.
Definition: Assembly.h:329
bool _block_diagonal_matrix
Will be true if our preconditioning matrix is a block-diagonal matrix. Which means that we can take s...
Definition: Assembly.h:2775
const Elem *const & neighborLowerDElem() const
Return the neighboring lower dimensional element.
Definition: Assembly.h:443
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhi(FEType type) const
Definition: Assembly.h:1599
FEBase * _current_fe_helper
The current helper object for transforming coordinates.
Definition: Assembly.h:2368
bool _need_JxW_neighbor
Flag to indicate that JxW_neighbor is needed.
Definition: Assembly.h:2527
const VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1399
void copyNeighborShapes(MooseVariableField< T > &v)
Definition: Assembly.C:3069
void cacheJacobianCoupledVarPair(const MooseVariableBase &ivar, const MooseVariableBase &jvar)
Caches element matrix for ivar rows and jvar columns.
Definition: Assembly.C:4074
VectorVariablePhiSecond _vector_second_phi_face
Definition: Assembly.h:2688
const MooseArray< ADPoint > & adNormals() const
Definition: Assembly.h:354
VariablePhiGradient _grad_phi_face
Definition: Assembly.h:2668
MooseArray< Point > _current_q_points_face_neighbor
The current quadrature points on the neighbor face.
Definition: Assembly.h:2525
virtual void attach_quadrature_rule(QBase *q)=0
libMesh::ElemSideBuilder _current_side_elem_builder
In place side element builder for _current_side_elem.
Definition: Assembly.h:2837
const VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1358
VectorVariablePhiCurl _vector_curl_phi_face
Definition: Assembly.h:2689
bool _need_dual
Whether dual shape functions need to be computed for mortar constraints.
Definition: Assembly.h:2603
auto index_range(const T &sizable)
const std::vector< Real > & jxWMortar() const
Returns a reference to JxW for mortar segment elements.
Definition: Assembly.h:668
const FEVectorBase *const & getVectorFENeighbor(FEType type, unsigned int dim) const
GetVector a reference to a pointer that will contain the current &#39;neighbor&#39; FE.
Definition: Assembly.h:184
Key structure for APIs adding/caching local element residuals/Jacobians.
Definition: Assembly.h:823
const dof_id_type & extraElemIDNeighbor(unsigned int id) const
Returns an integer ID of the current element given the index associated with the integer.
Definition: Assembly.h:348
DenseVector< Number > _element_vector
A working vector to avoid repeated heap allocations when caching residuals that must have libMesh-lev...
Definition: Assembly.h:2848
std::set< FEType > _need_face_div
Definition: Assembly.h:2829
const Real & sideElemVolume() const
Returns the reference to the volume of current side element.
Definition: Assembly.h:425
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition: Assembly.h:2558
const Elem *& sideElem()
Returns the side element.
Definition: Assembly.h:419
VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1487
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1573
const FEBase *const & getFEFaceNeighbor(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current "neighbor" FE.
Definition: Assembly.h:160
std::map< unsigned int, const std::vector< Point > * > _holder_normals
Holds pointers to the dimension&#39;s normal vectors.
Definition: Assembly.h:2501
Base variable class.
std::map< FEType, FEVectorBase * > _current_vector_fe_neighbor
The "neighbor" vector fe object that matches the current elem.
Definition: Assembly.h:2355
void clearCachedResiduals(GlobalDataKey)
Clears all of the residuals in _cached_residual_rows and _cached_residual_values. ...
Definition: Assembly.C:3500
unsigned int THREAD_ID
Definition: MooseTypes.h:209
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition: Assembly.h:2584
std::vector< VectorValue< ADReal > > _ad_d2xyzdeta2_map
Definition: Assembly.h:2792
void cacheResidualsWithoutConstraints(const Residuals &residuals, const Indices &row_indices, Real scaling_factor, LocalDataKey, const std::set< TagID > &vector_tags)
Process the supplied residual values.
Definition: Assembly.h:3058
void clearCachedJacobian()
Clear any currently cached jacobians.
Definition: Assembly.C:4522
uint8_t dof_id_type
const BoundaryID & currentBoundaryID() const
Return the current boundary ID.
Definition: Assembly.h:390
VectorVariablePhiDivergence _vector_div_phi_face_neighbor
Definition: Assembly.h:2702
libMesh::QBase *const & writeableQRuleFace()
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:300
const VariablePhiGradient & gradPhiFace() const
Definition: Assembly.h:1297
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knl
dprimary/dlower (or dneighbor/dlower)
Definition: Assembly.h:2657
const OutputTools< OutputType >::VariablePhiValue & fePhiFace(FEType type) const
Definition: Assembly.h:1620
VariablePhiValue & phi(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1538
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1434
VariablePhiGradient & gradPhi(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1539
void reinitFEFace(const Elem *elem, unsigned int side)
Just an internal helper function to reinit the face FE objects.
Definition: Assembly.C:1267
MooseArray< ADReal > _ad_JxW
Definition: Assembly.h:2794
MooseArray< ADReal > _ad_JxW_face
Definition: Assembly.h:2806
void computeFaceMap(const Elem &elem, const unsigned int side, const std::vector< Real > &qw)
Definition: Assembly.C:1347
VariablePhiValue & phiFace(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1542
void reinitDual(const Elem *elem, const std::vector< Point > &pts, const std::vector< Real > &JxW)
Reintialize dual basis coefficients based on a customized quadrature rule.
Definition: Assembly.C:2270
void constrain_element_matrix(DenseMatrix< Number > &matrix, std::vector< dof_id_type > &elem_dofs, bool asymmetric_constraint_rows=true) const
Key structure for APIs manipulating global vectors/matrices.
Definition: Assembly.h:805