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 
595 
599  bool hasStaticCondensation() const { return _sc; }
600 
601 private:
608  void setLowerQRule(libMesh::QBase * qrule, unsigned int dim);
609 
610 public:
619  void setNeighborQRule(libMesh::QBase * qrule, unsigned int dim);
620 
626  void reinit(const Elem * elem);
627 
631  void setVolumeQRule(const Elem * elem);
632 
637  void reinitElemFaceRef(const Elem * elem,
638  unsigned int elem_side,
639  Real tolerance,
640  const std::vector<Point> * const pts = nullptr,
641  const std::vector<Real> * const weights = nullptr);
642 
647  void reinitNeighborFaceRef(const Elem * neighbor_elem,
648  unsigned int neighbor_side,
649  Real tolerance,
650  const std::vector<Point> * const pts,
651  const std::vector<Real> * const weights = nullptr);
652 
656  void reinitDual(const Elem * elem, const std::vector<Point> & pts, const std::vector<Real> & JxW);
657 
661  void reinitLowerDElem(const Elem * elem,
662  const std::vector<Point> * const pts = nullptr,
663  const std::vector<Real> * const weights = nullptr);
664 
668  void reinitNeighborLowerDElem(const Elem * elem);
669 
673  void reinitMortarElem(const Elem * elem);
674 
678  const std::vector<Real> & jxWMortar() const { return *_JxW_msm; }
679 
683  const libMesh::QBase * const & qRuleMortar() const { return constify_ref(_qrule_msm); }
684 
685 private:
689  void computeADFace(const Elem & elem, const unsigned int side);
690 
691 public:
695  void reinitAtPhysical(const Elem * elem, const std::vector<Point> & physical_points);
696 
700  void reinit(const Elem * elem, const std::vector<Point> & reference_points);
701 
705  void setFaceQRule(const Elem * const elem, const unsigned int side);
706 
710  void reinit(const Elem * elem, unsigned int side);
711 
715  void reinit(const Elem * elem, unsigned int side, const std::vector<Point> & reference_points);
716 
717  void reinitFVFace(const FaceInfo & fi);
718 
730  void reinitElemAndNeighbor(const Elem * elem,
731  unsigned int side,
732  const Elem * neighbor,
733  unsigned int neighbor_side,
734  const std::vector<Point> * neighbor_reference_points = nullptr);
735 
739  void reinitNeighborAtPhysical(const Elem * neighbor,
740  unsigned int neighbor_side,
741  const std::vector<Point> & physical_points);
742 
746  void reinitNeighborAtPhysical(const Elem * neighbor, const std::vector<Point> & physical_points);
747 
751  void reinitNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
752 
756  void reinit(const Node * node);
757 
761  void init(const libMesh::CouplingMatrix * cm);
762 
764  void initNonlocalCoupling();
765 
767  void prepareJacobianBlock();
768 
770  void prepareResidual();
771 
772  void prepare();
773  void prepareNonlocal();
774 
782  void prepareNeighbor();
783 
788  void prepareLowerD();
789 
790  void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector<dof_id_type> & dof_indices);
791  void prepareBlockNonlocal(unsigned int ivar,
792  unsigned jvar,
793  const std::vector<dof_id_type> & idof_indices,
794  const std::vector<dof_id_type> & jdof_indices);
795  void prepareScalar();
796  void prepareOffDiagScalar();
797 
798  template <typename T>
800  void copyShapes(unsigned int var);
801 
802  template <typename T>
804  void copyFaceShapes(unsigned int var);
805 
806  template <typename T>
808  void copyNeighborShapes(unsigned int var);
809 
816  {
817  // Blessed classes
818  friend class Assembly;
819  friend class SubProblem;
820  friend class FEProblemBase;
821  friend class DisplacedProblem;
822  friend class ComputeMortarFunctor;
823  friend class NonlinearSystemBase;
826  };
827 
834  {
835  // Blessed classes
836  friend class Assembly;
837  friend class TaggingInterface;
840  };
841 
846  void addResidual(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
851  void addResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
856  void addResidualLower(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
857 
862  void addResidualScalar(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
863 
868  void cacheResidual(GlobalDataKey, const std::vector<VectorTag> & tags);
869 
874  void cacheResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & tags);
875 
879  void cacheResidualLower(GlobalDataKey, const std::vector<VectorTag> & tags);
880 
886  void addCachedResiduals(GlobalDataKey, const std::vector<VectorTag> & tags);
887 
896  void clearCachedResiduals(GlobalDataKey);
897 
906  GlobalDataKey,
907  const VectorTag & vector_tag);
908 
912  void setResidual(NumericVector<Number> & residual, GlobalDataKey, const VectorTag & vector_tag);
913 
918  GlobalDataKey,
919  const VectorTag & vector_tag);
920 
924  void addJacobian(GlobalDataKey);
925 
929  void addJacobianNonlocal(GlobalDataKey);
930 
935  void addJacobianNeighbor(GlobalDataKey);
936 
940  void addJacobianScalar(GlobalDataKey);
941 
946  void addJacobianOffDiagScalar(unsigned int ivar, GlobalDataKey);
947 
952  unsigned int ivar,
953  unsigned int jvar,
954  const libMesh::DofMap & dof_map,
955  std::vector<dof_id_type> & dof_indices,
956  GlobalDataKey,
957  TagID tag);
958 
964  unsigned int ivar,
965  unsigned int jvar,
966  const libMesh::DofMap & dof_map,
967  std::vector<dof_id_type> & dof_indices,
968  GlobalDataKey,
969  const std::set<TagID> & tags);
970 
975  unsigned int ivar,
976  unsigned int jvar,
977  const libMesh::DofMap & dof_map,
978  const std::vector<dof_id_type> & idof_indices,
979  const std::vector<dof_id_type> & jdof_indices,
980  GlobalDataKey,
981  TagID tag);
982 
987  unsigned int ivar,
988  unsigned int jvar,
989  const libMesh::DofMap & dof_map,
990  const std::vector<dof_id_type> & idof_indices,
991  const std::vector<dof_id_type> & jdof_indices,
992  GlobalDataKey,
993  const std::set<TagID> & tags);
994 
1003  void addJacobianNeighborLowerD(GlobalDataKey);
1004 
1010  void addJacobianLowerD(GlobalDataKey);
1011 
1020  void cacheJacobianMortar(GlobalDataKey);
1021 
1027  unsigned int ivar,
1028  unsigned int jvar,
1029  const libMesh::DofMap & dof_map,
1030  std::vector<dof_id_type> & dof_indices,
1031  std::vector<dof_id_type> & neighbor_dof_indices,
1032  GlobalDataKey,
1033  TagID tag);
1034 
1040  unsigned int ivar,
1041  unsigned int jvar,
1042  const libMesh::DofMap & dof_map,
1043  std::vector<dof_id_type> & dof_indices,
1044  std::vector<dof_id_type> & neighbor_dof_indices,
1045  GlobalDataKey,
1046  const std::set<TagID> & tags);
1047 
1051  void cacheJacobian(GlobalDataKey);
1052 
1056  void cacheJacobianNonlocal(GlobalDataKey);
1057 
1062  void cacheJacobianNeighbor(GlobalDataKey);
1063 
1070  void addCachedJacobian(GlobalDataKey);
1071 
1075  void setCachedJacobian(GlobalDataKey);
1076 
1080  void zeroCachedJacobian(GlobalDataKey);
1081 
1086  DenseVector<Number> & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
1087  {
1088  return _sub_Re[tag_id][var_num];
1089  }
1090 
1096  {
1097  return _sub_Rn[tag_id][var_num];
1098  }
1099 
1105  {
1106  return _sub_Rl[tag_id][var_num];
1107  }
1108 
1113  DenseMatrix<Number> & jacobianBlock(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1114  {
1115  jacobianBlockUsed(tag, ivar, jvar, true);
1116  return _sub_Kee[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1117  }
1118 
1124  jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1125  {
1126  jacobianBlockNonlocalUsed(tag, ivar, jvar, true);
1127  return _sub_Keg[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1128  }
1129 
1135  Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag);
1136 
1145  unsigned int ivar,
1146  unsigned int jvar,
1147  LocalDataKey,
1148  TagID tag);
1149 
1154  void cacheResidualNodes(const DenseVector<Number> & res,
1155  const std::vector<dof_id_type> & dof_index,
1156  LocalDataKey,
1157  TagID tag);
1158 
1170  void
1171  cacheJacobian(numeric_index_type i, numeric_index_type j, Real value, LocalDataKey, TagID tag);
1172 
1186  Real value,
1187  LocalDataKey,
1188  const std::set<TagID> & tags);
1189 
1196  void cacheJacobianBlock(DenseMatrix<Number> & jac_block,
1197  const std::vector<dof_id_type> & idof_indices,
1198  const std::vector<dof_id_type> & jdof_indices,
1199  Real scaling_factor,
1200  LocalDataKey,
1201  TagID tag);
1202 
1212  template <typename Residuals, typename Indices>
1213  void cacheResiduals(const Residuals & residuals,
1214  const Indices & row_indices,
1215  Real scaling_factor,
1216  LocalDataKey,
1217  const std::set<TagID> & vector_tags);
1218 
1226  template <typename Residuals, typename Indices>
1227  void cacheJacobian(const Residuals & residuals,
1228  const Indices & row_indices,
1229  Real scaling_factor,
1230  LocalDataKey,
1231  const std::set<TagID> & matrix_tags);
1232 
1243  template <typename Residuals, typename Indices>
1244  void cacheResidualsWithoutConstraints(const Residuals & residuals,
1245  const Indices & row_indices,
1246  Real scaling_factor,
1247  LocalDataKey,
1248  const std::set<TagID> & vector_tags);
1249 
1257  template <typename Residuals, typename Indices>
1258  void cacheJacobianWithoutConstraints(const Residuals & residuals,
1259  const Indices & row_indices,
1260  Real scaling_factor,
1261  LocalDataKey,
1262  const std::set<TagID> & matrix_tags);
1263 
1264  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> & couplingEntries()
1265  {
1266  return _cm_ff_entry;
1267  }
1268  const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1270  {
1271  return _cm_ff_entry;
1272  }
1273  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1275  {
1276  return _cm_nonlocal_entry;
1277  }
1278  const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> &
1280  {
1281  return _cm_fs_entry;
1282  }
1283  const std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> &
1285  {
1286  return _cm_sf_entry;
1287  }
1288 
1289  // Read-only references
1290  const VariablePhiValue & phi() const { return _phi; }
1291  template <typename T>
1293  {
1294  return _ad_grad_phi_data.at(v.feType());
1295  }
1296  const VariablePhiValue & phi(const MooseVariableField<Real> &) const { return _phi; }
1297  const VariablePhiGradient & gradPhi() const { return _grad_phi; }
1299  const VariablePhiSecond & secondPhi() const { return _second_phi; }
1301  {
1302  return _second_phi;
1303  }
1304 
1305  const VariablePhiValue & phiFace() const { return _phi_face; }
1306  const VariablePhiValue & phiFace(const MooseVariableField<Real> &) const { return _phi_face; }
1307  const VariablePhiGradient & gradPhiFace() const { return _grad_phi_face; }
1309  {
1310  return _grad_phi_face;
1311  }
1313  {
1314  return _second_phi_face;
1315  }
1316 
1318  {
1319  return _phi_neighbor;
1320  }
1322  {
1323  return _grad_phi_neighbor;
1324  }
1326  {
1327  return _second_phi_neighbor;
1328  }
1329 
1331  {
1332  return _phi_face_neighbor;
1333  }
1335  {
1336  return _grad_phi_face_neighbor;
1337  }
1339  {
1341  }
1342 
1344  {
1345  return _vector_phi;
1346  }
1348  {
1349  return _vector_grad_phi;
1350  }
1352  {
1353  return _vector_second_phi;
1354  }
1356  {
1357  return _vector_curl_phi;
1358  }
1360  {
1361  return _vector_div_phi;
1362  }
1363 
1365  {
1366  return _vector_phi_face;
1367  }
1369  {
1370  return _vector_grad_phi_face;
1371  }
1373  {
1374  return _vector_second_phi_face;
1375  }
1377  {
1378  return _vector_curl_phi_face;
1379  }
1381  {
1382  return _vector_div_phi_face;
1383  }
1384 
1386  {
1387  return _vector_phi_neighbor;
1388  }
1391  {
1393  }
1394  const VectorVariablePhiSecond &
1396  {
1398  }
1400  {
1402  }
1405  {
1406  return _vector_div_phi_neighbor;
1407  }
1408 
1410  {
1412  }
1415  {
1417  }
1418  const VectorVariablePhiSecond &
1420  {
1422  }
1423  const VectorVariablePhiCurl &
1425  {
1427  }
1430  {
1432  }
1433 
1434  // Writeable references
1438 
1442 
1445  {
1446  return _grad_phi_neighbor;
1447  }
1449  {
1450  return _second_phi_neighbor;
1451  }
1452 
1454  {
1455  return _phi_face_neighbor;
1456  }
1458  {
1459  return _grad_phi_face_neighbor;
1460  }
1462  {
1464  }
1465 
1466  // Writeable references with vector variable
1469  {
1470  return _vector_grad_phi;
1471  }
1473  {
1474  return _vector_second_phi;
1475  }
1477  {
1478  return _vector_curl_phi;
1479  }
1481  {
1482  return _vector_div_phi;
1483  }
1484 
1486  {
1487  return _vector_phi_face;
1488  }
1490  {
1491  return _vector_grad_phi_face;
1492  }
1494  {
1495  return _vector_second_phi_face;
1496  }
1498  {
1499  return _vector_curl_phi_face;
1500  }
1502  {
1503  return _vector_div_phi_face;
1504  }
1505 
1507  {
1508  return _vector_phi_neighbor;
1509  }
1511  {
1513  }
1515  {
1517  }
1519  {
1521  }
1523  {
1524  return _vector_div_phi_neighbor;
1525  }
1527  {
1529  }
1531  {
1533  }
1535  {
1537  }
1539  {
1541  }
1543  {
1545  }
1546 
1547  // Writeable references with array variable
1551 
1554  {
1555  return _grad_phi_face;
1556  }
1558  {
1559  return _second_phi_face;
1560  }
1561 
1563  {
1564  return _phi_neighbor;
1565  }
1567  {
1568  return _grad_phi_neighbor;
1569  }
1571  {
1572  return _second_phi_neighbor;
1573  }
1574 
1576  {
1577  return _phi_face_neighbor;
1578  }
1580  {
1581  return _grad_phi_face_neighbor;
1582  }
1584  {
1586  }
1587 
1588  template <typename OutputType>
1590  {
1591  buildFE(type);
1592  return _fe_shape_data[type]->_phi;
1593  }
1594 
1595  template <typename OutputType>
1597  {
1598  buildFE(type);
1599  return _fe_shape_data[type]->_grad_phi;
1600  }
1601 
1602  template <typename OutputType>
1604  {
1605  return _ad_grad_phi_data[type];
1606  }
1607 
1608  template <typename OutputType>
1610  {
1611  _need_second_derivative.insert(type);
1612  buildFE(type);
1613  return _fe_shape_data[type]->_second_phi;
1614  }
1615 
1616  template <typename OutputType>
1617  const typename OutputTools<OutputType>::VariablePhiValue & fePhiLower(FEType type) const;
1618 
1619  template <typename OutputType>
1621 
1622  template <typename OutputType>
1624 
1625  template <typename OutputType>
1627  feGradDualPhiLower(FEType type) const;
1628 
1629  template <typename OutputType>
1631  {
1632  buildFaceFE(type);
1633  return _fe_shape_data_face[type]->_phi;
1634  }
1635 
1636  template <typename OutputType>
1638  {
1639  buildFaceFE(type);
1640  return _fe_shape_data_face[type]->_grad_phi;
1641  }
1642 
1643  template <typename OutputType>
1645  {
1646  return _ad_grad_phi_data_face[type];
1647  }
1648 
1649  template <typename OutputType>
1651  {
1652  _need_second_derivative.insert(type);
1653  buildFaceFE(type);
1654  return _fe_shape_data_face[type]->_second_phi;
1655  }
1656 
1657  template <typename OutputType>
1659  {
1660  buildNeighborFE(type);
1661  return _fe_shape_data_neighbor[type]->_phi;
1662  }
1663 
1664  template <typename OutputType>
1666  {
1667  buildNeighborFE(type);
1668  return _fe_shape_data_neighbor[type]->_grad_phi;
1669  }
1670 
1671  template <typename OutputType>
1673  {
1674  _need_second_derivative_neighbor.insert(type);
1675  buildNeighborFE(type);
1676  return _fe_shape_data_neighbor[type]->_second_phi;
1677  }
1678 
1679  template <typename OutputType>
1681  {
1682  buildFaceNeighborFE(type);
1683  return _fe_shape_data_face_neighbor[type]->_phi;
1684  }
1685 
1686  template <typename OutputType>
1689  {
1690  buildFaceNeighborFE(type);
1691  return _fe_shape_data_face_neighbor[type]->_grad_phi;
1692  }
1693 
1694  template <typename OutputType>
1697  {
1698  _need_second_derivative_neighbor.insert(type);
1699  buildFaceNeighborFE(type);
1700  return _fe_shape_data_face_neighbor[type]->_second_phi;
1701  }
1702 
1703  template <typename OutputType>
1705  {
1706  _need_curl.insert(type);
1707  buildFE(type);
1708  return _fe_shape_data[type]->_curl_phi;
1709  }
1710 
1711  template <typename OutputType>
1713  {
1714  _need_curl.insert(type);
1715  buildFaceFE(type);
1716  return _fe_shape_data_face[type]->_curl_phi;
1717  }
1718 
1719  template <typename OutputType>
1721  {
1722  _need_curl.insert(type);
1723  buildNeighborFE(type);
1724  return _fe_shape_data_neighbor[type]->_curl_phi;
1725  }
1726 
1727  template <typename OutputType>
1729  {
1730  _need_curl.insert(type);
1731  buildFaceNeighborFE(type);
1732  return _fe_shape_data_face_neighbor[type]->_curl_phi;
1733  }
1734 
1735  template <typename OutputType>
1737  {
1738  buildFE(type);
1739  return _fe_shape_data[type]->_div_phi;
1740  }
1741 
1742  template <typename OutputType>
1744  {
1745  buildFaceFE(type);
1746  return _fe_shape_data_face[type]->_div_phi;
1747  }
1748 
1749  template <typename OutputType>
1752  {
1753  buildNeighborFE(type);
1754  return _fe_shape_data_neighbor[type]->_div_phi;
1755  }
1756 
1757  template <typename OutputType>
1760  {
1761  buildFaceNeighborFE(type);
1762  return _fe_shape_data_face_neighbor[type]->_div_phi;
1763  }
1764 
1766  Real elementVolume(const Elem * elem) const;
1767 
1771  void setXFEM(std::shared_ptr<XFEMInterface> xfem) { _xfem = xfem; }
1772 
1776  void assignDisplacements(
1777  std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions);
1778 
1788  unsigned int i,
1789  unsigned int ntest,
1790  const RealEigenVector & v) const
1791  {
1792  for (unsigned int j = 0; j < v.size(); ++j, i += ntest)
1793  re(i) += v(j);
1794  }
1795 
1807  unsigned int i,
1808  unsigned int ntest,
1809  unsigned int j,
1810  unsigned int nphi,
1811  unsigned int ivar,
1812  const RealEigenVector & v) const
1813  {
1814  unsigned int pace = (_component_block_diagonal[ivar] ? 0 : nphi);
1815  for (unsigned int k = 0; k < v.size(); ++k, i += ntest, j += pace)
1816  ke(i, j) += v(k);
1817  }
1818 
1832  unsigned int i,
1833  unsigned int ntest,
1834  unsigned int j,
1835  unsigned int nphi,
1836  unsigned int ivar,
1837  unsigned int jvar,
1838  const RealEigenMatrix & v) const
1839  {
1840  if (ivar == jvar && _component_block_diagonal[ivar])
1841  {
1842  for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1843  ke(i, j) += v(k, k);
1844  }
1845  else
1846  {
1847  const unsigned int saved_j = j;
1848  for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1849  {
1850  j = saved_j;
1851  for (unsigned int l = 0; l < v.cols(); ++l, j += nphi)
1852  ke(i, j) += v(k, l);
1853  }
1854  }
1855  }
1856 
1858  {
1859  unsigned int rows = ke.m();
1860  unsigned int cols = ke.n();
1861  DenseVector<Real> diag(rows);
1862  for (unsigned int i = 0; i < rows; i++)
1863  // % operation is needed to account for cases of no component coupling of array variables
1864  diag(i) = ke(i, i % cols);
1865  return diag;
1866  }
1867 
1873  inline const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase & fe)
1874  {
1875  auto qrule = qrules(dim).vol.get();
1876  fe.attach_quadrature_rule(qrule);
1877  return qrule;
1878  }
1879 
1885  inline const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase & fe)
1886  {
1887  auto qrule = qrules(dim).face.get();
1888  fe.attach_quadrature_rule(qrule);
1889  return qrule;
1890  }
1891 
1896  void hasScalingVector();
1897 
1906  void modifyArbitraryWeights(const std::vector<Real> & weights);
1907 
1911  bool computingResidual() const { return _computing_residual; }
1912 
1916  bool computingJacobian() const { return _computing_jacobian; }
1917 
1922 
1926  const Elem * const & msmElem() const { return _msm_elem; }
1927 
1937  void havePRefinement(const std::unordered_set<FEFamily> & disable_p_refinement_for_families);
1938 
1942  void setCurrentLowerDElem(const Elem * const lower_d_elem);
1943 
1944 private:
1950  void reinitFE(const Elem * elem);
1951 
1958  void reinitFEFace(const Elem * elem, unsigned int side);
1959 
1960  void computeFaceMap(const Elem & elem, const unsigned int side, const std::vector<Real> & qw);
1961 
1962  void reinitFEFaceNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1963 
1964  void reinitFENeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1965 
1966  template <typename Points, typename Coords>
1967  void setCoordinateTransformation(const libMesh::QBase * qrule,
1968  const Points & q_points,
1969  Coords & coord,
1970  SubdomainID sub_id);
1971 
1972  void computeCurrentElemVolume();
1973 
1974  void computeCurrentFaceVolume();
1975 
1977 
1983  void modifyWeightsDueToXFEM(const Elem * elem);
1984 
1991  void modifyFaceWeightsDueToXFEM(const Elem * elem, unsigned int side = 0);
1992 
1997  template <typename OutputType>
1998  void computeGradPhiAD(const Elem * elem,
1999  unsigned int n_qp,
2002 
2006  void resizeADMappingObjects(unsigned int n_qp, unsigned int dim);
2007 
2012  void
2013  computeSinglePointMapAD(const Elem * elem, const std::vector<Real> & qw, unsigned p, FEBase * fe);
2014 
2018  void addResidual(const VectorTag & vector_tag);
2022  void addResidualNeighbor(const VectorTag & vector_tag);
2027  void addResidualLower(const VectorTag & vector_tag);
2031  void addResidualScalar(const VectorTag & vector_tag);
2032 
2036  void clearCachedResiduals(const VectorTag & vector_tag);
2037 
2046  void cacheResidual(dof_id_type dof, Real value, TagID tag_id);
2047 
2056  void cacheResidual(dof_id_type dof, Real value, const std::set<TagID> & tags);
2057 
2062  void processLocalResidual(DenseVector<Number> & res_block,
2063  std::vector<dof_id_type> & dof_indices,
2064  const std::vector<Real> & scaling_factor,
2065  bool is_nodal);
2066 
2070  void addResidualBlock(NumericVector<Number> & residual,
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 cacheResidualBlock(std::vector<Real> & cached_residual_values,
2080  std::vector<dof_id_type> & cached_residual_rows,
2081  DenseVector<Number> & res_block,
2082  const std::vector<dof_id_type> & dof_indices,
2083  const std::vector<Real> & scaling_factor,
2084  bool is_nodal);
2085 
2089  void setResidualBlock(NumericVector<Number> & residual,
2090  DenseVector<Number> & res_block,
2091  const std::vector<dof_id_type> & dof_indices,
2092  const std::vector<Real> & scaling_factor,
2093  bool is_nodal);
2094 
2099  DenseMatrix<Number> & jac_block,
2100  const MooseVariableBase & ivar,
2101  const MooseVariableBase & jvar,
2102  const std::vector<dof_id_type> & idof_indices,
2103  const std::vector<dof_id_type> & jdof_indices);
2104 
2108  void cacheJacobianBlock(DenseMatrix<Number> & jac_block,
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 
2119  const MooseVariableBase & ivar,
2120  const MooseVariableBase & jvar,
2121  const std::vector<dof_id_type> & idof_indices,
2122  const std::vector<dof_id_type> & jdof_indices,
2123  TagID tag);
2124 
2128  void addJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2129 
2133  void cacheJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2134 
2140  void clearCachedJacobian();
2141 
2146  void buildFE(FEType type) const;
2147 
2152  void buildFaceFE(FEType type) const;
2153 
2158  void buildNeighborFE(FEType type) const;
2159 
2164  void buildFaceNeighborFE(FEType type) const;
2165 
2170  void buildLowerDFE(FEType type) const;
2171 
2172  void buildLowerDDualFE(FEType type) const;
2173 
2178  void buildVectorFE(FEType type) const;
2179 
2184  void buildVectorFaceFE(FEType type) const;
2185 
2190  void buildVectorNeighborFE(FEType type) const;
2191 
2196  void buildVectorFaceNeighborFE(FEType type) const;
2197 
2202  void buildVectorLowerDFE(FEType type) const;
2203  void buildVectorDualLowerDFE(FEType type) const;
2204 
2209  void jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2210  {
2211  _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2212  }
2213 
2218  char jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2219  {
2220  return _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2221  }
2222 
2227  void jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2228  {
2229  _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2230  }
2231 
2236  char jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2237  {
2238  return _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2239  }
2240 
2245  void jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2246  {
2247  _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2248  }
2249 
2254  char jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2255  {
2256  return _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2257  }
2258 
2263  void jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2264  {
2265  _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2266  }
2267 
2272  char jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2273  {
2274  return _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2275  }
2276 
2280  void helpersRequestData();
2281 
2284 
2285  const bool _displaced;
2286 
2290 
2292  const bool & _computing_residual;
2293 
2295  const bool & _computing_jacobian;
2296 
2299 
2301  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_ff_entry;
2303  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> _cm_fs_entry;
2305  std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> _cm_sf_entry;
2307  std::vector<std::pair<MooseVariableScalar *, MooseVariableScalar *>> _cm_ss_entry;
2309  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_nonlocal_entry;
2311  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_used;
2312  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_nonlocal_used;
2314  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_neighbor_used;
2316  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_lower_used;
2321 
2323 
2324  unsigned int _mesh_dimension;
2325 
2329 
2336 
2339  std::vector<std::unique_ptr<FEBase>> _unique_fe_helper;
2340  std::vector<std::unique_ptr<FEBase>> _unique_fe_face_helper;
2341  std::vector<std::unique_ptr<FEBase>> _unique_fe_face_neighbor_helper;
2342  std::vector<std::unique_ptr<FEBase>> _unique_fe_neighbor_helper;
2343  std::vector<std::unique_ptr<FEBase>> _unique_fe_lower_helper;
2344 
2347 
2349  std::shared_ptr<XFEMInterface> _xfem;
2350 
2352  std::map<FEType, FEBase *> _current_fe;
2354  std::map<FEType, FEBase *> _current_fe_face;
2356  std::map<FEType, FEBase *> _current_fe_neighbor;
2358  std::map<FEType, FEBase *> _current_fe_face_neighbor;
2359 
2361  std::map<FEType, FEVectorBase *> _current_vector_fe;
2363  std::map<FEType, FEVectorBase *> _current_vector_fe_face;
2365  std::map<FEType, FEVectorBase *> _current_vector_fe_neighbor;
2367  std::map<FEType, FEVectorBase *> _current_vector_fe_face_neighbor;
2368 
2369  /**** Volume Stuff ****/
2370 
2372  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe;
2374  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe;
2376  std::map<unsigned int, FEBase *> _holder_fe_helper;
2397 
2400  struct QRules
2401  {
2403  : vol(nullptr),
2404  face(nullptr),
2405  arbitrary_vol(nullptr),
2406  arbitrary_face(nullptr),
2407  neighbor(nullptr)
2408  {
2409  }
2410 
2412  std::unique_ptr<libMesh::QBase> vol;
2414  std::unique_ptr<libMesh::QBase> face;
2416  std::unique_ptr<libMesh::QBase> fv_face;
2418  std::unique_ptr<ArbitraryQuadrature> arbitrary_vol;
2420  std::unique_ptr<ArbitraryQuadrature> arbitrary_face;
2422  std::unique_ptr<ArbitraryQuadrature> neighbor;
2423  };
2424 
2429  std::unordered_map<SubdomainID, std::vector<QRules>> _qrules;
2430 
2437  libMesh::QBase * qruleFace(const Elem * elem, unsigned int side);
2438  ArbitraryQuadrature * qruleArbitraryFace(const Elem * elem, unsigned int side);
2439 
2440  template <typename T>
2441  T * qruleFaceHelper(const Elem * elem, unsigned int side, std::function<T *(QRules &)> rule_fn)
2442  {
2443  auto dim = elem->dim();
2444  auto neighbor = elem->neighbor_ptr(side);
2445  auto q = rule_fn(qrules(dim, elem->subdomain_id()));
2446  if (!neighbor)
2447  return q;
2448 
2449  // find the maximum face quadrature order for all blocks the face is in
2450  auto neighbor_block = neighbor->subdomain_id();
2451  if (neighbor_block == elem->subdomain_id())
2452  return q;
2453 
2454  auto q_neighbor = rule_fn(qrules(dim, neighbor_block));
2455  if (q->get_order() > q_neighbor->get_order())
2456  return q;
2457  return q_neighbor;
2458  }
2459 
2460  inline QRules & qrules(unsigned int dim) { return qrules(dim, _current_subdomain_id); }
2461 
2465  inline QRules & qrules(unsigned int dim, SubdomainID block)
2466  {
2467  if (_qrules.find(block) == _qrules.end())
2468  {
2469  mooseAssert(_qrules.find(Moose::ANY_BLOCK_ID) != _qrules.end(),
2470  "missing quadrature rules for specified block");
2471  mooseAssert(_qrules[Moose::ANY_BLOCK_ID].size() > dim,
2472  "quadrature rules not sized property for dimension");
2473  return _qrules[Moose::ANY_BLOCK_ID][dim];
2474  }
2475  mooseAssert(_qrules.find(block) != _qrules.end(),
2476  "missing quadrature rules for specified block");
2477  mooseAssert(_qrules[block].size() > dim, "quadrature rules not sized property for dimension");
2478  return _qrules[block][dim];
2479  }
2480 
2481  /**** Face Stuff ****/
2482 
2484  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face;
2486  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face;
2488  std::map<unsigned int, FEBase *> _holder_fe_face_helper;
2502  std::vector<Eigen::Map<RealDIMValue>> _mapped_normals;
2505 
2507  std::vector<dof_id_type> _extra_elem_ids;
2509  std::vector<dof_id_type> _neighbor_extra_elem_ids;
2511  std::map<unsigned int, const std::vector<Point> *> _holder_normals;
2512 
2513  /**** Neighbor Stuff ****/
2514 
2516  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_neighbor;
2517  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face_neighbor;
2518  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_neighbor;
2519  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face_neighbor;
2520 
2522  std::map<unsigned int, FEBase *> _holder_fe_neighbor_helper;
2523  std::map<unsigned int, FEBase *> _holder_fe_face_neighbor_helper;
2524 
2526  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_lower;
2528  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_lower;
2530  std::map<unsigned int, FEBase *> _holder_fe_lower_helper;
2531 
2537  mutable bool _need_JxW_neighbor;
2545 
2546  /********** mortar stuff *************/
2547 
2549  const std::vector<Real> * _JxW_msm;
2551  std::unique_ptr<FEBase> _fe_msm;
2559 
2563 
2564 protected:
2566  const Elem * _current_elem;
2574  unsigned int _current_side;
2576  const Elem * _current_side_elem;
2592  const Node * _current_node;
2599 
2614 
2617 
2618  /*
2619  * Residual contributions <tag_index, ivar>
2620  *
2621  * tag_index is the index into _residual_vector_tags, that is, _sub_Re[0] corresponds to the tag
2622  * with TagID _residual_vector_tags[0]._id
2623  *
2624  * When ivar corresponds to an array variable, the dense vector is in size of ndof * count,
2625  * where count is the number of components of the array variable. The local residual is ordered
2626  * as (r_i,j, i = 1,...,ndof; j = 1,...,count).
2627  *
2628  * Dense vectors for variables (ivar+i, i = 1,...,count) are empty.
2629  */
2630  std::vector<std::vector<DenseVector<Number>>> _sub_Re;
2631  std::vector<std::vector<DenseVector<Number>>> _sub_Rn;
2633  std::vector<std::vector<DenseVector<Number>>> _sub_Rl;
2634 
2637 
2638  /*
2639  * Jacobian contributions <Tag, ivar, jvar>
2640  * When ivar corresponds to an array variable, the number of rows of the dense matrix is in size
2641  * of indof * icount, where icount is the number of components of ivar. When jvar corresponds to
2642  * an array variable, the number of columns of the dense matrix is in size of jndof * jcount,
2643  * where jcount is the number of components of jvar. The local residual is ordered as
2644  * (K_(i,j,k,l), k=1,...,jndof; l = 1,...,jcout; i = 1,...,indof; j = 1,...,icount).
2645  *
2646  * Dense matrices for variables (ivar+i, i = 1,...,icount) or (jvar+j, j = 1,...,jcount) are
2647  * empty.
2648  */
2649  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kee;
2650  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Keg;
2651 
2653  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Ken;
2655  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kne;
2657  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knn;
2659  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kll;
2661  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kle;
2663  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kln;
2665  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kel;
2667  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knl;
2668 
2671 
2672  // Shape function values, gradients. second derivatives
2676 
2680 
2684 
2688 
2689  // Shape function values, gradients, second derivatives
2695 
2701 
2707 
2713 
2715  {
2716  public:
2722  };
2723 
2725  {
2726  public:
2732  };
2733 
2735  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data;
2736  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face;
2737  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_neighbor;
2738  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face_neighbor;
2739  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_lower;
2740  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_dual_lower;
2741 
2743  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data;
2744  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face;
2745  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_neighbor;
2746  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face_neighbor;
2747  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_lower;
2748  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_dual_lower;
2749 
2750  mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data;
2751  mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>> _ad_vector_grad_phi_data;
2752  mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data_face;
2753  mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>>
2755 
2765  const std::vector<VectorTag> & _residual_vector_tags;
2766 
2768  std::vector<std::vector<Real>> _cached_residual_values;
2769 
2771  std::vector<std::vector<dof_id_type>> _cached_residual_rows;
2772 
2774 
2776  std::vector<std::vector<Real>> _cached_jacobian_values;
2778  std::vector<std::vector<dof_id_type>> _cached_jacobian_rows;
2780  std::vector<std::vector<dof_id_type>> _cached_jacobian_cols;
2781 
2783 
2788  std::vector<bool> _component_block_diagonal;
2789 
2791  std::vector<dof_id_type> _temp_dof_indices;
2792 
2794  std::vector<Point> _temp_reference_points;
2795 
2797  std::vector<VectorValue<ADReal>> _ad_dxyzdxi_map;
2798  std::vector<VectorValue<ADReal>> _ad_dxyzdeta_map;
2799  std::vector<VectorValue<ADReal>> _ad_dxyzdzeta_map;
2800  std::vector<VectorValue<ADReal>> _ad_d2xyzdxi2_map;
2801  std::vector<VectorValue<ADReal>> _ad_d2xyzdxideta_map;
2802  std::vector<VectorValue<ADReal>> _ad_d2xyzdeta2_map;
2803  std::vector<ADReal> _ad_jac;
2806  std::vector<ADReal> _ad_dxidx_map;
2807  std::vector<ADReal> _ad_dxidy_map;
2808  std::vector<ADReal> _ad_dxidz_map;
2809  std::vector<ADReal> _ad_detadx_map;
2810  std::vector<ADReal> _ad_detady_map;
2811  std::vector<ADReal> _ad_detadz_map;
2812  std::vector<ADReal> _ad_dzetadx_map;
2813  std::vector<ADReal> _ad_dzetady_map;
2814  std::vector<ADReal> _ad_dzetadz_map;
2815 
2821 
2825  std::vector<std::pair<unsigned int, unsigned short>> _disp_numbers_and_directions;
2826 
2827  mutable bool _calculate_xyz;
2828  mutable bool _calculate_face_xyz;
2830 
2833  mutable bool _calculate_ad_coord;
2834 
2835  mutable std::set<FEType> _need_second_derivative;
2836  mutable std::set<FEType> _need_second_derivative_neighbor;
2837  mutable std::set<FEType> _need_curl;
2838  mutable std::set<FEType> _need_div;
2839  mutable std::set<FEType> _need_face_div;
2840  mutable std::set<FEType> _need_neighbor_div;
2841  mutable std::set<FEType> _need_face_neighbor_div;
2842 
2844  const NumericVector<Real> * _scaling_vector = nullptr;
2845 
2852 
2853  const Elem * _msm_elem = nullptr;
2854 
2859 
2864 
2868  std::vector<dof_id_type> _row_indices, _column_indices;
2869 
2872 
2874  std::vector<Point> _current_neighbor_ref_points;
2875 
2878 };
2879 
2880 template <typename OutputType>
2883 {
2884  buildLowerDFE(type);
2885  return _fe_shape_data_lower[type]->_phi;
2886 }
2887 
2888 template <typename OutputType>
2891 {
2892  buildLowerDDualFE(type);
2893  return _fe_shape_data_dual_lower[type]->_phi;
2894 }
2895 
2896 template <typename OutputType>
2899 {
2900  buildLowerDFE(type);
2901  return _fe_shape_data_lower[type]->_grad_phi;
2902 }
2903 
2904 template <typename OutputType>
2907 {
2908  buildLowerDDualFE(type);
2909  return _fe_shape_data_dual_lower[type]->_grad_phi;
2910 }
2911 
2912 template <>
2914 Assembly::feADGradPhi<RealVectorValue>(FEType type) const
2915 {
2916  return _ad_vector_grad_phi_data[type];
2917 }
2918 
2919 template <>
2921 Assembly::feADGradPhiFace<RealVectorValue>(FEType type) const
2922 {
2923  return _ad_vector_grad_phi_data_face[type];
2924 }
2925 
2926 template <>
2928 Assembly::fePhi<VectorValue<Real>>(FEType type) const;
2929 
2930 template <>
2932 Assembly::feGradPhi<VectorValue<Real>>(FEType type) const;
2933 
2934 template <>
2936 Assembly::feSecondPhi<VectorValue<Real>>(FEType type) const;
2937 
2938 template <>
2940 Assembly::fePhiLower<VectorValue<Real>>(FEType type) const;
2941 
2942 template <>
2944 Assembly::feDualPhiLower<VectorValue<Real>>(FEType type) const;
2945 
2946 template <>
2948 Assembly::feGradPhiLower<VectorValue<Real>>(FEType type) const;
2949 
2950 template <>
2952 Assembly::feGradDualPhiLower<VectorValue<Real>>(FEType type) const;
2953 
2954 template <>
2956 Assembly::fePhiFace<VectorValue<Real>>(FEType type) const;
2957 
2958 template <>
2960 Assembly::feGradPhiFace<VectorValue<Real>>(FEType type) const;
2961 
2962 template <>
2964 Assembly::feSecondPhiFace<VectorValue<Real>>(FEType type) const;
2965 
2966 template <>
2968 Assembly::fePhiNeighbor<VectorValue<Real>>(FEType type) const;
2969 
2970 template <>
2972 Assembly::feGradPhiNeighbor<VectorValue<Real>>(FEType type) const;
2973 
2974 template <>
2976 Assembly::feSecondPhiNeighbor<VectorValue<Real>>(FEType type) const;
2977 
2978 template <>
2980 Assembly::fePhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
2981 
2982 template <>
2984 Assembly::feGradPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
2985 
2986 template <>
2988 Assembly::feSecondPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
2989 
2990 template <>
2992 Assembly::feCurlPhi<VectorValue<Real>>(FEType type) const;
2993 
2994 template <>
2996 Assembly::feCurlPhiFace<VectorValue<Real>>(FEType type) const;
2997 
2998 template <>
3000 Assembly::feCurlPhiNeighbor<VectorValue<Real>>(FEType type) const;
3001 
3002 template <>
3004 Assembly::feCurlPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3005 
3006 template <>
3008 Assembly::feDivPhi<VectorValue<Real>>(FEType type) const;
3009 
3010 template <>
3012 Assembly::feDivPhiFace<VectorValue<Real>>(FEType type) const;
3013 
3014 template <>
3016 Assembly::feDivPhiNeighbor<VectorValue<Real>>(FEType type) const;
3017 
3018 template <>
3020 Assembly::feDivPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3021 
3022 template <>
3024 Assembly::adGradPhi<RealVectorValue>(const MooseVariableFE<RealVectorValue> & v) const
3025 {
3026  return _ad_vector_grad_phi_data.at(v.feType());
3027 }
3028 
3029 template <typename Residuals, typename Indices>
3030 void
3031 Assembly::cacheResiduals(const Residuals & residuals,
3032  const Indices & input_row_indices,
3033  const Real scaling_factor,
3034  LocalDataKey,
3035  const std::set<TagID> & vector_tags)
3036 {
3037  mooseAssert(residuals.size() == input_row_indices.size(),
3038  "The number of residuals should match the number of dof indices");
3039  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3040 
3041  if (!computingResidual() || vector_tags.empty())
3042  return;
3043 
3044  if (residuals.size() == 1)
3045  {
3046  // No constraining is required. (This is likely a finite volume computation if we only have a
3047  // single dof)
3049  residuals, input_row_indices, scaling_factor, LocalDataKey{}, vector_tags);
3050  return;
3051  }
3052 
3053  // Need to make a copy because we might modify this in constrain_element_vector
3054  _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3055 
3057  for (const auto i : index_range(_row_indices))
3058  _element_vector(i) = MetaPhysicL::raw_value(residuals[i]) * scaling_factor;
3059 
3060  // At time of writing, this method doesn't do anything with the asymmetric_constraint_rows
3061  // argument, but we set it to false to be consistent with processLocalResidual
3063  _element_vector, _row_indices, /*asymmetric_constraint_rows=*/false);
3064 
3065  for (const auto i : index_range(_row_indices))
3066  cacheResidual(_row_indices[i], _element_vector(i), vector_tags);
3067 }
3068 
3069 template <typename Residuals, typename Indices>
3070 void
3072  const Indices & row_indices,
3073  const Real scaling_factor,
3074  LocalDataKey,
3075  const std::set<TagID> & vector_tags)
3076 {
3077  mooseAssert(residuals.size() == row_indices.size(),
3078  "The number of residuals should match the number of dof indices");
3079  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3080 
3081  if (computingResidual() && !vector_tags.empty())
3082  for (const auto i : index_range(row_indices))
3083  cacheResidual(
3084  row_indices[i], MetaPhysicL::raw_value(residuals[i]) * scaling_factor, vector_tags);
3085 }
3086 
3087 template <typename Residuals, typename Indices>
3088 void
3089 Assembly::cacheJacobian(const Residuals & residuals,
3090  const Indices & input_row_indices,
3091  const Real scaling_factor,
3092  LocalDataKey,
3093  const std::set<TagID> & matrix_tags)
3094 {
3095  if (!computingJacobian() || matrix_tags.empty())
3096  return;
3097 
3098  if (residuals.size() == 1)
3099  {
3100  // No constraining is required. (This is likely a finite volume computation if we only have a
3101  // single dof)
3103  residuals, input_row_indices, scaling_factor, LocalDataKey{}, matrix_tags);
3104  return;
3105  }
3106 
3107  const auto & compare_dofs = residuals[0].derivatives().nude_indices();
3108 #ifndef NDEBUG
3109  auto compare_dofs_set = std::set<dof_id_type>(compare_dofs.begin(), compare_dofs.end());
3110 
3111  for (const auto i : make_range(decltype(residuals.size())(1), residuals.size()))
3112  {
3113  const auto & residual = residuals[i];
3114  auto current_dofs_set = std::set<dof_id_type>(residual.derivatives().nude_indices().begin(),
3115  residual.derivatives().nude_indices().end());
3116  mooseAssert(compare_dofs_set == current_dofs_set,
3117  "We're going to see whether the dof sets are the same. IIRC the degree of freedom "
3118  "dependence (as indicated by the dof index set held by the ADReal) has to be the "
3119  "same for every residual passed to this method otherwise constrain_element_matrix "
3120  "will not work.");
3121  }
3122 #endif
3123  _column_indices.assign(compare_dofs.begin(), compare_dofs.end());
3124 
3125  // If there's no derivatives then there is nothing to do. Moreover, if we pass zero size column
3126  // indices to constrain_element_matrix then we will potentially get errors out of BLAS
3127  if (!_column_indices.size())
3128  return;
3129 
3130  // Need to make a copy because we might modify this in constrain_element_matrix
3131  _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3132 
3134  for (const auto i : index_range(_row_indices))
3135  {
3136  const auto & sparse_derivatives = residuals[i].derivatives();
3137 
3138  for (const auto j : index_range(_column_indices))
3139  _element_matrix(i, j) = sparse_derivatives[_column_indices[j]] * scaling_factor;
3140  }
3141 
3143 
3144  for (const auto i : index_range(_row_indices))
3145  for (const auto j : index_range(_column_indices))
3146  cacheJacobian(_row_indices[i], _column_indices[j], _element_matrix(i, j), {}, matrix_tags);
3147 }
3148 
3149 template <typename Residuals, typename Indices>
3150 void
3151 Assembly::cacheJacobianWithoutConstraints(const Residuals & residuals,
3152  const Indices & row_indices,
3153  const Real scaling_factor,
3154  LocalDataKey,
3155  const std::set<TagID> & matrix_tags)
3156 {
3157  mooseAssert(residuals.size() == row_indices.size(),
3158  "The number of residuals should match the number of dof indices");
3159  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3160 
3161  if (!computingJacobian() || matrix_tags.empty())
3162  return;
3163 
3164  for (const auto i : index_range(row_indices))
3165  {
3166  const auto row_index = row_indices[i];
3167 
3168  const auto & sparse_derivatives = residuals[i].derivatives();
3169  const auto & column_indices = sparse_derivatives.nude_indices();
3170  const auto & raw_derivatives = sparse_derivatives.nude_data();
3171 
3172  for (std::size_t j = 0; j < column_indices.size(); ++j)
3173  cacheJacobian(
3174  row_index, column_indices[j], raw_derivatives[j] * scaling_factor, {}, matrix_tags);
3175  }
3176 }
3177 
3178 inline const Real &
3180 {
3183 }
3184 
3185 inline const Real &
3187 {
3190 }
3191 
3192 inline void
3194  std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions)
3195 {
3196  _disp_numbers_and_directions = std::move(disp_numbers_and_directions);
3197 }
3198 
3199 inline void
3200 Assembly::setCurrentLowerDElem(const Elem * const lower_d_elem)
3201 {
3202  _current_lower_d_elem = lower_d_elem;
3203 }
const Real & neighborVolume()
Returns the reference to the current neighbor volume.
Definition: Assembly.h:469
VariablePhiSecond _second_phi_face
Definition: Assembly.h:2679
const Elem *const & elem() const
Return the current element.
Definition: Assembly.h:375
VariablePhiSecond _second_phi_face_neighbor
Definition: Assembly.h:2687
MooseArray< VectorValue< ADReal > > _ad_normals
Definition: Assembly.h:2817
const VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1343
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:3000
libMesh::ElemSideBuilder _compute_face_map_side_elem_builder
In place side element builder for computeFaceMap()
Definition: Assembly.h:2851
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:2484
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition: Assembly.h:2588
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:3460
const unsigned int & neighborSide() const
Returns the current neighboring side.
Definition: Assembly.h:413
VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1472
ArbitraryQuadrature * _current_qrule_arbitrary
The current arbitrary quadrature rule used within the element interior.
Definition: Assembly.h:2384
std::map< FEType, FEBase * > _current_fe
The "volume" fe object that matches the current elem.
Definition: Assembly.h:2352
MooseArray< Real > _curvatures
Definition: Assembly.h:2819
std::vector< ADReal > _ad_detadz_map
Definition: Assembly.h:2811
VectorVariablePhiValue _phi
Definition: Assembly.h:2727
SystemBase & _sys
Definition: Assembly.h:2282
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:2771
std::vector< std::vector< dof_id_type > > _cached_jacobian_rows
Row where the corresponding cached value should go.
Definition: Assembly.h:2778
unsigned int _max_cached_residuals
Definition: Assembly.h:2773
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data_face
Definition: Assembly.h:2752
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhi(FEType type) const
Definition: Assembly.h:1704
bool _user_added_fe_lower_of_helper_type
Definition: Assembly.h:2335
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called...
Definition: Assembly.h:2616
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1570
const VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1334
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:2343
MooseArray< ADReal > _ad_coord
The AD version of the current coordinate transformation coefficients.
Definition: Assembly.h:2396
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:3294
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries()
Definition: Assembly.h:1264
void buildNeighborFE(FEType type) const
Build FEs for a neighbor with a type.
Definition: Assembly.C:316
const VariablePhiSecond & secondPhi() const
Definition: Assembly.h:1299
void setMortarQRule(Order order)
Specifies a custom qrule for integration on mortar segment mesh.
Definition: Assembly.C:737
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe
Each dimension&#39;s actual vector fe objects indexed on type.
Definition: Assembly.h:2374
typename OutputTools< typename Moose::ADType< T >::type >::VariablePhiGradient ADTemplateVariablePhiGradient
Definition: MooseTypes.h:637
void buildVectorLowerDFE(FEType type) const
Build Vector FEs for a lower dimensional element with a type.
Definition: Assembly.C:405
MooseArray< Real > _coord_neighbor
The current coordinate transformation coefficients.
Definition: Assembly.h:2541
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:268
T * qruleFaceHelper(const Elem *elem, unsigned int side, std::function< T *(QRules &)> rule_fn)
Definition: Assembly.h:2441
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:2292
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kle
dlower/dsecondary (or dlower/delement)
Definition: Assembly.h:2661
VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1489
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:3475
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > & fieldScalarCouplingEntries() const
Definition: Assembly.h:1279
const OutputTools< OutputType >::VariablePhiValue & fePhi(FEType type) const
Definition: Assembly.h:1589
void setFaceQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for face integration.
Definition: Assembly.C:676
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:80
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data
Shape function values, gradients, second derivatives for each FE type.
Definition: Assembly.h:2735
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:1644
void buildLowerDDualFE(FEType type) const
Definition: Assembly.C:384
VariablePhiGradient & gradPhiFace(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1553
unsigned int TagID
Definition: MooseTypes.h:210
VectorVariablePhiValue _vector_phi
Definition: Assembly.h:2690
MooseArray< Real > _current_JxW_neighbor
The current transformed jacobian weights on a neighbor&#39;s face.
Definition: Assembly.h:2539
std::shared_ptr< XFEMInterface > _xfem
The XFEM controller.
Definition: Assembly.h:2349
void reinitNeighborLowerDElem(const Elem *elem)
reinitialize a neighboring lower dimensional element
Definition: Assembly.C:2386
virtual ~Assembly()
Definition: Assembly.C:188
void setCurrentLowerDElem(const Elem *const lower_d_elem)
Set the current lower dimensional element.
Definition: Assembly.h:3200
const VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1404
void prepareJacobianBlock()
Sizes and zeroes the Jacobian blocks used for the current element.
Definition: Assembly.C:2687
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:1124
VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &)
Definition: Assembly.h:1441
VectorValue< Real > RealVectorValue
Definition: SubProblem.h:33
VariablePhiSecond & secondPhi(const MooseVariableField< Real > &)
Definition: Assembly.h:1437
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kel
dsecondary/dlower (or delement/dlower)
Definition: Assembly.h:2665
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition: Assembly.h:2394
const OutputTools< OutputType >::VariablePhiValue & fePhiLower(FEType type) const
Definition: Assembly.h:2882
VariablePhiDivergence _div_phi
Definition: Assembly.h:2721
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:3117
void reinitFE(const Elem *elem)
Just an internal helper function to reinit the volume FE objects.
Definition: Assembly.C:762
libMesh::QBase * _current_qrule_neighbor
quadrature rule used on neighbors
Definition: Assembly.h:2533
const Real & neighborLowerDElemVolume() const
Definition: Assembly.h:3186
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:1806
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1579
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:2209
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:1510
void prepareNonlocal()
Definition: Assembly.C:2725
VariablePhiGradient _grad_phi
Definition: Assembly.h:2674
std::map< unsigned int, FEBase * > _holder_fe_neighbor_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2522
const VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1351
std::unique_ptr< FEBase > _fe_msm
A FE object for working on mortar segement elements.
Definition: Assembly.h:2551
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face_neighbor
Definition: Assembly.h:2738
const VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1385
VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1485
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & nonlocalCouplingEntries()
Definition: Assembly.h:1274
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:619
VariablePhiSecond _second_phi_neighbor
Definition: Assembly.h:2683
void setXFEM(std::shared_ptr< XFEMInterface > xfem)
Set the pointer to the XFEM controller object.
Definition: Assembly.h:1771
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:1792
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:3535
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition: Assembly.h:2596
std::vector< ADReal > _ad_detady_map
Definition: Assembly.h:2810
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:2245
MooseVariableFE< Real > MooseVariable
Definition: Assembly.h:58
const VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1359
VectorVariablePhiGradient _vector_grad_phi_neighbor
Definition: Assembly.h:2703
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:2814
std::vector< std::unique_ptr< FEBase > > _unique_fe_neighbor_helper
Definition: Assembly.h:2342
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kll
dlower/dlower
Definition: Assembly.h:2659
VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1526
VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1476
bool _user_added_fe_face_neighbor_of_helper_type
Definition: Assembly.h:2333
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:3566
bool _have_p_refinement
Whether we have ever conducted p-refinement.
Definition: Assembly.h:2871
VariablePhiValue _phi
Definition: Assembly.h:2717
Real _current_neighbor_volume
Volume of the current neighbor.
Definition: Assembly.h:2590
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:2263
ArbitraryQuadrature * qruleArbitraryFace(const Elem *elem, unsigned int side)
Definition: Assembly.C:1926
std::map< FEType, FEBase * > _current_fe_face
The "face" fe object that matches the current elem.
Definition: Assembly.h:2354
VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1468
const VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1355
std::vector< Point > _current_neighbor_ref_points
The current reference points on the neighbor element.
Definition: Assembly.h:2874
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:42
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kln
dlower/dprimary (or dlower/dneighbor)
Definition: Assembly.h:2663
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:657
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition: Assembly.h:2580
void addJacobianNonlocal(GlobalDataKey)
Adds non-local Jacobian to the global Jacobian matrices.
Definition: Assembly.C:3890
VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1530
VariablePhiValue & phiFace(const MooseVariableField< Real > &)
Definition: Assembly.h:1439
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
Definition: Assembly.h:2631
const OutputTools< OutputType >::VariablePhiValue & feDualPhiLower(FEType type) const
Definition: Assembly.h:2890
MooseMesh & _mesh
Definition: Assembly.h:2322
const VariablePhiValue & phi() const
Definition: Assembly.h:1290
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_neighbor
Definition: Assembly.h:2737
std::map< unsigned int, FEBase * > _holder_fe_face_neighbor_helper
Definition: Assembly.h:2523
auto raw_value(const Eigen::Map< T > &in)
Definition: EigenADReal.h:73
const VariablePhiGradient & gradPhi() const
Definition: Assembly.h:1297
MooseArray< Real > _current_JxW_face
The current transformed jacobian weights on a face.
Definition: Assembly.h:2498
void modifyWeightsDueToXFEM(const Elem *elem)
Update the integration weights for XFEM partial elements.
Definition: Assembly.C:4538
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:2670
const Elem * _current_elem
The current "element" we are currently on.
Definition: Assembly.h:2566
VectorVariablePhiCurl _vector_curl_phi_neighbor
Definition: Assembly.h:2705
VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1518
const VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1325
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:683
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:2320
void reinitFEFaceNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition: Assembly.C:1573
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:153
VectorVariablePhiGradient _vector_grad_phi
Definition: Assembly.h:2691
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:2340
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_nonlocal_used
Definition: Assembly.h:2312
std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > _cm_sf_entry
Entries in the coupling matrix for scalar variables vs field variables.
Definition: Assembly.h:2305
VectorVariablePhiValue _vector_phi_neighbor
Definition: Assembly.h:2702
void prepareNeighbor()
Definition: Assembly.C:2804
void resizeADMappingObjects(unsigned int n_qp, unsigned int dim)
resize any objects that contribute to automatic differentiation-related mapping calculations ...
Definition: Assembly.C:973
OutputTools< Real >::VariablePhiValue VariablePhiValue
Definition: MooseTypes.h:319
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:2254
unsigned int m() const
libMesh::StaticCondensation * _sc
A pointer to the static condensation class. Null if not present.
Definition: Assembly.h:2877
VariablePhiValue & phi(const MooseVariableField< Real > &)
Definition: Assembly.h:1435
void setCoordinateTransformation(const libMesh::QBase *qrule, const Points &q_points, Coords &coord, SubdomainID sub_id)
Definition: Assembly.C:1731
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face_neighbor
Definition: Assembly.h:2519
const VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1330
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:2788
Real _current_elem_volume
Volume of the current element.
Definition: Assembly.h:2572
OutputTools< RealVectorValue >::VariablePhiGradient VectorVariablePhiGradient
Definition: MooseTypes.h:337
std::map< FEType, FEBase * > _current_fe_face_neighbor
The "neighbor face" fe object that matches the current elem.
Definition: Assembly.h:2358
const MooseArray< ADReal > & adCurvatures() const
Definition: Assembly.C:4818
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:2363
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:2339
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:3218
const FEType _helper_type
The finite element type of the FE helper classes.
Definition: Assembly.h:2328
const Elem *const & msmElem() const
Definition: Assembly.h:1926
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:3377
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:1113
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:4460
const bool & _computing_residual_and_jacobian
Whether we are currently computing the residual and Jacobian.
Definition: Assembly.h:2298
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knn
jacobian contributions from the neighbor <Tag, ivar, jvar>
Definition: Assembly.h:2657
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:1787
const ADTemplateVariablePhiGradient< T > & adGradPhi(const MooseVariableFE< T > &v) const
Definition: Assembly.h:1292
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:2492
const VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1317
FEGenericBase< RealGradient > FEVectorBase
VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1534
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:2836
std::vector< std::vector< Real > > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition: Assembly.h:2776
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:2218
VariablePhiValue _phi
Definition: Assembly.h:2673
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1696
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_ff_entry
Entries in the coupling matrix for field variables.
Definition: Assembly.h:2301
void addJacobianNeighborLowerD(GlobalDataKey)
Add all portions of the Jacobian except PrimaryPrimary, e.g.
Definition: Assembly.C:3950
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:2361
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1566
VariablePhiGradient _grad_phi
Definition: Assembly.h:2718
std::vector< VectorValue< ADReal > > _ad_dxyzdeta_map
Definition: Assembly.h:2798
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1448
void prepareScalar()
Definition: Assembly.C:2950
DenseVector< Real > getJacobianDiagonal(DenseMatrix< Number > &ke)
Definition: Assembly.h:1857
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:4558
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:1997
const VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1395
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFace(FEType type) const
Definition: Assembly.h:1637
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1759
OutputTools< Real >::VariablePhiSecond VariablePhiSecond
Definition: MooseTypes.h:321
std::unique_ptr< libMesh::QBase > face
area/face (meshdim-1) quadrature rule
Definition: Assembly.h:2414
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:2636
unsigned int _mesh_dimension
Definition: Assembly.h:2324
std::vector< Eigen::Map< RealDIMValue > > _mapped_normals
Mapped normals.
Definition: Assembly.h:2502
VectorVariablePhiDivergence _vector_div_phi_face
Definition: Assembly.h:2700
VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1538
void cacheJacobian(GlobalDataKey)
Takes the values that are currently in _sub_Kee and appends them to the cached values.
Definition: Assembly.C:4065
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiNeighbor(FEType type) const
Definition: Assembly.h:1751
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:2844
void assignDisplacements(std::vector< std::pair< unsigned int, unsigned short >> &&disp_numbers_and_directions)
Assign the displacement numbers and directions.
Definition: Assembly.h:3193
void addCachedResiduals(GlobalDataKey, const std::vector< VectorTag > &tags)
Pushes all cached residuals to the global residual vectors associated with each tag.
Definition: Assembly.C:3490
Data structure for tracking/grouping a set of quadrature rules for a particular dimensionality of mes...
Definition: Assembly.h:2400
unsigned int _max_cached_jacobians
Definition: Assembly.h:2782
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:3158
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Ken
jacobian contributions from the element and neighbor <Tag, ivar, jvar>
Definition: Assembly.h:2653
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_dual_lower
Definition: Assembly.h:2748
Nonlinear system to be solved.
VectorVariablePhiValue _vector_phi_face
Definition: Assembly.h:2696
std::vector< VectorValue< ADReal > > _ad_dxyzdzeta_map
Definition: Assembly.h:2799
const VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1372
std::vector< Point > _temp_reference_points
Temporary work data for reinitAtPhysical()
Definition: Assembly.h:2794
std::vector< std::pair< MooseVariableScalar *, MooseVariableScalar * > > _cm_ss_entry
Entries in the coupling matrix for scalar variables.
Definition: Assembly.h:2307
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kne
jacobian contributions from the neighbor and element <Tag, ivar, jvar>
Definition: Assembly.h:2655
const Elem * _current_neighbor_lower_d_elem
The current neighboring lower dimensional element.
Definition: Assembly.h:2603
OutputTools< RealVectorValue >::VariablePhiDivergence VectorVariablePhiDivergence
Definition: MooseTypes.h:340
unsigned int _current_neighbor_side
The current side of the selected neighboring element (valid only when working with sides) ...
Definition: Assembly.h:2584
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:3442
void init(const libMesh::CouplingMatrix *cm)
Initialize the Assembly object and set the CouplingMatrix for use throughout.
Definition: Assembly.C:2470
VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1514
void prepareLowerD()
Prepare the Jacobians and residuals for a lower dimensional element.
Definition: Assembly.C:2843
bool _user_added_fe_neighbor_of_helper_type
Definition: Assembly.h:2334
void buildFaceNeighborFE(FEType type) const
Build FEs for a neighbor face with a type.
Definition: Assembly.C:338
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face
Definition: Assembly.h:2744
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:2293
void computeCurrentFaceVolume()
Definition: Assembly.C:1773
const VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1399
std::vector< std::vector< DenseVector< Number > > > _sub_Rl
residual contributions for each variable from the lower dimensional element
Definition: Assembly.h:2633
VariablePhiCurl _curl_phi
Definition: Assembly.h:2720
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:2460
static const subdomain_id_type invalid_subdomain_id
VectorVariablePhiGradient _vector_grad_phi_face_neighbor
Definition: Assembly.h:2709
std::unique_ptr< libMesh::QBase > vol
volume/elem (meshdim) quadrature rule
Definition: Assembly.h:2412
void prepareOffDiagScalar()
Definition: Assembly.C:2974
VectorVariablePhiSecond _second_phi
Definition: Assembly.h:2729
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFace(FEType type) const
Definition: Assembly.h:1743
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:3862
std::vector< ADReal > _ad_dzetadx_map
Definition: Assembly.h:2812
void addJacobianLowerD(GlobalDataKey)
Add portions of the Jacobian of LowerLower, LowerSecondary, and SecondaryLower for boundary condition...
Definition: Assembly.C:4028
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:2272
VectorVariablePhiGradient _grad_phi
Definition: Assembly.h:2728
MooseArray< ADReal > _ad_curvatures
Definition: Assembly.h:2820
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:2386
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:1728
void modifyArbitraryWeights(const std::vector< Real > &weights)
Modify the weights when using the arbitrary quadrature rule.
Definition: Assembly.C:4585
FEBase * _current_fe_face_helper
helper object for transforming coordinates
Definition: Assembly.h:2490
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > _cm_fs_entry
Entries in the coupling matrix for field variables vs scalar variables.
Definition: Assembly.h:2303
const std::vector< Real > * _JxW_msm
A JxW for working on mortar segement elements.
Definition: Assembly.h:2549
std::vector< ADReal > _ad_dzetady_map
Definition: Assembly.h:2813
dof_id_type numeric_index_type
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data
Definition: Assembly.h:2750
std::unordered_map< SubdomainID, std::vector< QRules > > _qrules
Holds quadrature rules for each dimension.
Definition: Assembly.h:2429
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:1347
void prepareResidual()
Sizes and zeroes the residual for the current element.
Definition: Assembly.C:2709
VectorVariablePhiCurl _curl_phi
Definition: Assembly.h:2730
std::map< FEType, FEBase * > _current_fe_neighbor
The "neighbor" fe object that matches the current elem.
Definition: Assembly.h:2356
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhi(FEType type) const
Definition: Assembly.h:1603
Real elementVolume(const Elem *elem) const
On-demand computation of volume element accounting for RZ/RSpherical.
Definition: Assembly.C:3787
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1461
void cacheJacobianNeighbor(GlobalDataKey)
Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached val...
Definition: Assembly.C:4117
SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition: Assembly.h:2582
VectorVariablePhiValue _vector_phi_face_neighbor
Definition: Assembly.h:2708
VariablePhiSecond & secondPhi(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1550
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1453
const VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1376
std::vector< std::vector< DenseVector< Number > > > _sub_Re
Definition: Assembly.h:2630
VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1493
OutputTools< RealVectorValue >::VariablePhiSecond VectorVariablePhiSecond
Definition: MooseTypes.h:338
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:1687
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:1720
std::vector< ADReal > _ad_dxidz_map
Definition: Assembly.h:2808
const Real & lowerDElemVolume() const
Definition: Assembly.h:3179
VectorVariablePhiDivergence _vector_div_phi_neighbor
Definition: Assembly.h:2706
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:2465
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:2311
void prepare()
Definition: Assembly.C:2718
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:3151
VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &)
Definition: Assembly.h:1440
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:2562
SubProblem & _subproblem
Definition: Assembly.h:2283
const VariablePhiGradient & gradPhi(const MooseVariableField< Real > &) const
Definition: Assembly.h:1298
std::vector< ADReal > _ad_detadx_map
Definition: Assembly.h:2809
void buildFaceFE(FEType type) const
Build FEs for a face with a type.
Definition: Assembly.C:294
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition: Assembly.h:2516
DenseVector< Number > & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
Get residual block for lower.
Definition: Assembly.h:1104
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:3409
bool _calculate_xyz
Definition: Assembly.h:2827
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:4361
MooseArray< std::vector< Point > > _current_tangents
The current tangent vectors at the quadrature points.
Definition: Assembly.h:2504
bool _calculate_curvatures
Definition: Assembly.h:2829
VariablePhiGradient _grad_phi_face_neighbor
Definition: Assembly.h:2686
const std::vector< VectorTag > & _residual_vector_tags
The residual vector tags that Assembly could possibly contribute to.
Definition: Assembly.h:2765
std::map< FEType, FEVectorBase * > _current_vector_fe_face_neighbor
The "neighbor face" vector fe object that matches the current elem.
Definition: Assembly.h:2367
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFace(FEType type) const
Definition: Assembly.h:1712
std::vector< dof_id_type > _neighbor_extra_elem_ids
Extra element IDs of neighbor.
Definition: Assembly.h:2509
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition: Assembly.h:2390
std::vector< VectorValue< ADReal > > _ad_dxyzdxi_map
AD quantities.
Definition: Assembly.h:2797
std::vector< std::pair< unsigned int, unsigned short > > _disp_numbers_and_directions
Container of displacement numbers and directions.
Definition: Assembly.h:2825
VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1480
std::vector< dof_id_type > _temp_dof_indices
Temporary work vector to keep from reallocating it.
Definition: Assembly.h:2791
std::set< FEType > _need_neighbor_div
Definition: Assembly.h:2840
OutputTools< Real >::VariablePhiCurl VariablePhiCurl
Definition: MooseTypes.h:322
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kee
Definition: Assembly.h:2649
std::vector< VectorValue< ADReal > > _ad_d2xyzdxi2_map
Definition: Assembly.h:2800
std::vector< ADReal > _ad_jac
Definition: Assembly.h:2803
std::set< FEType > _need_curl
Definition: Assembly.h:2837
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:4303
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_lower
Definition: Assembly.h:2747
VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1506
const VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &) const
Definition: Assembly.h:1312
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data
Definition: Assembly.h:2751
VariablePhiGradient _grad_phi_neighbor
Definition: Assembly.h:2682
ArbitraryQuadrature * _current_qface_arbitrary
The current arbitrary quadrature rule used on element faces.
Definition: Assembly.h:2494
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face
types of vector finite elements
Definition: Assembly.h:2486
VariablePhiValue _phi_face
Definition: Assembly.h:2677
VectorVariablePhiSecond _vector_second_phi
Definition: Assembly.h:2692
libMesh::QBase * _current_qrule_volume
The current volumetric quadrature for the element.
Definition: Assembly.h:2382
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries() const
Definition: Assembly.h:1269
const OutputTools< OutputType >::VariablePhiGradient & feGradPhi(FEType type) const
Definition: Assembly.h:1596
const Elem * _msm_elem
Definition: Assembly.h:2853
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:1920
bool _calculate_ad_coord
Whether to calculate coord with AD.
Definition: Assembly.h:2833
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_lower
Definition: Assembly.h:2739
const Elem * _current_lower_d_elem
The current lower dimensional element.
Definition: Assembly.h:2601
GlobalDataKey(const GlobalDataKey &)
Definition: Assembly.h:825
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:3254
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:3327
const VariablePhiValue & phiFace() const
Definition: Assembly.h:1305
std::set< FEType > _need_second_derivative
Definition: Assembly.h:2835
bool computingResidualAndJacobian() const
Definition: Assembly.h:1921
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_lower
FE objects for lower dimensional elements.
Definition: Assembly.h:2526
const VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1424
std::set< FEType > _need_face_neighbor_div
Definition: Assembly.h:2841
FEGenericBase< Real > FEBase
libMesh::QBase * _qrule_msm
A qrule object for working on mortar segement elements.
Definition: Assembly.h:2556
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:3031
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiLower(FEType type) const
Definition: Assembly.h:2898
VariablePhiValue _phi_face_neighbor
Definition: Assembly.h:2685
libMesh::ElemSideBuilder _current_neighbor_side_elem_builder
In place side element builder for _current_neighbor_side_elem.
Definition: Assembly.h:2849
OutputTools< Real >::VariablePhiDivergence VariablePhiDivergence
Definition: MooseTypes.h:323
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:2607
const OutputTools< OutputType >::VariablePhiValue & fePhiNeighbor(FEType type) const
Definition: Assembly.h:1658
libMesh::QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition: Assembly.h:2380
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension&#39;s actual fe objects indexed on type.
Definition: Assembly.h:2372
const VariablePhiSecond & secondPhi(const MooseVariableField< Real > &) const
Definition: Assembly.h:1300
VariablePhiValue _phi_neighbor
Definition: Assembly.h:2681
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:2407
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1688
Real _current_side_volume
Volume of the current side element.
Definition: Assembly.h:2578
std::set< FEType > _need_div
Definition: Assembly.h:2838
VectorVariablePhiCurl _vector_curl_phi
Definition: Assembly.h:2693
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:2768
const bool _displaced
Definition: Assembly.h:2285
void buildVectorFE(FEType type) const
Build Vector FEs with a type.
Definition: Assembly.C:455
VectorVariablePhiCurl _vector_curl_phi_face_neighbor
Definition: Assembly.h:2711
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:4445
void reinitFVFace(const FaceInfo &fi)
Definition: Assembly.C:1860
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_lower
Vector FE objects for lower dimensional elements.
Definition: Assembly.h:2528
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:261
const Node * _current_node
The current node we are working with.
Definition: Assembly.h:2592
bool _building_helpers
Whether we are currently building the FE classes for the helpers.
Definition: Assembly.h:2346
bool _calculate_face_xyz
Definition: Assembly.h:2828
This is the XFEMInterface class.
Definition: XFEMInterface.h:37
bool hasStaticCondensation() const
Definition: Assembly.h:599
DGJacobianType
Definition: MooseTypes.h:749
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
Definition: MooseTypes.h:320
std::vector< ADReal > _ad_dxidx_map
Definition: Assembly.h:2806
std::vector< ADReal > _ad_dxidy_map
Definition: Assembly.h:2807
std::vector< VectorValue< ADReal > > _ad_d2xyzdxideta_map
Definition: Assembly.h:2801
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face_neighbor
Definition: Assembly.h:2746
void addJacobian(GlobalDataKey)
Adds all local Jacobian to the global Jacobian matrices.
Definition: Assembly.C:3877
MooseArray< Point > _current_normals
The current Normal vectors at the quadrature points.
Definition: Assembly.h:2500
void buildVectorFaceFE(FEType type) const
Build Vector FEs for a face with a type.
Definition: Assembly.C:486
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:4864
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:1284
const MooseArray< ADReal > & adJxWFace() const
Definition: Assembly.h:252
MooseArray< VectorValue< ADReal > > _ad_q_points
Definition: Assembly.h:2805
const VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1321
VectorVariablePhiGradient _vector_grad_phi_face
Definition: Assembly.h:2697
MooseArray< VectorValue< ADReal > > _ad_q_points_face
Definition: Assembly.h:2818
VariablePhiValue & phiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1562
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const libMesh::CouplingMatrix * _cm
Coupling matrices.
Definition: Assembly.h:2288
const VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1380
const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase &fe)
Attaches the current elem/volume quadrature rule to the given fe.
Definition: Assembly.h:1873
void hasScalingVector()
signals this object that a vector containing variable scaling factors should be used when doing resid...
Definition: Assembly.C:4579
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:1429
VariablePhiGradient & gradPhi(const MooseVariableField< Real > &)
Definition: Assembly.h:1436
OutputTools< RealVectorValue >::VariablePhiValue VectorVariablePhiValue
Definition: MooseTypes.h:336
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhi(FEType type) const
Definition: Assembly.h:1736
std::unique_ptr< libMesh::QBase > fv_face
finite volume face/flux quadrature rule (meshdim-1)
Definition: Assembly.h:2416
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_dual_lower
Definition: Assembly.h:2740
void zeroCachedJacobian(GlobalDataKey)
Zero out previously-cached Jacobian rows.
Definition: Assembly.C:4517
CoordinateSystemType
Definition: MooseTypes.h:809
const VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1390
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:2197
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:711
bool computingResidual() const
Definition: Assembly.h:1911
void activateDual()
Indicates that dual shape functions are used for mortar constraint.
Definition: Assembly.h:578
void prepareVariableNonlocal(MooseVariableFieldBase *var)
Definition: Assembly.C:2777
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face
Definition: Assembly.h:2736
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:2743
const VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &) const
Definition: Assembly.h:1308
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:3401
MooseArray< Real > _coord_msm
The coordinate transformation coefficients evaluated on the quadrature points of the mortar segment m...
Definition: Assembly.h:2544
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:1095
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Keg
Definition: Assembly.h:2650
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1575
bool _need_lower_d_elem_volume
Whether we need to compute the lower dimensional element volume.
Definition: Assembly.h:2605
LocalDataKey(const LocalDataKey &)
Definition: Assembly.h:839
void addStaticCondensation(libMesh::StaticCondensation &sc)
Set the static condensation object.
Definition: Assembly.h:594
bool _user_added_fe_face_of_helper_type
Definition: Assembly.h:2332
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:1086
VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1467
void buildVectorNeighborFE(FEType type) const
Build Vector FEs for a neighbor with a type.
Definition: Assembly.C:516
std::unique_ptr< ArbitraryQuadrature > arbitrary_vol
volume/elem (meshdim) custom points quadrature rule
Definition: Assembly.h:2418
void reinitFENeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition: Assembly.C:1632
const VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1364
void initNonlocalCoupling()
Create pair of variables requiring nonlocal jacobian contributions.
Definition: Assembly.C:2652
ConstraintJacobianType
Definition: MooseTypes.h:796
const VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1414
std::map< unsigned int, FEBase * > _holder_fe_face_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2488
const bool & _computing_jacobian
Whether we are currently computing the Jacobian.
Definition: Assembly.h:2295
void computeCurrentNeighborVolume()
VariablePhiSecond & secondPhiFace(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1557
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:2518
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:2236
void resize(const unsigned int new_m, const unsigned int new_n)
const OutputTools< OutputType >::VariablePhiValue & fePhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1680
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1457
void cacheJacobianNonlocal(GlobalDataKey)
Takes the values that are currently in _sub_Keg and appends them to the cached values.
Definition: Assembly.C:4095
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:1306
VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1443
VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1522
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_neighbor_helper
Definition: Assembly.h:2341
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:1003
void helpersRequestData()
request phi, dphi, xyz, JxW, etc.
Definition: Assembly.C:4831
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_nonlocal_entry
Entries in the coupling matrix for field variables for nonlocal calculations.
Definition: Assembly.h:2309
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:4467
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:2868
VectorVariablePhiSecond _vector_second_phi_face_neighbor
Definition: Assembly.h:2710
void buildLowerDFE(FEType type) const
Build FEs for a lower dimensional element with a type.
Definition: Assembly.C:360
unsigned int _current_side
The current side of the selected element (valid only when working with sides)
Definition: Assembly.h:2574
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:1419
void setCachedJacobian(GlobalDataKey)
Sets previously-cached Jacobian values via SparseMatrix::set() calls.
Definition: Assembly.C:4497
VariablePhiSecond _second_phi
Definition: Assembly.h:2719
std::map< unsigned int, FEBase * > _holder_fe_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2376
const libMesh::CouplingMatrix & _nonlocal_cm
Definition: Assembly.h:2289
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiNeighbor(FEType type) const
Definition: Assembly.h:1672
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:2570
const OutputTools< OutputType >::VariablePhiGradient & feGradDualPhiLower(FEType type) const
Definition: Assembly.h:2906
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFace(FEType type) const
Definition: Assembly.h:1650
void prepareVariable(MooseVariableFieldBase *var)
Used for preparing the dense residual and jacobian blocks for one particular variable.
Definition: Assembly.C:2749
const Elem * _current_neighbor_side_elem
The current side element of the ncurrent neighbor element.
Definition: Assembly.h:2586
DenseMatrix< Number > _element_matrix
A working matrix to avoid repeated heap allocations when caching Jacobians that must have libMesh-lev...
Definition: Assembly.h:2863
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:2022
void copyFaceShapes(MooseVariableField< T > &v)
Definition: Assembly.C:3037
std::vector< dof_id_type > _extra_elem_ids
Extra element IDs.
Definition: Assembly.h:2507
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:728
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:4235
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:3352
bool _current_side_volume_computed
Boolean to indicate whether current element side volumes has been computed.
Definition: Assembly.h:2598
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data_face
Definition: Assembly.h:2754
std::vector< dof_id_type > _column_indices
Definition: Assembly.h:2868
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:2227
std::unique_ptr< ArbitraryQuadrature > arbitrary_face
area/face (meshdim-1) custom points quadrature rule
Definition: Assembly.h:2420
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:146
const VariablePhiValue & phi(const MooseVariableField< Real > &) const
Definition: Assembly.h:1296
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:2899
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
Definition: Assembly.h:2517
void addJacobianNeighbor(GlobalDataKey)
Add ElementNeighbor, NeighborElement, and NeighborNeighbor portions of the Jacobian for compute objec...
Definition: Assembly.C:3912
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:2316
VectorVariablePhiDivergence _div_phi
Definition: Assembly.h:2731
VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1501
OutputTools< RealVectorValue >::VariablePhiCurl VectorVariablePhiCurl
Definition: MooseTypes.h:339
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:2558
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:1754
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:3694
bool computingJacobian() const
Definition: Assembly.h:1916
Real _current_neighbor_lower_d_elem_volume
The current neighboring lower dimensional element volume.
Definition: Assembly.h:2611
bool _need_neighbor_lower_d_elem_volume
Whether we need to compute the neighboring lower dimensional element volume.
Definition: Assembly.h:2609
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition: Assembly.h:2388
bool _user_added_fe_of_helper_type
Whether user code requested a FEType the same as our _helper_type.
Definition: Assembly.h:2331
void setLowerQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for lower dimensional integration.
Definition: Assembly.C:692
Moose::CoordinateSystemType _coord_type
The coordinate system.
Definition: Assembly.h:2392
void cacheJacobianMortar(GlobalDataKey)
Cache all portions of the Jacobian, e.g.
Definition: Assembly.C:4155
std::unique_ptr< ArbitraryQuadrature > neighbor
area/face (meshdim-1) custom points quadrature rule for DG
Definition: Assembly.h:2422
unsigned int n() const
void buildVectorFaceNeighborFE(FEType type) const
Build Vector FEs for a neighbor face with a type.
Definition: Assembly.C:546
void buildVectorDualLowerDFE(FEType type) const
Definition: Assembly.C:430
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:577
const SubdomainID & currentNeighborSubdomainID() const
Return the current subdomain ID.
Definition: Assembly.h:458
VectorVariablePhiSecond _vector_second_phi_neighbor
Definition: Assembly.h:2704
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:1831
Storage for all of the information pretaining to a vector tag.
Definition: VectorTag.h:17
VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1542
const Node *const & node() const
Returns the reference to the node.
Definition: Assembly.h:506
VariablePhiSecond _second_phi
Definition: Assembly.h:2675
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:2314
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiNeighbor(FEType type) const
Definition: Assembly.h:1665
std::map< unsigned int, FEBase * > _holder_fe_lower_helper
helper object for transforming coordinates for lower dimensional element quadrature points ...
Definition: Assembly.h:2530
const libMesh::DofMap & _dof_map
DOF map.
Definition: Assembly.h:2318
VectorVariablePhiDivergence _vector_div_phi
Definition: Assembly.h:2694
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:2114
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_neighbor
Definition: Assembly.h:2745
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:3553
std::vector< std::vector< dof_id_type > > _cached_jacobian_cols
Column where the corresponding cached value should go.
Definition: Assembly.h:2780
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
Definition: Assembly.C:3820
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition: Assembly.h:2496
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:3270
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:2924
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:600
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition: Assembly.h:437
const VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1338
const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase &fe)
Attaches the current face/area quadrature rule to the given fe.
Definition: Assembly.h:1885
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition: Assembly.h:2576
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:2785
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:1609
FEBase * _current_fe_helper
The current helper object for transforming coordinates.
Definition: Assembly.h:2378
bool _need_JxW_neighbor
Flag to indicate that JxW_neighbor is needed.
Definition: Assembly.h:2537
const VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1409
void copyNeighborShapes(MooseVariableField< T > &v)
Definition: Assembly.C:3074
void cacheJacobianCoupledVarPair(const MooseVariableBase &ivar, const MooseVariableBase &jvar)
Caches element matrix for ivar rows and jvar columns.
Definition: Assembly.C:4079
VectorVariablePhiSecond _vector_second_phi_face
Definition: Assembly.h:2698
const MooseArray< ADPoint > & adNormals() const
Definition: Assembly.h:354
VariablePhiGradient _grad_phi_face
Definition: Assembly.h:2678
MooseArray< Point > _current_q_points_face_neighbor
The current quadrature points on the neighbor face.
Definition: Assembly.h:2535
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:2847
const VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1368
VectorVariablePhiCurl _vector_curl_phi_face
Definition: Assembly.h:2699
bool _need_dual
Whether dual shape functions need to be computed for mortar constraints.
Definition: Assembly.h:2613
auto index_range(const T &sizable)
const std::vector< Real > & jxWMortar() const
Returns a reference to JxW for mortar segment elements.
Definition: Assembly.h:678
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:833
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:2858
std::set< FEType > _need_face_div
Definition: Assembly.h:2839
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:2568
const Elem *& sideElem()
Returns the side element.
Definition: Assembly.h:419
VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1497
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1583
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:2511
std::map< FEType, FEVectorBase * > _current_vector_fe_neighbor
The "neighbor" vector fe object that matches the current elem.
Definition: Assembly.h:2365
void clearCachedResiduals(GlobalDataKey)
Clears all of the residuals in _cached_residual_rows and _cached_residual_values. ...
Definition: Assembly.C:3505
unsigned int THREAD_ID
Definition: MooseTypes.h:209
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition: Assembly.h:2594
std::vector< VectorValue< ADReal > > _ad_d2xyzdeta2_map
Definition: Assembly.h:2802
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:3071
void clearCachedJacobian()
Clear any currently cached jacobians.
Definition: Assembly.C:4527
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:2712
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:1307
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knl
dprimary/dlower (or dneighbor/dlower)
Definition: Assembly.h:2667
const OutputTools< OutputType >::VariablePhiValue & fePhiFace(FEType type) const
Definition: Assembly.h:1630
VariablePhiValue & phi(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1548
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1444
VariablePhiGradient & gradPhi(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1549
void reinitFEFace(const Elem *elem, unsigned int side)
Just an internal helper function to reinit the face FE objects.
Definition: Assembly.C:1269
MooseArray< ADReal > _ad_JxW
Definition: Assembly.h:2804
MooseArray< ADReal > _ad_JxW_face
Definition: Assembly.h:2816
void computeFaceMap(const Elem &elem, const unsigned int side, const std::vector< Real > &qw)
Definition: Assembly.C:1349
VariablePhiValue & phiFace(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1552
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:2275
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:815