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 "MoosePassKey.h"
17 #include "ArbitraryQuadrature.h"
18 
19 #include "libmesh/dense_vector.h"
20 #include "libmesh/enum_quadrature_type.h"
21 #include "libmesh/fe_type.h"
22 #include "libmesh/point.h"
23 #include "libmesh/fe_base.h"
24 #include "libmesh/numeric_vector.h"
25 #include "libmesh/elem_side_builder.h"
26 
27 #include <unordered_map>
28 
29 // libMesh forward declarations
30 namespace libMesh
31 {
32 class DofMap;
33 class CouplingMatrix;
34 class Elem;
35 template <typename>
38 template <typename T>
42 class Node;
43 template <typename T>
44 class NumericVector;
45 template <typename T>
46 class SparseMatrix;
47 class StaticCondensation;
48 }
49 
50 // MOOSE Forward Declares
51 class FaceInfo;
52 class MooseMesh;
54 class SystemBase;
56 class MooseVariableBase;
57 template <typename>
58 class MooseVariableFE;
63 class XFEMInterface;
64 class SubProblem;
65 class NodeFaceConstraint;
66 
67 #ifdef MOOSE_KOKKOS_ENABLED
68 namespace Moose::Kokkos
69 {
70 class Assembly;
71 }
72 #endif
73 
74 // Assembly.h does not import Moose.h nor libMeshReducedNamespace.h
75 using libMesh::FEBase;
76 using libMesh::FEFamily;
77 using libMesh::FEType;
80 using libMesh::Order;
82 
91 template <typename P, typename C>
92 void coordTransformFactor(const SubProblem & s,
93  SubdomainID sub_id,
94  const P & point,
95  C & factor,
97 
98 template <typename P, typename C>
99 void coordTransformFactor(const MooseMesh & mesh,
100  SubdomainID sub_id,
101  const P & point,
102  C & factor,
104 
109 class Assembly
110 {
111 public:
112  Assembly(SystemBase & sys, THREAD_ID tid);
113  virtual ~Assembly();
114 
119  template <typename T>
120  static const T * const & constify_ref(T * const & inref)
121  {
122  const T * const * ptr = &inref;
123  return *ptr;
124  }
125 
132  const FEBase * const & getFE(FEType type, unsigned int dim) const
133  {
134  buildFE(type);
135  return constify_ref(_fe[dim][type]);
136  }
137 
144  const FEBase * const & getFENeighbor(FEType type, unsigned int dim) const
145  {
146  buildNeighborFE(type);
147  return constify_ref(_fe_neighbor[dim][type]);
148  }
149 
156  const FEBase * const & getFEFace(FEType type, unsigned int dim) const
157  {
158  buildFaceFE(type);
159  return constify_ref(_fe_face[dim][type]);
160  }
161 
168  const FEBase * const & getFEFaceNeighbor(FEType type, unsigned int dim) const
169  {
170  buildFaceNeighborFE(type);
171  return constify_ref(_fe_face_neighbor[dim][type]);
172  }
173 
180  const FEVectorBase * const & getVectorFE(FEType type, unsigned int dim) const
181  {
182  buildVectorFE(type);
183  return constify_ref(_vector_fe[dim][type]);
184  }
185 
192  const FEVectorBase * const & getVectorFENeighbor(FEType type, unsigned int dim) const
193  {
194  buildVectorNeighborFE(type);
195  return constify_ref(_vector_fe_neighbor[dim][type]);
196  }
197 
204  const FEVectorBase * const & getVectorFEFace(FEType type, unsigned int dim) const
205  {
206  buildVectorFaceFE(type);
207  return constify_ref(_vector_fe_face[dim][type]);
208  }
209 
216  const FEVectorBase * const & getVectorFEFaceNeighbor(FEType type, unsigned int dim) const
217  {
220  }
221 
222 #ifdef MOOSE_KOKKOS_ENABLED
223 
229 #endif
230 
235  const libMesh::QBase * const & qRule() const { return constify_ref(_current_qrule); }
236 
242 
243 #ifdef MOOSE_KOKKOS_ENABLED
244 
249  {
250  return qrules(dim, block).vol.get();
251  }
252 #endif
253 
258  const MooseArray<Point> & qPoints() const { return _current_q_points; }
259 
264  const std::vector<Point> & qPointsMortar() const { return _fe_msm->get_xyz(); }
265 
271 
276  const MooseArray<Real> & JxW() const { return _current_JxW; }
277 
278  const MooseArray<ADReal> & adJxW() const { return _ad_JxW; }
279 
280  const MooseArray<ADReal> & adJxWFace() const { return _ad_JxW_face; }
281 
282  const MooseArray<ADReal> & adCurvatures() const;
283 
288  const MooseArray<Real> & coordTransformation() const { return _coord; }
289 
295 
301  {
302  // Coord values for non-cartesian coordinate systems are functions of the locations of the
303  // quadrature points in physical space. We also have no way of knowing whether this was called
304  // from a volumetric or face object so we should set both volumetric and face xyz to true
305  _calculate_xyz = true;
306  _calculate_face_xyz = true;
307 
308  _calculate_ad_coord = true;
309  return _ad_coord;
310  }
311 
317 
322  const libMesh::QBase * const & qRuleFace() const { return constify_ref(_current_qrule_face); }
323 
329 
330 #ifdef MOOSE_KOKKOS_ENABLED
331 
336  {
337  return qrules(dim, block).face.get();
338  }
339 #endif
340 
346 
351  const MooseArray<Real> & JxWFace() const { return _current_JxW_face; }
352 
357  const MooseArray<Point> & normals() const { return _current_normals; }
358 
359  /***
360  * Returns the array of normals for quadrature points on a current side
361  */
362  const std::vector<Eigen::Map<RealDIMValue>> & mappedNormals() const { return _mapped_normals; }
363 
369 
373  unsigned int numExtraElemIntegers() const { return _extra_elem_ids.size() - 1; }
374 
378  const dof_id_type & extraElemID(unsigned int id) const
379  {
380  mooseAssert(id < _extra_elem_ids.size(), "An invalid extra element integer id");
381  return _extra_elem_ids[id];
382  }
383 
387  const dof_id_type & extraElemIDNeighbor(unsigned int id) const
388  {
389  mooseAssert(id < _neighbor_extra_elem_ids.size(), "An invalid extra element integer id");
390  return _neighbor_extra_elem_ids[id];
391  }
392 
393  const MooseArray<ADPoint> & adNormals() const { return _ad_normals; }
394 
396  {
397  _calculate_xyz = true;
398  return _ad_q_points;
399  }
400 
402  {
403  _calculate_face_xyz = true;
404  return _ad_q_points_face;
405  }
406 
407  template <bool is_ad>
409 
414  const Elem * const & elem() const { return _current_elem; }
415 
420 
425 
430 
435 
440  const Real & elemVolume() const { return _current_elem_volume; }
441 
446  const unsigned int & side() const { return _current_side; }
447 
452  const unsigned int & neighborSide() const { return _current_neighbor_side; }
453 
458  const Elem *& sideElem() { return _current_side_elem; }
459 
464  const Real & sideElemVolume() const { return _current_side_volume; }
465 
470  const Elem * const & neighbor() const { return _current_neighbor_elem; }
471 
476  const Elem * const & lowerDElem() const { return _current_lower_d_elem; }
477 
482  const Elem * const & neighborLowerDElem() const { return _current_neighbor_lower_d_elem; }
483 
484  /*
485  * @return The current lower-dimensional element volume
486  */
487  const Real & lowerDElemVolume() const;
488 
489  /*
490  * @return The current neighbor lower-dimensional element volume
491  */
492  const Real & neighborLowerDElemVolume() const;
493 
498 
503 
509  {
512  }
513 
518  const libMesh::QBase * const & qRuleNeighbor() const
519  {
521  }
522 
528 
533  const MooseArray<Real> & JxWNeighbor() const;
534 
540 
545  const Node * const & node() const { return _current_node; }
546 
551  const Node * const & nodeNeighbor() const { return _current_neighbor_node; }
552 
561  void createQRules(QuadratureType type,
562  Order order,
563  Order volume_order,
564  Order face_order,
565  SubdomainID block,
566  bool allow_negative_qweights = true);
567 
574  void bumpVolumeQRuleOrder(Order volume_order, SubdomainID block);
575 
583  void bumpAllQRuleOrder(Order order, SubdomainID block);
584 
593  void setVolumeQRule(libMesh::QBase * qrule, unsigned int dim);
594 
603  void setFaceQRule(libMesh::QBase * qrule, unsigned int dim);
604 
612  void setMortarQRule(Order order);
613 
617  void activateDual() { _need_dual = true; }
618 
623  bool needDual() const { return _need_dual; }
624 
628  void clearCachedQRules();
629 
630 private:
637  void setLowerQRule(libMesh::QBase * qrule, unsigned int dim);
638 
639 public:
648  void setNeighborQRule(libMesh::QBase * qrule, unsigned int dim);
649 
655  void reinit(const Elem * elem);
656 
660  void setVolumeQRule(const Elem * elem);
661 
666  void reinitElemFaceRef(const Elem * elem,
667  unsigned int elem_side,
668  Real tolerance,
669  const std::vector<Point> * const pts = nullptr,
670  const std::vector<Real> * const weights = nullptr);
671 
676  void reinitNeighborFaceRef(const Elem * neighbor_elem,
677  unsigned int neighbor_side,
678  Real tolerance,
679  const std::vector<Point> * const pts,
680  const std::vector<Real> * const weights = nullptr);
681 
685  void reinitDual(const Elem * elem, const std::vector<Point> & pts, const std::vector<Real> & JxW);
686 
690  void reinitLowerDElem(const Elem * elem,
691  const std::vector<Point> * const pts = nullptr,
692  const std::vector<Real> * const weights = nullptr);
693 
697  void reinitNeighborLowerDElem(const Elem * elem);
698 
702  void reinitMortarElem(const Elem * elem);
703 
707  const std::vector<Real> & jxWMortar() const { return *_JxW_msm; }
708 
712  const libMesh::QBase * const & qRuleMortar() const { return constify_ref(_qrule_msm); }
713 
714 private:
718  void computeADFace(const Elem & elem, const unsigned int side);
719 
720 public:
724  void reinitAtPhysical(const Elem * elem, const std::vector<Point> & physical_points);
725 
729  void reinit(const Elem * elem, const std::vector<Point> & reference_points);
730 
734  void setFaceQRule(const Elem * const elem, const unsigned int side);
735 
739  void reinit(const Elem * elem, unsigned int side);
740 
744  void reinit(const Elem * elem, unsigned int side, const std::vector<Point> & reference_points);
745 
746  void reinitFVFace(const FaceInfo & fi);
747 
759  void reinitElemAndNeighbor(const Elem * elem,
760  unsigned int side,
761  const Elem * neighbor,
762  unsigned int neighbor_side,
763  const std::vector<Point> * neighbor_reference_points = nullptr);
764 
768  void reinitNeighborAtPhysical(const Elem * neighbor,
769  unsigned int neighbor_side,
770  const std::vector<Point> & physical_points);
771 
775  void reinitNeighborAtPhysical(const Elem * neighbor, const std::vector<Point> & physical_points);
776 
780  void reinitNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
781 
785  void reinit(const Node * node);
786 
790  void init(const libMesh::CouplingMatrix * cm);
791 
793  void initNonlocalCoupling();
794 
796  void prepareJacobianBlock();
797 
799  void prepareResidual();
800 
801  void prepare();
802  void prepareNonlocal();
803 
811  void prepareNeighbor();
812 
817  void prepareLowerD();
818 
819  void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector<dof_id_type> & dof_indices);
820  void prepareBlockNonlocal(unsigned int ivar,
821  unsigned jvar,
822  const std::vector<dof_id_type> & idof_indices,
823  const std::vector<dof_id_type> & jdof_indices);
824  void prepareScalar();
825  void prepareOffDiagScalar();
826 
827  template <typename T>
829  void copyShapes(unsigned int var);
830 
831  template <typename T>
833  void copyFaceShapes(unsigned int var);
834 
835  template <typename T>
837  void copyNeighborShapes(unsigned int var);
838 
845  {
846  // Blessed classes
847  friend class Assembly;
848  friend class SubProblem;
849  friend class FEProblemBase;
850  friend class DisplacedProblem;
851  friend class ComputeMortarFunctor;
852  friend class NonlinearSystemBase;
855  };
856 
863  {
864  // Blessed classes
865  friend class Assembly;
866  friend class TaggingInterface;
869  };
870 
875  void addResidual(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
880  void addResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
885  void addResidualLower(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
886 
891  void addResidualScalar(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
892 
897  void cacheResidual(GlobalDataKey, const std::vector<VectorTag> & tags);
898 
903  void cacheResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & tags);
904 
908  void cacheResidualLower(GlobalDataKey, const std::vector<VectorTag> & tags);
909 
915  void addCachedResiduals(GlobalDataKey, const std::vector<VectorTag> & tags);
916 
925  void clearCachedResiduals(GlobalDataKey);
926 
935  GlobalDataKey,
936  const VectorTag & vector_tag);
937 
941  void setResidual(NumericVector<Number> & residual, GlobalDataKey, const VectorTag & vector_tag);
942 
947  GlobalDataKey,
948  const VectorTag & vector_tag);
949 
953  void addJacobian(GlobalDataKey);
954 
958  void addJacobianNonlocal(GlobalDataKey);
959 
964  void addJacobianNeighbor(GlobalDataKey);
965 
969  void addJacobianScalar(GlobalDataKey);
970 
975  void addJacobianOffDiagScalar(unsigned int ivar, GlobalDataKey);
976 
981  unsigned int ivar,
982  unsigned int jvar,
983  const libMesh::DofMap & dof_map,
984  std::vector<dof_id_type> & dof_indices,
985  GlobalDataKey,
986  TagID tag);
987 
993  unsigned int ivar,
994  unsigned int jvar,
995  const libMesh::DofMap & dof_map,
996  std::vector<dof_id_type> & dof_indices,
997  GlobalDataKey,
998  const std::set<TagID> & tags);
999 
1004  unsigned int ivar,
1005  unsigned int jvar,
1006  const libMesh::DofMap & dof_map,
1007  const std::vector<dof_id_type> & idof_indices,
1008  const std::vector<dof_id_type> & jdof_indices,
1009  GlobalDataKey,
1010  TagID tag);
1011 
1016  unsigned int ivar,
1017  unsigned int jvar,
1018  const libMesh::DofMap & dof_map,
1019  const std::vector<dof_id_type> & idof_indices,
1020  const std::vector<dof_id_type> & jdof_indices,
1021  GlobalDataKey,
1022  const std::set<TagID> & tags);
1023 
1032  void addJacobianNeighborLowerD(GlobalDataKey);
1033 
1039  void addJacobianLowerD(GlobalDataKey);
1040 
1049  void cacheJacobianMortar(GlobalDataKey);
1050 
1056  unsigned int ivar,
1057  unsigned int jvar,
1058  const libMesh::DofMap & dof_map,
1059  std::vector<dof_id_type> & dof_indices,
1060  std::vector<dof_id_type> & neighbor_dof_indices,
1061  GlobalDataKey,
1062  TagID tag);
1063 
1069  unsigned int ivar,
1070  unsigned int jvar,
1071  const libMesh::DofMap & dof_map,
1072  std::vector<dof_id_type> & dof_indices,
1073  std::vector<dof_id_type> & neighbor_dof_indices,
1074  GlobalDataKey,
1075  const std::set<TagID> & tags);
1076 
1080  void cacheJacobian(GlobalDataKey);
1081 
1085  void cacheJacobianNonlocal(GlobalDataKey);
1086 
1091  void cacheJacobianNeighbor(GlobalDataKey);
1092 
1099  void addCachedJacobian(GlobalDataKey);
1100 
1104  void setCachedJacobian(GlobalDataKey);
1105 
1109  void zeroCachedJacobian(GlobalDataKey);
1110 
1115  DenseVector<Number> & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
1116  {
1117  return _sub_Re[tag_id][var_num];
1118  }
1119 
1125  {
1126  return _sub_Rn[tag_id][var_num];
1127  }
1128 
1134  {
1135  return _sub_Rl[tag_id][var_num];
1136  }
1137 
1142  DenseMatrix<Number> & jacobianBlock(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1143  {
1144  jacobianBlockUsed(tag, ivar, jvar, true);
1145  return _sub_Kee[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1146  }
1147 
1153  jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1154  {
1155  jacobianBlockNonlocalUsed(tag, ivar, jvar, true);
1156  return _sub_Keg[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1157  }
1158 
1164  Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag);
1165 
1174  unsigned int ivar,
1175  unsigned int jvar,
1176  LocalDataKey,
1177  TagID tag);
1178 
1183  void cacheResidualNodes(const DenseVector<Number> & res,
1184  const std::vector<dof_id_type> & dof_index,
1185  LocalDataKey,
1186  TagID tag);
1187 
1199  void
1200  cacheJacobian(numeric_index_type i, numeric_index_type j, Real value, LocalDataKey, TagID tag);
1201 
1215  Real value,
1216  LocalDataKey,
1217  const std::set<TagID> & tags);
1218 
1225  void cacheJacobianBlock(DenseMatrix<Number> & jac_block,
1226  const std::vector<dof_id_type> & idof_indices,
1227  const std::vector<dof_id_type> & jdof_indices,
1228  Real scaling_factor,
1229  LocalDataKey,
1230  TagID tag);
1231 
1241  template <typename Residuals, typename Indices>
1242  void cacheResiduals(const Residuals & residuals,
1243  const Indices & row_indices,
1244  Real scaling_factor,
1245  LocalDataKey,
1246  const std::set<TagID> & vector_tags);
1247 
1255  template <typename Residuals, typename Indices>
1256  void cacheJacobian(const Residuals & residuals,
1257  const Indices & row_indices,
1258  Real scaling_factor,
1259  LocalDataKey,
1260  const std::set<TagID> & matrix_tags);
1261 
1272  template <typename Residuals, typename Indices>
1273  void cacheResidualsWithoutConstraints(const Residuals & residuals,
1274  const Indices & row_indices,
1275  Real scaling_factor,
1276  LocalDataKey,
1277  const std::set<TagID> & vector_tags);
1278 
1286  template <typename Residuals, typename Indices>
1287  void cacheJacobianWithoutConstraints(const Residuals & residuals,
1288  const Indices & row_indices,
1289  Real scaling_factor,
1290  LocalDataKey,
1291  const std::set<TagID> & matrix_tags);
1292 
1293  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> & couplingEntries()
1294  {
1295  return _cm_ff_entry;
1296  }
1297  const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1299  {
1300  return _cm_ff_entry;
1301  }
1302  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1304  {
1305  return _cm_nonlocal_entry;
1306  }
1307  const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> &
1309  {
1310  return _cm_fs_entry;
1311  }
1312  const std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> &
1314  {
1315  return _cm_sf_entry;
1316  }
1317 
1318  // Read-only references
1319  const VariablePhiValue & phi() const { return _phi; }
1320  template <typename T>
1322  {
1323  return _ad_grad_phi_data.at(v.feType());
1324  }
1325  const VariablePhiValue & phi(const MooseVariableField<Real> &) const { return _phi; }
1326  const VariablePhiGradient & gradPhi() const { return _grad_phi; }
1328  const VariablePhiSecond & secondPhi() const { return _second_phi; }
1330  {
1331  return _second_phi;
1332  }
1333 
1334  const VariablePhiValue & phiFace() const { return _phi_face; }
1335  const VariablePhiValue & phiFace(const MooseVariableField<Real> &) const { return _phi_face; }
1336  const VariablePhiGradient & gradPhiFace() const { return _grad_phi_face; }
1338  {
1339  return _grad_phi_face;
1340  }
1342  {
1343  return _second_phi_face;
1344  }
1345 
1347  {
1348  return _phi_neighbor;
1349  }
1351  {
1352  return _grad_phi_neighbor;
1353  }
1355  {
1356  return _second_phi_neighbor;
1357  }
1358 
1360  {
1361  return _phi_face_neighbor;
1362  }
1364  {
1365  return _grad_phi_face_neighbor;
1366  }
1368  {
1370  }
1371 
1373  {
1374  return _vector_phi;
1375  }
1377  {
1378  return _vector_grad_phi;
1379  }
1381  {
1382  return _vector_second_phi;
1383  }
1385  {
1386  return _vector_curl_phi;
1387  }
1389  {
1390  return _vector_div_phi;
1391  }
1392 
1394  {
1395  return _vector_phi_face;
1396  }
1398  {
1399  return _vector_grad_phi_face;
1400  }
1402  {
1403  return _vector_second_phi_face;
1404  }
1406  {
1407  return _vector_curl_phi_face;
1408  }
1410  {
1411  return _vector_div_phi_face;
1412  }
1413 
1415  {
1416  return _vector_phi_neighbor;
1417  }
1420  {
1422  }
1423  const VectorVariablePhiSecond &
1425  {
1427  }
1429  {
1431  }
1434  {
1435  return _vector_div_phi_neighbor;
1436  }
1437 
1439  {
1441  }
1444  {
1446  }
1447  const VectorVariablePhiSecond &
1449  {
1451  }
1452  const VectorVariablePhiCurl &
1454  {
1456  }
1459  {
1461  }
1462 
1463  // Writeable references
1467 
1471 
1474  {
1475  return _grad_phi_neighbor;
1476  }
1478  {
1479  return _second_phi_neighbor;
1480  }
1481 
1483  {
1484  return _phi_face_neighbor;
1485  }
1487  {
1488  return _grad_phi_face_neighbor;
1489  }
1491  {
1493  }
1494 
1495  // Writeable references with vector variable
1498  {
1499  return _vector_grad_phi;
1500  }
1502  {
1503  return _vector_second_phi;
1504  }
1506  {
1507  return _vector_curl_phi;
1508  }
1510  {
1511  return _vector_div_phi;
1512  }
1513 
1515  {
1516  return _vector_phi_face;
1517  }
1519  {
1520  return _vector_grad_phi_face;
1521  }
1523  {
1524  return _vector_second_phi_face;
1525  }
1527  {
1528  return _vector_curl_phi_face;
1529  }
1531  {
1532  return _vector_div_phi_face;
1533  }
1534 
1536  {
1537  return _vector_phi_neighbor;
1538  }
1540  {
1542  }
1544  {
1546  }
1548  {
1550  }
1552  {
1553  return _vector_div_phi_neighbor;
1554  }
1556  {
1558  }
1560  {
1562  }
1564  {
1566  }
1568  {
1570  }
1572  {
1574  }
1575 
1576  // Writeable references with array variable
1580 
1583  {
1584  return _grad_phi_face;
1585  }
1587  {
1588  return _second_phi_face;
1589  }
1590 
1592  {
1593  return _phi_neighbor;
1594  }
1596  {
1597  return _grad_phi_neighbor;
1598  }
1600  {
1601  return _second_phi_neighbor;
1602  }
1603 
1605  {
1606  return _phi_face_neighbor;
1607  }
1609  {
1610  return _grad_phi_face_neighbor;
1611  }
1613  {
1615  }
1616 
1617  template <typename OutputType>
1619  {
1620  buildFE(type);
1621  return _fe_shape_data[type]->_phi;
1622  }
1623 
1624  template <typename OutputType>
1626  {
1627  buildFE(type);
1628  return _fe_shape_data[type]->_grad_phi;
1629  }
1630 
1631  template <typename OutputType>
1633  {
1634  return _ad_grad_phi_data[type];
1635  }
1636 
1637  template <typename OutputType>
1639  {
1640  _need_second_derivative.insert(type);
1641  buildFE(type);
1642  return _fe_shape_data[type]->_second_phi;
1643  }
1644 
1645  template <typename OutputType>
1646  const typename OutputTools<OutputType>::VariablePhiValue & fePhiLower(FEType type) const;
1647 
1648  template <typename OutputType>
1650 
1651  template <typename OutputType>
1653 
1654  template <typename OutputType>
1656  feGradDualPhiLower(FEType type) const;
1657 
1658  template <typename OutputType>
1660  {
1661  buildFaceFE(type);
1662  return _fe_shape_data_face[type]->_phi;
1663  }
1664 
1665  template <typename OutputType>
1667  {
1668  buildFaceFE(type);
1669  return _fe_shape_data_face[type]->_grad_phi;
1670  }
1671 
1672  template <typename OutputType>
1674  {
1675  return _ad_grad_phi_data_face[type];
1676  }
1677 
1678  template <typename OutputType>
1680  {
1681  _need_second_derivative.insert(type);
1682  buildFaceFE(type);
1683  return _fe_shape_data_face[type]->_second_phi;
1684  }
1685 
1686  template <typename OutputType>
1688  {
1689  buildNeighborFE(type);
1690  return _fe_shape_data_neighbor[type]->_phi;
1691  }
1692 
1693  template <typename OutputType>
1695  {
1696  buildNeighborFE(type);
1697  return _fe_shape_data_neighbor[type]->_grad_phi;
1698  }
1699 
1700  template <typename OutputType>
1702  {
1703  _need_second_derivative_neighbor.insert(type);
1704  buildNeighborFE(type);
1705  return _fe_shape_data_neighbor[type]->_second_phi;
1706  }
1707 
1708  template <typename OutputType>
1710  {
1711  buildFaceNeighborFE(type);
1712  return _fe_shape_data_face_neighbor[type]->_phi;
1713  }
1714 
1715  template <typename OutputType>
1718  {
1719  buildFaceNeighborFE(type);
1720  return _fe_shape_data_face_neighbor[type]->_grad_phi;
1721  }
1722 
1723  template <typename OutputType>
1726  {
1727  _need_second_derivative_neighbor.insert(type);
1728  buildFaceNeighborFE(type);
1729  return _fe_shape_data_face_neighbor[type]->_second_phi;
1730  }
1731 
1732  template <typename OutputType>
1734  {
1735  _need_curl.insert(type);
1736  buildFE(type);
1737  return _fe_shape_data[type]->_curl_phi;
1738  }
1739 
1740  template <typename OutputType>
1742  {
1743  _need_curl.insert(type);
1744  buildFaceFE(type);
1745  return _fe_shape_data_face[type]->_curl_phi;
1746  }
1747 
1748  template <typename OutputType>
1750  {
1751  _need_curl.insert(type);
1752  buildNeighborFE(type);
1753  return _fe_shape_data_neighbor[type]->_curl_phi;
1754  }
1755 
1756  template <typename OutputType>
1758  {
1759  _need_curl.insert(type);
1760  buildFaceNeighborFE(type);
1761  return _fe_shape_data_face_neighbor[type]->_curl_phi;
1762  }
1763 
1764  template <typename OutputType>
1766  {
1767  buildFE(type);
1768  return _fe_shape_data[type]->_div_phi;
1769  }
1770 
1771  template <typename OutputType>
1773  {
1774  buildFaceFE(type);
1775  return _fe_shape_data_face[type]->_div_phi;
1776  }
1777 
1778  template <typename OutputType>
1781  {
1782  buildNeighborFE(type);
1783  return _fe_shape_data_neighbor[type]->_div_phi;
1784  }
1785 
1786  template <typename OutputType>
1789  {
1790  buildFaceNeighborFE(type);
1791  return _fe_shape_data_face_neighbor[type]->_div_phi;
1792  }
1793 
1795  Real elementVolume(const Elem * elem) const;
1796 
1800  void setXFEM(std::shared_ptr<XFEMInterface> xfem) { _xfem = xfem; }
1801 
1805  void assignDisplacements(
1806  std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions);
1807 
1817  unsigned int i,
1818  unsigned int ntest,
1819  const RealEigenVector & v) const
1820  {
1821  for (unsigned int j = 0; j < v.size(); ++j, i += ntest)
1822  re(i) += v(j);
1823  }
1824 
1825  void saveLocalADArray(std::vector<ADReal> & re,
1826  unsigned int i,
1827  unsigned int ntest,
1828  const ADRealEigenVector & v) const
1829  {
1830  for (unsigned int j = 0; j < v.size(); ++j, i += ntest)
1831  re[i] += v(j);
1832  }
1833 
1845  unsigned int i,
1846  unsigned int ntest,
1847  unsigned int j,
1848  unsigned int nphi,
1849  unsigned int ivar,
1850  const RealEigenVector & v) const
1851  {
1852  unsigned int pace = (_component_block_diagonal[ivar] ? 0 : nphi);
1853  for (unsigned int k = 0; k < v.size(); ++k, i += ntest, j += pace)
1854  ke(i, j) += v(k);
1855  }
1856 
1870  unsigned int i,
1871  unsigned int ntest,
1872  unsigned int j,
1873  unsigned int nphi,
1874  unsigned int ivar,
1875  unsigned int jvar,
1876  const RealEigenMatrix & v) const
1877  {
1878  if (ivar == jvar && _component_block_diagonal[ivar])
1879  {
1880  for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1881  ke(i, j) += v(k, k);
1882  }
1883  else
1884  {
1885  const unsigned int saved_j = j;
1886  for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1887  {
1888  j = saved_j;
1889  for (unsigned int l = 0; l < v.cols(); ++l, j += nphi)
1890  ke(i, j) += v(k, l);
1891  }
1892  }
1893  }
1894 
1896  {
1897  unsigned int rows = ke.m();
1898  unsigned int cols = ke.n();
1899  DenseVector<Real> diag(rows);
1900  for (unsigned int i = 0; i < rows; i++)
1901  // % operation is needed to account for cases of no component coupling of array variables
1902  diag(i) = ke(i, i % cols);
1903  return diag;
1904  }
1905 
1911  inline const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase & fe)
1912  {
1913  auto qrule = qrules(dim).vol.get();
1914  fe.attach_quadrature_rule(qrule);
1915  return qrule;
1916  }
1917 
1923  inline const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase & fe)
1924  {
1925  auto qrule = qrules(dim).face.get();
1926  fe.attach_quadrature_rule(qrule);
1927  return qrule;
1928  }
1929 
1934  void hasScalingVector();
1935 
1944  void modifyArbitraryWeights(const std::vector<Real> & weights);
1945 
1949  bool computingResidual() const { return _computing_residual; }
1950 
1954  bool computingJacobian() const { return _computing_jacobian; }
1955 
1960 
1964  const Elem * const & msmElem() const { return _msm_elem; }
1965 
1975  void havePRefinement(const std::unordered_set<FEFamily> & disable_p_refinement_for_families);
1976 
1980  void setCurrentLowerDElem(const Elem * const lower_d_elem);
1981 
1982 private:
1988  void reinitFE(const Elem * elem);
1989 
1996  void reinitFEFace(const Elem * elem, unsigned int side);
1997 
1998  void computeFaceMap(const Elem & elem, const unsigned int side, const std::vector<Real> & qw);
1999 
2000  void reinitFEFaceNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
2001 
2002  void reinitFENeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
2003 
2004  template <typename Points, typename Coords>
2005  void setCoordinateTransformation(const libMesh::QBase * qrule,
2006  const Points & q_points,
2007  Coords & coord,
2008  SubdomainID sub_id);
2009 
2010  void computeCurrentElemVolume();
2011 
2012  void computeCurrentFaceVolume();
2013 
2015 
2021  void modifyWeightsDueToXFEM(const Elem * elem);
2022 
2029  void modifyFaceWeightsDueToXFEM(const Elem * elem, unsigned int side = 0);
2030 
2035  template <typename OutputType>
2036  void computeGradPhiAD(const Elem * elem,
2037  unsigned int n_qp,
2040 
2044  void resizeADMappingObjects(unsigned int n_qp, unsigned int dim);
2045 
2050  void
2051  computeSinglePointMapAD(const Elem * elem, const std::vector<Real> & qw, unsigned p, FEBase * fe);
2052 
2056  void addResidual(const VectorTag & vector_tag);
2060  void addResidualNeighbor(const VectorTag & vector_tag);
2065  void addResidualLower(const VectorTag & vector_tag);
2069  void addResidualScalar(const VectorTag & vector_tag);
2070 
2074  void clearCachedResiduals(const VectorTag & vector_tag);
2075 
2084  void cacheResidual(dof_id_type dof, Real value, TagID tag_id);
2085 
2094  void cacheResidual(dof_id_type dof, Real value, const std::set<TagID> & tags);
2095 
2100  void processLocalResidual(DenseVector<Number> & res_block,
2101  std::vector<dof_id_type> & dof_indices,
2102  const std::vector<Real> & scaling_factor);
2103 
2107  void addResidualBlock(NumericVector<Number> & residual,
2108  DenseVector<Number> & res_block,
2109  const std::vector<dof_id_type> & dof_indices,
2110  const std::vector<Real> & scaling_factor);
2111 
2115  void cacheResidualBlock(std::vector<Real> & cached_residual_values,
2116  std::vector<dof_id_type> & cached_residual_rows,
2117  DenseVector<Number> & res_block,
2118  const std::vector<dof_id_type> & dof_indices,
2119  const std::vector<Real> & scaling_factor);
2120 
2124  void setResidualBlock(NumericVector<Number> & residual,
2125  DenseVector<Number> & res_block,
2126  const std::vector<dof_id_type> & dof_indices,
2127  const std::vector<Real> & scaling_factor);
2128 
2133  DenseMatrix<Number> & jac_block,
2134  const MooseVariableBase & ivar,
2135  const MooseVariableBase & jvar,
2136  const std::vector<dof_id_type> & idof_indices,
2137  const std::vector<dof_id_type> & jdof_indices);
2138 
2142  void cacheJacobianBlock(DenseMatrix<Number> & jac_block,
2143  const MooseVariableBase & ivar,
2144  const MooseVariableBase & jvar,
2145  const std::vector<dof_id_type> & idof_indices,
2146  const std::vector<dof_id_type> & jdof_indices,
2147  TagID tag);
2148 
2153  const MooseVariableBase & ivar,
2154  const MooseVariableBase & jvar,
2155  const std::vector<dof_id_type> & idof_indices,
2156  const std::vector<dof_id_type> & jdof_indices,
2157  TagID tag);
2158 
2162  void addJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2163 
2167  void cacheJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2168 
2174  void clearCachedJacobian();
2175 
2180  void buildFE(FEType type) const;
2181 
2186  void buildFaceFE(FEType type) const;
2187 
2192  void buildNeighborFE(FEType type) const;
2193 
2198  void buildFaceNeighborFE(FEType type) const;
2199 
2204  void buildLowerDFE(FEType type) const;
2205 
2206  void buildLowerDDualFE(FEType type) const;
2207 
2212  void buildVectorFE(FEType type) const;
2213 
2218  void buildVectorFaceFE(FEType type) const;
2219 
2224  void buildVectorNeighborFE(FEType type) const;
2225 
2230  void buildVectorFaceNeighborFE(FEType type) const;
2231 
2236  void buildVectorLowerDFE(FEType type) const;
2237  void buildVectorDualLowerDFE(FEType type) const;
2238 
2243  void jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2244  {
2245  _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2246  }
2247 
2252  char jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2253  {
2254  return _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2255  }
2256 
2261  void jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2262  {
2263  _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2264  }
2265 
2270  char jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2271  {
2272  return _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2273  }
2274 
2279  void jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2280  {
2281  _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2282  }
2283 
2288  char jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2289  {
2290  return _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2291  }
2292 
2297  void jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2298  {
2299  _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2300  }
2301 
2306  char jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2307  {
2308  return _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2309  }
2310 
2314  void helpersRequestData();
2315 
2318 
2319  const bool _displaced;
2320 
2324 
2326  const bool & _computing_residual;
2327 
2329  const bool & _computing_jacobian;
2330 
2333 
2335  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_ff_entry;
2337  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> _cm_fs_entry;
2339  std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> _cm_sf_entry;
2341  std::vector<std::pair<MooseVariableScalar *, MooseVariableScalar *>> _cm_ss_entry;
2343  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_nonlocal_entry;
2345  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_used;
2346  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_nonlocal_used;
2348  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_neighbor_used;
2350  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_lower_used;
2355 
2357 
2358  unsigned int _mesh_dimension;
2359 
2363 
2370 
2373  std::vector<std::unique_ptr<FEBase>> _unique_fe_helper;
2374  std::vector<std::unique_ptr<FEBase>> _unique_fe_face_helper;
2375  std::vector<std::unique_ptr<FEBase>> _unique_fe_face_neighbor_helper;
2376  std::vector<std::unique_ptr<FEBase>> _unique_fe_neighbor_helper;
2377  std::vector<std::unique_ptr<FEBase>> _unique_fe_lower_helper;
2378 
2381 
2383  std::shared_ptr<XFEMInterface> _xfem;
2384 
2386  std::map<FEType, FEBase *> _current_fe;
2388  std::map<FEType, FEBase *> _current_fe_face;
2390  std::map<FEType, FEBase *> _current_fe_neighbor;
2392  std::map<FEType, FEBase *> _current_fe_face_neighbor;
2393 
2395  std::map<FEType, FEVectorBase *> _current_vector_fe;
2397  std::map<FEType, FEVectorBase *> _current_vector_fe_face;
2399  std::map<FEType, FEVectorBase *> _current_vector_fe_neighbor;
2401  std::map<FEType, FEVectorBase *> _current_vector_fe_face_neighbor;
2402 
2403  /**** Volume Stuff ****/
2404 
2406  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe;
2408  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe;
2410  std::map<unsigned int, FEBase *> _holder_fe_helper;
2431 
2434  struct QRules
2435  {
2437  : vol(nullptr),
2438  face(nullptr),
2439  arbitrary_vol(nullptr),
2440  arbitrary_face(nullptr),
2441  neighbor(nullptr)
2442  {
2443  }
2444 
2446  std::unique_ptr<libMesh::QBase> vol;
2448  std::unique_ptr<libMesh::QBase> face;
2450  std::unique_ptr<libMesh::QBase> fv_face;
2452  std::unique_ptr<ArbitraryQuadrature> arbitrary_vol;
2454  std::unique_ptr<ArbitraryQuadrature> arbitrary_face;
2456  std::unique_ptr<ArbitraryQuadrature> neighbor;
2457  };
2458 
2463  std::unordered_map<SubdomainID, std::vector<QRules>> _qrules;
2464 
2471  libMesh::QBase * qruleFace(const Elem * elem, unsigned int side);
2472  ArbitraryQuadrature * qruleArbitraryFace(const Elem * elem, unsigned int side);
2473 
2474  template <typename T>
2475  T * qruleFaceHelper(const Elem * elem, unsigned int side, std::function<T *(QRules &)> rule_fn)
2476  {
2477  auto dim = elem->dim();
2478  auto neighbor = elem->neighbor_ptr(side);
2479  auto q = rule_fn(qrules(dim, elem->subdomain_id()));
2480  if (!neighbor)
2481  return q;
2482 
2483  // find the maximum face quadrature order for all blocks the face is in
2484  auto neighbor_block = neighbor->subdomain_id();
2485  if (neighbor_block == elem->subdomain_id())
2486  return q;
2487 
2488  auto q_neighbor = rule_fn(qrules(dim, neighbor_block));
2489  if (q->get_order() > q_neighbor->get_order())
2490  return q;
2491  return q_neighbor;
2492  }
2493 
2494  inline QRules & qrules(unsigned int dim) { return qrules(dim, _current_subdomain_id); }
2495 
2499  inline QRules & qrules(unsigned int dim, SubdomainID block)
2500  {
2501  if (_qrules.find(block) == _qrules.end())
2502  {
2503  mooseAssert(_qrules.find(Moose::ANY_BLOCK_ID) != _qrules.end(),
2504  "missing quadrature rules for specified block");
2505  mooseAssert(_qrules[Moose::ANY_BLOCK_ID].size() > dim,
2506  "quadrature rules not sized property for dimension");
2507  return _qrules[Moose::ANY_BLOCK_ID][dim];
2508  }
2509  mooseAssert(_qrules.find(block) != _qrules.end(),
2510  "missing quadrature rules for specified block");
2511  mooseAssert(_qrules[block].size() > dim, "quadrature rules not sized property for dimension");
2512  return _qrules[block][dim];
2513  }
2514 
2515  /**** Face Stuff ****/
2516 
2518  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face;
2520  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face;
2522  std::map<unsigned int, FEBase *> _holder_fe_face_helper;
2536  std::vector<Eigen::Map<RealDIMValue>> _mapped_normals;
2539 
2541  std::vector<dof_id_type> _extra_elem_ids;
2543  std::vector<dof_id_type> _neighbor_extra_elem_ids;
2545  std::map<unsigned int, const std::vector<Point> *> _holder_normals;
2546 
2547  /**** Neighbor Stuff ****/
2548 
2550  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_neighbor;
2551  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face_neighbor;
2552  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_neighbor;
2553  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face_neighbor;
2554 
2556  std::map<unsigned int, FEBase *> _holder_fe_neighbor_helper;
2557  std::map<unsigned int, FEBase *> _holder_fe_face_neighbor_helper;
2558 
2560  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_lower;
2562  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_lower;
2564  std::map<unsigned int, FEBase *> _holder_fe_lower_helper;
2565 
2571  mutable bool _need_JxW_neighbor;
2579 
2580  /********** mortar stuff *************/
2581 
2583  const std::vector<Real> * _JxW_msm;
2585  std::unique_ptr<FEBase> _fe_msm;
2593 
2597 
2598 protected:
2600  const Elem * _current_elem;
2608  unsigned int _current_side;
2610  const Elem * _current_side_elem;
2626  const Node * _current_node;
2633 
2648 
2651 
2652  /*
2653  * Residual contributions <tag_index, ivar>
2654  *
2655  * tag_index is the index into _residual_vector_tags, that is, _sub_Re[0] corresponds to the tag
2656  * with TagID _residual_vector_tags[0]._id
2657  *
2658  * When ivar corresponds to an array variable, the dense vector is in size of ndof * count,
2659  * where count is the number of components of the array variable. The local residual is ordered
2660  * as (r_i,j, i = 1,...,ndof; j = 1,...,count).
2661  *
2662  * Dense vectors for variables (ivar+i, i = 1,...,count) are empty.
2663  */
2664  std::vector<std::vector<DenseVector<Number>>> _sub_Re;
2665  std::vector<std::vector<DenseVector<Number>>> _sub_Rn;
2667  std::vector<std::vector<DenseVector<Number>>> _sub_Rl;
2668 
2671 
2672  /*
2673  * Jacobian contributions <Tag, ivar, jvar>
2674  * When ivar corresponds to an array variable, the number of rows of the dense matrix is in size
2675  * of indof * icount, where icount is the number of components of ivar. When jvar corresponds to
2676  * an array variable, the number of columns of the dense matrix is in size of jndof * jcount,
2677  * where jcount is the number of components of jvar. The local residual is ordered as
2678  * (K_(i,j,k,l), k=1,...,jndof; l = 1,...,jcout; i = 1,...,indof; j = 1,...,icount).
2679  *
2680  * Dense matrices for variables (ivar+i, i = 1,...,icount) or (jvar+j, j = 1,...,jcount) are
2681  * empty.
2682  */
2683  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kee;
2684  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Keg;
2685 
2687  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Ken;
2689  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kne;
2691  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knn;
2693  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kll;
2695  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kle;
2697  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kln;
2699  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kel;
2701  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knl;
2702 
2705 
2706  // Shape function values, gradients. second derivatives
2710 
2714 
2718 
2722 
2723  // Shape function values, gradients, second derivatives
2729 
2735 
2741 
2747 
2749  {
2750  public:
2756  };
2757 
2759  {
2760  public:
2766  };
2767 
2769  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data;
2770  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face;
2771  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_neighbor;
2772  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face_neighbor;
2773  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_lower;
2774  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_dual_lower;
2775 
2777  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data;
2778  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face;
2779  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_neighbor;
2780  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face_neighbor;
2781  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_lower;
2782  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_dual_lower;
2783 
2784  mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data;
2785  mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>> _ad_vector_grad_phi_data;
2786  mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data_face;
2787  mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>>
2789 
2799  const std::vector<VectorTag> & _residual_vector_tags;
2800 
2802  std::vector<std::vector<Real>> _cached_residual_values;
2803 
2805  std::vector<std::vector<dof_id_type>> _cached_residual_rows;
2806 
2808 
2810  std::vector<std::vector<Real>> _cached_jacobian_values;
2812  std::vector<std::vector<dof_id_type>> _cached_jacobian_rows;
2814  std::vector<std::vector<dof_id_type>> _cached_jacobian_cols;
2815 
2817 
2822  std::vector<bool> _component_block_diagonal;
2823 
2825  std::vector<dof_id_type> _temp_dof_indices;
2826 
2828  std::vector<Point> _temp_reference_points;
2829 
2831  std::vector<VectorValue<ADReal>> _ad_dxyzdxi_map;
2832  std::vector<VectorValue<ADReal>> _ad_dxyzdeta_map;
2833  std::vector<VectorValue<ADReal>> _ad_dxyzdzeta_map;
2834  std::vector<VectorValue<ADReal>> _ad_d2xyzdxi2_map;
2835  std::vector<VectorValue<ADReal>> _ad_d2xyzdxideta_map;
2836  std::vector<VectorValue<ADReal>> _ad_d2xyzdeta2_map;
2837  std::vector<ADReal> _ad_jac;
2840  std::vector<ADReal> _ad_dxidx_map;
2841  std::vector<ADReal> _ad_dxidy_map;
2842  std::vector<ADReal> _ad_dxidz_map;
2843  std::vector<ADReal> _ad_detadx_map;
2844  std::vector<ADReal> _ad_detady_map;
2845  std::vector<ADReal> _ad_detadz_map;
2846  std::vector<ADReal> _ad_dzetadx_map;
2847  std::vector<ADReal> _ad_dzetady_map;
2848  std::vector<ADReal> _ad_dzetadz_map;
2849 
2855 
2859  std::vector<std::pair<unsigned int, unsigned short>> _disp_numbers_and_directions;
2860 
2861  mutable bool _calculate_xyz;
2862  mutable bool _calculate_face_xyz;
2864 
2867  mutable bool _calculate_ad_coord;
2868 
2869  mutable std::set<FEType> _need_second_derivative;
2870  mutable std::set<FEType> _need_second_derivative_neighbor;
2871  mutable std::set<FEType> _need_curl;
2872  mutable std::set<FEType> _need_div;
2873  mutable std::set<FEType> _need_face_div;
2874  mutable std::set<FEType> _need_neighbor_div;
2875  mutable std::set<FEType> _need_face_neighbor_div;
2876 
2878  const NumericVector<Real> * _scaling_vector = nullptr;
2879 
2886 
2887  const Elem * _msm_elem = nullptr;
2888 
2893 
2898 
2902  std::vector<dof_id_type> _row_indices, _column_indices;
2903 
2906 
2908  std::vector<Point> _current_neighbor_ref_points;
2909 };
2910 
2911 template <typename OutputType>
2914 {
2915  buildLowerDFE(type);
2916  return _fe_shape_data_lower[type]->_phi;
2917 }
2918 
2919 template <typename OutputType>
2922 {
2923  buildLowerDDualFE(type);
2924  return _fe_shape_data_dual_lower[type]->_phi;
2925 }
2926 
2927 template <typename OutputType>
2930 {
2931  buildLowerDFE(type);
2932  return _fe_shape_data_lower[type]->_grad_phi;
2933 }
2934 
2935 template <typename OutputType>
2938 {
2939  buildLowerDDualFE(type);
2940  return _fe_shape_data_dual_lower[type]->_grad_phi;
2941 }
2942 
2943 template <>
2945 Assembly::feADGradPhi<RealVectorValue>(FEType type) const
2946 {
2947  return _ad_vector_grad_phi_data[type];
2948 }
2949 
2950 template <>
2952 Assembly::feADGradPhiFace<RealVectorValue>(FEType type) const
2953 {
2954  return _ad_vector_grad_phi_data_face[type];
2955 }
2956 
2957 template <>
2959 Assembly::fePhi<VectorValue<Real>>(FEType type) const;
2960 
2961 template <>
2963 Assembly::feGradPhi<VectorValue<Real>>(FEType type) const;
2964 
2965 template <>
2967 Assembly::feSecondPhi<VectorValue<Real>>(FEType type) const;
2968 
2969 template <>
2971 Assembly::fePhiLower<VectorValue<Real>>(FEType type) const;
2972 
2973 template <>
2975 Assembly::feDualPhiLower<VectorValue<Real>>(FEType type) const;
2976 
2977 template <>
2979 Assembly::feGradPhiLower<VectorValue<Real>>(FEType type) const;
2980 
2981 template <>
2983 Assembly::feGradDualPhiLower<VectorValue<Real>>(FEType type) const;
2984 
2985 template <>
2987 Assembly::fePhiFace<VectorValue<Real>>(FEType type) const;
2988 
2989 template <>
2991 Assembly::feGradPhiFace<VectorValue<Real>>(FEType type) const;
2992 
2993 template <>
2995 Assembly::feSecondPhiFace<VectorValue<Real>>(FEType type) const;
2996 
2997 template <>
2999 Assembly::fePhiNeighbor<VectorValue<Real>>(FEType type) const;
3000 
3001 template <>
3003 Assembly::feGradPhiNeighbor<VectorValue<Real>>(FEType type) const;
3004 
3005 template <>
3007 Assembly::feSecondPhiNeighbor<VectorValue<Real>>(FEType type) const;
3008 
3009 template <>
3011 Assembly::fePhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3012 
3013 template <>
3015 Assembly::feGradPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3016 
3017 template <>
3019 Assembly::feSecondPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3020 
3021 template <>
3023 Assembly::feCurlPhi<VectorValue<Real>>(FEType type) const;
3024 
3025 template <>
3027 Assembly::feCurlPhiFace<VectorValue<Real>>(FEType type) const;
3028 
3029 template <>
3031 Assembly::feCurlPhiNeighbor<VectorValue<Real>>(FEType type) const;
3032 
3033 template <>
3035 Assembly::feCurlPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3036 
3037 template <>
3039 Assembly::feDivPhi<VectorValue<Real>>(FEType type) const;
3040 
3041 template <>
3043 Assembly::feDivPhiFace<VectorValue<Real>>(FEType type) const;
3044 
3045 template <>
3047 Assembly::feDivPhiNeighbor<VectorValue<Real>>(FEType type) const;
3048 
3049 template <>
3051 Assembly::feDivPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3052 
3053 template <>
3055 Assembly::adGradPhi<RealVectorValue>(const MooseVariableFE<RealVectorValue> & v) const
3056 {
3057  return _ad_vector_grad_phi_data.at(v.feType());
3058 }
3059 
3060 template <typename Residuals, typename Indices>
3061 void
3062 Assembly::cacheResiduals(const Residuals & residuals,
3063  const Indices & input_row_indices,
3064  const Real scaling_factor,
3065  LocalDataKey,
3066  const std::set<TagID> & vector_tags)
3067 {
3068  mooseAssert(residuals.size() == input_row_indices.size(),
3069  "The number of residuals should match the number of dof indices");
3070  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3071 
3072  if (!computingResidual() || vector_tags.empty())
3073  return;
3074 
3075  if (residuals.size() == 1)
3076  {
3077  // No constraining is required. (This is likely a finite volume computation if we only have a
3078  // single dof)
3080  residuals, input_row_indices, scaling_factor, LocalDataKey{}, vector_tags);
3081  return;
3082  }
3083 
3084  // Need to make a copy because we might modify this in constrain_element_vector
3085  _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3086 
3088  for (const auto i : index_range(_row_indices))
3089  _element_vector(i) = MetaPhysicL::raw_value(residuals[i]) * scaling_factor;
3090 
3091  // At time of writing, this method doesn't do anything with the asymmetric_constraint_rows
3092  // argument, but we set it to false to be consistent with processLocalResidual
3094  _element_vector, _row_indices, /*asymmetric_constraint_rows=*/false);
3095 
3096  for (const auto i : index_range(_row_indices))
3097  cacheResidual(_row_indices[i], _element_vector(i), vector_tags);
3098 }
3099 
3100 template <typename Residuals, typename Indices>
3101 void
3103  const Indices & row_indices,
3104  const Real scaling_factor,
3105  LocalDataKey,
3106  const std::set<TagID> & vector_tags)
3107 {
3108  mooseAssert(residuals.size() == row_indices.size(),
3109  "The number of residuals should match the number of dof indices");
3110  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3111 
3112  if (computingResidual() && !vector_tags.empty())
3113  for (const auto i : index_range(row_indices))
3114  cacheResidual(
3115  row_indices[i], MetaPhysicL::raw_value(residuals[i]) * scaling_factor, vector_tags);
3116 }
3117 
3118 template <typename Residuals, typename Indices>
3119 void
3120 Assembly::cacheJacobian(const Residuals & residuals,
3121  const Indices & input_row_indices,
3122  const Real scaling_factor,
3123  LocalDataKey,
3124  const std::set<TagID> & matrix_tags)
3125 {
3126  if (!computingJacobian() || matrix_tags.empty())
3127  return;
3128 
3129  if (residuals.size() == 1)
3130  {
3131  // No constraining is required. (This is likely a finite volume computation if we only have a
3132  // single dof)
3134  residuals, input_row_indices, scaling_factor, LocalDataKey{}, matrix_tags);
3135  return;
3136  }
3137 
3138  const auto & compare_dofs = residuals[0].derivatives().nude_indices();
3139 #ifndef NDEBUG
3140  auto compare_dofs_set = std::set<dof_id_type>(compare_dofs.begin(), compare_dofs.end());
3141 
3142  for (const auto i : make_range(decltype(residuals.size())(1), residuals.size()))
3143  {
3144  const auto & residual = residuals[i];
3145  auto current_dofs_set = std::set<dof_id_type>(residual.derivatives().nude_indices().begin(),
3146  residual.derivatives().nude_indices().end());
3147  mooseAssert(compare_dofs_set == current_dofs_set,
3148  "We're going to see whether the dof sets are the same. IIRC the degree of freedom "
3149  "dependence (as indicated by the dof index set held by the ADReal) has to be the "
3150  "same for every residual passed to this method otherwise constrain_element_matrix "
3151  "will not work.");
3152  }
3153 #endif
3154  _column_indices.assign(compare_dofs.begin(), compare_dofs.end());
3155 
3156  // If there's no derivatives then there is nothing to do. Moreover, if we pass zero size column
3157  // indices to constrain_element_matrix then we will potentially get errors out of BLAS
3158  if (!_column_indices.size())
3159  return;
3160 
3161  // Need to make a copy because we might modify this in constrain_element_matrix
3162  _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3163 
3165  for (const auto i : index_range(_row_indices))
3166  {
3167  const auto & sparse_derivatives = residuals[i].derivatives();
3168 
3169  for (const auto j : index_range(_column_indices))
3170  _element_matrix(i, j) = sparse_derivatives[_column_indices[j]] * scaling_factor;
3171  }
3172 
3174 
3175  for (const auto i : index_range(_row_indices))
3176  for (const auto j : index_range(_column_indices))
3177  cacheJacobian(_row_indices[i], _column_indices[j], _element_matrix(i, j), {}, matrix_tags);
3178 }
3179 
3180 template <typename Residuals, typename Indices>
3181 void
3182 Assembly::cacheJacobianWithoutConstraints(const Residuals & residuals,
3183  const Indices & row_indices,
3184  const Real scaling_factor,
3185  LocalDataKey,
3186  const std::set<TagID> & matrix_tags)
3187 {
3188  mooseAssert(residuals.size() == row_indices.size(),
3189  "The number of residuals should match the number of dof indices");
3190  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3191 
3192  if (!computingJacobian() || matrix_tags.empty())
3193  return;
3194 
3195  for (const auto i : index_range(row_indices))
3196  {
3197  const auto row_index = row_indices[i];
3198 
3199  const auto & sparse_derivatives = residuals[i].derivatives();
3200  const auto & column_indices = sparse_derivatives.nude_indices();
3201  const auto & raw_derivatives = sparse_derivatives.nude_data();
3202 
3203  for (std::size_t j = 0; j < column_indices.size(); ++j)
3204  cacheJacobian(
3205  row_index, column_indices[j], raw_derivatives[j] * scaling_factor, {}, matrix_tags);
3206  }
3207 }
3208 
3209 inline const Real &
3211 {
3214 }
3215 
3216 inline const Real &
3218 {
3221 }
3222 
3223 inline void
3225  std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions)
3226 {
3227  _disp_numbers_and_directions = std::move(disp_numbers_and_directions);
3228 }
3229 
3230 inline void
3231 Assembly::setCurrentLowerDElem(const Elem * const lower_d_elem)
3232 {
3233  _current_lower_d_elem = lower_d_elem;
3234 }
const Real & neighborVolume()
Returns the reference to the current neighbor volume.
Definition: Assembly.h:508
VariablePhiSecond _second_phi_face
Definition: Assembly.h:2713
const Elem *const & elem() const
Return the current element.
Definition: Assembly.h:414
VariablePhiSecond _second_phi_face_neighbor
Definition: Assembly.h:2721
MooseArray< VectorValue< ADReal > > _ad_normals
Definition: Assembly.h:2851
const VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1372
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:204
void copyShapes(MooseVariableField< T > &v)
Definition: Assembly.C:3001
libMesh::ElemSideBuilder _compute_face_map_side_elem_builder
In place side element builder for computeFaceMap()
Definition: Assembly.h:2885
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:180
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition: Assembly.h:2518
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition: Assembly.h:2622
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:3440
const unsigned int & neighborSide() const
Returns the current neighboring side.
Definition: Assembly.h:452
VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1501
ArbitraryQuadrature * _current_qrule_arbitrary
The current arbitrary quadrature rule used within the element interior.
Definition: Assembly.h:2418
std::map< FEType, FEBase * > _current_fe
The "volume" fe object that matches the current elem.
Definition: Assembly.h:2386
MooseArray< Real > _curvatures
Definition: Assembly.h:2853
std::vector< ADReal > _ad_detadz_map
Definition: Assembly.h:2845
VectorVariablePhiValue _phi
Definition: Assembly.h:2761
SystemBase & _sys
Definition: Assembly.h:2316
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:2805
The Kokkos assembly class.
std::vector< std::vector< dof_id_type > > _cached_jacobian_rows
Row where the corresponding cached value should go.
Definition: Assembly.h:2812
Eigen::Matrix< ADReal, Eigen::Dynamic, 1 > ADRealEigenVector
Definition: MooseTypes.h:148
unsigned int _max_cached_residuals
Definition: Assembly.h:2807
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data_face
Definition: Assembly.h:2786
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhi(FEType type) const
Definition: Assembly.h:1733
bool _user_added_fe_lower_of_helper_type
Definition: Assembly.h:2369
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called...
Definition: Assembly.h:2650
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1599
const VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1363
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:2377
MooseArray< ADReal > _ad_coord
The AD version of the current coordinate transformation coefficients.
Definition: Assembly.h:2430
const MooseArray< ADPoint > & adQPointsFace() const
Definition: Assembly.h:401
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries()
Definition: Assembly.h:1293
void buildNeighborFE(FEType type) const
Build FEs for a neighbor with a type.
Definition: Assembly.C:314
const VariablePhiSecond & secondPhi() const
Definition: Assembly.h:1328
void setMortarQRule(Order order)
Specifies a custom qrule for integration on mortar segment mesh.
Definition: Assembly.C:735
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe
Each dimension&#39;s actual vector fe objects indexed on type.
Definition: Assembly.h:2408
typename OutputTools< typename Moose::ADType< T >::type >::VariablePhiGradient ADTemplateVariablePhiGradient
Definition: MooseTypes.h:682
void buildVectorLowerDFE(FEType type) const
Build Vector FEs for a lower dimensional element with a type.
Definition: Assembly.C:403
MooseArray< Real > _coord_neighbor
The current coordinate transformation coefficients.
Definition: Assembly.h:2575
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:144
void buildFE(FEType type) const
Build FEs with a type.
Definition: Assembly.C:266
T * qruleFaceHelper(const Elem *elem, unsigned int side, std::function< T *(QRules &)> rule_fn)
Definition: Assembly.h:2475
libMesh::QBase *const & writeableQRule()
Returns the reference to the current quadrature being used.
Definition: Assembly.h:241
const bool & _computing_residual
Whether we are currently computing the residual.
Definition: Assembly.h:2326
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kle
dlower/dsecondary (or dlower/delement)
Definition: Assembly.h:2695
VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1518
void setCurrentBoundaryID(BoundaryID i)
set the current boundary ID
Definition: Assembly.h:434
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:3454
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > & fieldScalarCouplingEntries() const
Definition: Assembly.h:1308
const OutputTools< OutputType >::VariablePhiValue & fePhi(FEType type) const
Definition: Assembly.h:1618
void setFaceQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for face integration.
Definition: Assembly.C:674
void saveLocalADArray(std::vector< ADReal > &re, unsigned int i, unsigned int ntest, const ADRealEigenVector &v) const
Definition: Assembly.h:1825
libMesh::QBase *const & writeableQRuleNeighbor()
Returns the reference to the current quadrature being used on a current neighbor. ...
Definition: Assembly.h:527
Keeps track of stuff related to assembling.
Definition: Assembly.h:109
Assembly(SystemBase &sys, THREAD_ID tid)
Definition: Assembly.C:79
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data
Shape function values, gradients, second derivatives for each FE type.
Definition: Assembly.h:2769
Class for stuff related to variables.
Definition: Adaptivity.h:31
const MooseArray< ADReal > & adJxW() const
Definition: Assembly.h:278
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhiFace(FEType type) const
Definition: Assembly.h:1673
void buildLowerDDualFE(FEType type) const
Definition: Assembly.C:382
VariablePhiGradient & gradPhiFace(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1582
unsigned int TagID
Definition: MooseTypes.h:238
VectorVariablePhiValue _vector_phi
Definition: Assembly.h:2724
MooseArray< Real > _current_JxW_neighbor
The current transformed jacobian weights on a neighbor&#39;s face.
Definition: Assembly.h:2573
std::shared_ptr< XFEMInterface > _xfem
The XFEM controller.
Definition: Assembly.h:2383
void reinitNeighborLowerDElem(const Elem *elem)
reinitialize a neighboring lower dimensional element
Definition: Assembly.C:2383
virtual ~Assembly()
Definition: Assembly.C:186
void setCurrentLowerDElem(const Elem *const lower_d_elem)
Set the current lower dimensional element.
Definition: Assembly.h:3231
const VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1433
void prepareJacobianBlock()
Sizes and zeroes the Jacobian blocks used for the current element.
Definition: Assembly.C:2684
const libMesh::QBase *const & qRuleFace() const
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:322
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:1153
VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &)
Definition: Assembly.h:1470
VectorValue< Real > RealVectorValue
Definition: SubProblem.h:33
VariablePhiSecond & secondPhi(const MooseVariableField< Real > &)
Definition: Assembly.h:1466
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kel
dsecondary/dlower (or delement/dlower)
Definition: Assembly.h:2699
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition: Assembly.h:2428
const OutputTools< OutputType >::VariablePhiValue & fePhiLower(FEType type) const
Definition: Assembly.h:2913
VariablePhiDivergence _div_phi
Definition: Assembly.h:2755
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:3118
void reinitFE(const Elem *elem)
Just an internal helper function to reinit the volume FE objects.
Definition: Assembly.C:760
libMesh::QBase * _current_qrule_neighbor
quadrature rule used on neighbors
Definition: Assembly.h:2567
const Real & neighborLowerDElemVolume() const
Definition: Assembly.h:3217
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:1844
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1608
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:2243
const MooseArray< Point > & physicalPoints() const
The current points in physical space where we have reinited through reinitAtPhysical() ...
Definition: Assembly.h:270
VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1539
void prepareNonlocal()
Definition: Assembly.C:2724
VariablePhiGradient _grad_phi
Definition: Assembly.h:2708
std::map< unsigned int, FEBase * > _holder_fe_neighbor_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2556
const VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1380
std::unique_ptr< FEBase > _fe_msm
A FE object for working on mortar segement elements.
Definition: Assembly.h:2585
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face_neighbor
Definition: Assembly.h:2772
const VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1414
VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1514
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & nonlocalCouplingEntries()
Definition: Assembly.h:1303
void createQRules(QuadratureType type, Order order, Order volume_order, Order face_order, SubdomainID block, bool allow_negative_qweights=true)
Creates block-specific volume, face and arbitrary qrules based on the orders and the flag of whether ...
Definition: Assembly.C:617
VariablePhiSecond _second_phi_neighbor
Definition: Assembly.h:2717
void setXFEM(std::shared_ptr< XFEMInterface > xfem)
Set the pointer to the XFEM controller object.
Definition: Assembly.h:1800
const MooseArray< ADPoint > & adQPoints() const
Definition: Assembly.h:395
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:3513
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition: Assembly.h:2630
std::vector< ADReal > _ad_detady_map
Definition: Assembly.h:2844
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:2279
MooseVariableFE< Real > MooseVariable
Definition: Assembly.h:59
const VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1388
VectorVariablePhiGradient _vector_grad_phi_neighbor
Definition: Assembly.h:2737
const MooseArray< Point > & qPointsFaceNeighbor() const
Returns the reference to the current quadrature points being used on the neighbor face...
Definition: Assembly.h:539
std::vector< ADReal > _ad_dzetadz_map
Definition: Assembly.h:2848
std::vector< std::unique_ptr< FEBase > > _unique_fe_neighbor_helper
Definition: Assembly.h:2376
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kll
dlower/dlower
Definition: Assembly.h:2693
VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1555
VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1505
bool _user_added_fe_face_neighbor_of_helper_type
Definition: Assembly.h:2367
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:3540
bool _have_p_refinement
Whether we have ever conducted p-refinement.
Definition: Assembly.h:2905
VariablePhiValue _phi
Definition: Assembly.h:2751
Real _current_neighbor_volume
Volume of the current neighbor.
Definition: Assembly.h:2624
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:2297
ArbitraryQuadrature * qruleArbitraryFace(const Elem *elem, unsigned int side)
Definition: Assembly.C:1923
std::map< FEType, FEBase * > _current_fe_face
The "face" fe object that matches the current elem.
Definition: Assembly.h:2388
VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1497
const VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1384
std::vector< Point > _current_neighbor_ref_points
The current reference points on the neighbor element.
Definition: Assembly.h:2908
void coordTransformFactor(const SubProblem &s, SubdomainID sub_id, const P &point, C &factor, SubdomainID neighbor_sub_id=libMesh::Elem::invalid_subdomain_id)
Computes a conversion multiplier for use when computing integraals for the current coordinate system ...
Definition: Assembly.C:41
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kln
dlower/dprimary (or dlower/dneighbor)
Definition: Assembly.h:2697
MooseVariableFE< RealVectorValue > VectorMooseVariable
Definition: Assembly.h:61
void setVolumeQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for volume integration.
Definition: Assembly.C:655
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition: Assembly.h:2614
void addJacobianNonlocal(GlobalDataKey)
Adds non-local Jacobian to the global Jacobian matrices.
Definition: Assembly.C:3861
VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1559
VariablePhiValue & phiFace(const MooseVariableField< Real > &)
Definition: Assembly.h:1468
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
Definition: Assembly.h:2665
const OutputTools< OutputType >::VariablePhiValue & feDualPhiLower(FEType type) const
Definition: Assembly.h:2921
MooseMesh & _mesh
Definition: Assembly.h:2356
const VariablePhiValue & phi() const
Definition: Assembly.h:1319
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_neighbor
Definition: Assembly.h:2771
std::map< unsigned int, FEBase * > _holder_fe_face_neighbor_helper
Definition: Assembly.h:2557
auto raw_value(const Eigen::Map< T > &in)
Definition: EigenADReal.h:100
const VariablePhiGradient & gradPhi() const
Definition: Assembly.h:1326
MooseArray< Real > _current_JxW_face
The current transformed jacobian weights on a face.
Definition: Assembly.h:2532
void modifyWeightsDueToXFEM(const Elem *elem)
Update the integration weights for XFEM partial elements.
Definition: Assembly.C:4509
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:2704
libMesh::QBase * writeableQRuleFace(unsigned int dim, SubdomainID block, InternalDataKey)
Returns the pointer to the quadrature used on a face of specified block and dimension.
Definition: Assembly.h:335
const Elem * _current_elem
The current "element" we are currently on.
Definition: Assembly.h:2600
VectorVariablePhiCurl _vector_curl_phi_neighbor
Definition: Assembly.h:2739
VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1547
const VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1354
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:156
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:712
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:2354
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:162
VectorVariablePhiGradient _vector_grad_phi
Definition: Assembly.h:2725
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:2374
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_nonlocal_used
Definition: Assembly.h:2346
std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > _cm_sf_entry
Entries in the coupling matrix for scalar variables vs field variables.
Definition: Assembly.h:2339
VectorVariablePhiValue _vector_phi_neighbor
Definition: Assembly.h:2736
void prepareNeighbor()
Definition: Assembly.C:2810
void resizeADMappingObjects(unsigned int n_qp, unsigned int dim)
resize any objects that contribute to automatic differentiation-related mapping calculations ...
Definition: Assembly.C:971
OutputTools< Real >::VariablePhiValue VariablePhiValue
Definition: MooseTypes.h:348
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:2288
unsigned int m() const
VariablePhiValue & phi(const MooseVariableField< Real > &)
Definition: Assembly.h:1464
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:2553
const VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1359
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:2822
Real _current_elem_volume
Volume of the current element.
Definition: Assembly.h:2606
OutputTools< RealVectorValue >::VariablePhiGradient VectorVariablePhiGradient
Definition: MooseTypes.h:366
std::map< FEType, FEBase * > _current_fe_face_neighbor
The "neighbor face" fe object that matches the current elem.
Definition: Assembly.h:2392
const MooseArray< ADReal > & adCurvatures() const
Definition: Assembly.C:4789
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:258
std::map< FEType, FEVectorBase * > _current_vector_fe_face
The "face" vector fe object that matches the current elem.
Definition: Assembly.h:2397
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:2373
const FEType _helper_type
The finite element type of the FE helper classes.
Definition: Assembly.h:2362
const Elem *const & msmElem() const
Definition: Assembly.h:1964
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:3359
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:1142
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:4431
const bool & _computing_residual_and_jacobian
Whether we are currently computing the residual and Jacobian.
Definition: Assembly.h:2332
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knn
jacobian contributions from the neighbor <Tag, ivar, jvar>
Definition: Assembly.h:2691
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:1816
const ADTemplateVariablePhiGradient< T > & adGradPhi(const MooseVariableFE< T > &v) const
Definition: Assembly.h:1321
Base class for a system (of equations)
Definition: SystemBase.h:84
const std::vector< Eigen::Map< RealDIMValue > > & mappedNormals() const
Definition: Assembly.h:362
libMesh::QBase * _current_qrule_face
quadrature rule used on faces
Definition: Assembly.h:2526
const VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1346
FEGenericBase< RealGradient > FEVectorBase
VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1563
unsigned int numExtraElemIntegers() const
Number of extra element integers Assembly tracked.
Definition: Assembly.h:373
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:120
std::set< FEType > _need_second_derivative_neighbor
Definition: Assembly.h:2870
std::vector< std::vector< Real > > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition: Assembly.h:2810
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:2252
VariablePhiValue _phi
Definition: Assembly.h:2707
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1725
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_ff_entry
Entries in the coupling matrix for field variables.
Definition: Assembly.h:2335
void addJacobianNeighborLowerD(GlobalDataKey)
Add all portions of the Jacobian except PrimaryPrimary, e.g.
Definition: Assembly.C:3921
const MooseArray< Real > & mortarCoordTransformation() const
Returns the reference to the coordinate transformation coefficients on the mortar segment mesh...
Definition: Assembly.h:294
std::map< FEType, FEVectorBase * > _current_vector_fe
The "volume" vector fe object that matches the current elem.
Definition: Assembly.h:2395
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1595
VariablePhiGradient _grad_phi
Definition: Assembly.h:2752
std::vector< VectorValue< ADReal > > _ad_dxyzdeta_map
Definition: Assembly.h:2832
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1477
void prepareScalar()
Definition: Assembly.C:2951
DenseVector< Real > getJacobianDiagonal(DenseMatrix< Number > &ke)
Definition: Assembly.h:1895
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:378
void modifyFaceWeightsDueToXFEM(const Elem *elem, unsigned int side=0)
Update the face integration weights for XFEM partial elements.
Definition: Assembly.C:4529
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:1994
const VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1424
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFace(FEType type) const
Definition: Assembly.h:1666
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1788
OutputTools< Real >::VariablePhiSecond VariablePhiSecond
Definition: MooseTypes.h:350
std::unique_ptr< libMesh::QBase > face
area/face (meshdim-1) quadrature rule
Definition: Assembly.h:2448
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:2670
unsigned int _mesh_dimension
Definition: Assembly.h:2358
std::vector< Eigen::Map< RealDIMValue > > _mapped_normals
Mapped normals.
Definition: Assembly.h:2536
VectorVariablePhiDivergence _vector_div_phi_face
Definition: Assembly.h:2734
VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1567
void cacheJacobian(GlobalDataKey)
Takes the values that are currently in _sub_Kee and appends them to the cached values.
Definition: Assembly.C:4036
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiNeighbor(FEType type) const
Definition: Assembly.h:1780
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:2878
void processLocalResidual(DenseVector< Number > &res_block, std::vector< dof_id_type > &dof_indices, const std::vector< Real > &scaling_factor)
Appling scaling, constraints to the local residual block and populate the full DoF indices for array ...
Definition: Assembly.C:3219
void assignDisplacements(std::vector< std::pair< unsigned int, unsigned short >> &&disp_numbers_and_directions)
Assign the displacement numbers and directions.
Definition: Assembly.h:3224
void addCachedResiduals(GlobalDataKey, const std::vector< VectorTag > &tags)
Pushes all cached residuals to the global residual vectors associated with each tag.
Definition: Assembly.C:3468
Data structure for tracking/grouping a set of quadrature rules for a particular dimensionality of mes...
Definition: Assembly.h:2434
unsigned int _max_cached_jacobians
Definition: Assembly.h:2816
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:3159
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Ken
jacobian contributions from the element and neighbor <Tag, ivar, jvar>
Definition: Assembly.h:2687
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_dual_lower
Definition: Assembly.h:2782
Nonlinear system to be solved.
VectorVariablePhiValue _vector_phi_face
Definition: Assembly.h:2730
std::vector< VectorValue< ADReal > > _ad_dxyzdzeta_map
Definition: Assembly.h:2833
const VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1401
std::vector< Point > _temp_reference_points
Temporary work data for reinitAtPhysical()
Definition: Assembly.h:2828
std::vector< std::pair< MooseVariableScalar *, MooseVariableScalar * > > _cm_ss_entry
Entries in the coupling matrix for scalar variables.
Definition: Assembly.h:2341
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kne
jacobian contributions from the neighbor and element <Tag, ivar, jvar>
Definition: Assembly.h:2689
const Elem * _current_neighbor_lower_d_elem
The current neighboring lower dimensional element.
Definition: Assembly.h:2637
OutputTools< RealVectorValue >::VariablePhiDivergence VectorVariablePhiDivergence
Definition: MooseTypes.h:369
unsigned int _current_neighbor_side
The current side of the selected neighboring element (valid only when working with sides) ...
Definition: Assembly.h:2618
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:3422
void init(const libMesh::CouplingMatrix *cm)
Initialize the Assembly object and set the CouplingMatrix for use throughout.
Definition: Assembly.C:2467
VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1543
void prepareLowerD()
Prepare the Jacobians and residuals for a lower dimensional element.
Definition: Assembly.C:2848
bool _user_added_fe_neighbor_of_helper_type
Definition: Assembly.h:2368
void buildFaceNeighborFE(FEType type) const
Build FEs for a neighbor face with a type.
Definition: Assembly.C:336
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face
Definition: Assembly.h:2778
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:2290
void computeCurrentFaceVolume()
Definition: Assembly.C:1773
const VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1428
std::vector< std::vector< DenseVector< Number > > > _sub_Rl
residual contributions for each variable from the lower dimensional element
Definition: Assembly.h:2667
VariablePhiCurl _curl_phi
Definition: Assembly.h:2754
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:2494
VectorVariablePhiGradient _vector_grad_phi_face_neighbor
Definition: Assembly.h:2743
std::unique_ptr< libMesh::QBase > vol
volume/elem (meshdim) quadrature rule
Definition: Assembly.h:2446
void prepareOffDiagScalar()
Definition: Assembly.C:2975
VectorVariablePhiSecond _second_phi
Definition: Assembly.h:2763
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFace(FEType type) const
Definition: Assembly.h:1772
bool needDual() const
Indicates whether dual shape functions are used (computation is now repeated on each element so expen...
Definition: Assembly.h:623
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:3833
std::vector< ADReal > _ad_dzetadx_map
Definition: Assembly.h:2846
void addJacobianLowerD(GlobalDataKey)
Add portions of the Jacobian of LowerLower, LowerSecondary, and SecondaryLower for boundary condition...
Definition: Assembly.C:3999
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:2306
VectorVariablePhiGradient _grad_phi
Definition: Assembly.h:2762
MooseArray< ADReal > _ad_curvatures
Definition: Assembly.h:2854
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:2420
const MooseArray< ADReal > & adCoordTransformation() const
Returns the reference to the AD version of the coordinate transformation coefficients.
Definition: Assembly.h:300
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1757
void modifyArbitraryWeights(const std::vector< Real > &weights)
Modify the weights when using the arbitrary quadrature rule.
Definition: Assembly.C:4556
FEBase * _current_fe_face_helper
helper object for transforming coordinates
Definition: Assembly.h:2524
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > _cm_fs_entry
Entries in the coupling matrix for field variables vs scalar variables.
Definition: Assembly.h:2337
const std::vector< Real > * _JxW_msm
A JxW for working on mortar segement elements.
Definition: Assembly.h:2583
std::vector< ADReal > _ad_dzetady_map
Definition: Assembly.h:2847
dof_id_type numeric_index_type
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data
Definition: Assembly.h:2784
std::unordered_map< SubdomainID, std::vector< QRules > > _qrules
Holds quadrature rules for each dimension.
Definition: Assembly.h:2463
const MooseArray< Point > & normals() const
Returns the array of normals for quadrature points on a current side.
Definition: Assembly.h:357
MooseVariableFE< RealEigenVector > ArrayMooseVariable
Definition: Assembly.h:62
const VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1376
void prepareResidual()
Sizes and zeroes the residual for the current element.
Definition: Assembly.C:2708
VectorVariablePhiCurl _curl_phi
Definition: Assembly.h:2764
std::map< FEType, FEBase * > _current_fe_neighbor
The "neighbor" fe object that matches the current elem.
Definition: Assembly.h:2390
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhi(FEType type) const
Definition: Assembly.h:1632
Real elementVolume(const Elem *elem) const
On-demand computation of volume element accounting for RZ/RSpherical.
Definition: Assembly.C:3758
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1490
void cacheJacobianNeighbor(GlobalDataKey)
Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached val...
Definition: Assembly.C:4088
SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition: Assembly.h:2616
VectorVariablePhiValue _vector_phi_face_neighbor
Definition: Assembly.h:2742
VariablePhiSecond & secondPhi(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1579
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1482
const VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1405
std::vector< std::vector< DenseVector< Number > > > _sub_Re
Definition: Assembly.h:2664
VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1522
OutputTools< RealVectorValue >::VariablePhiSecond VectorVariablePhiSecond
Definition: MooseTypes.h:367
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:288
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiNeighbor(FEType type) const
Definition: Assembly.h:1749
std::vector< ADReal > _ad_dxidz_map
Definition: Assembly.h:2842
const Real & lowerDElemVolume() const
Definition: Assembly.h:3210
VectorVariablePhiDivergence _vector_div_phi_neighbor
Definition: Assembly.h:2740
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:2499
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:2345
void prepare()
Definition: Assembly.C:2717
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:3182
VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &)
Definition: Assembly.h:1469
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:92
libMesh::QBase * _current_qrule_lower
quadrature rule used on lower dimensional elements.
Definition: Assembly.h:2596
SubProblem & _subproblem
Definition: Assembly.h:2317
libMesh::QBase * writeableQRule(unsigned int dim, SubdomainID block, InternalDataKey)
Returns the pointer to the quadrature of specified block and dimension.
Definition: Assembly.h:248
const VariablePhiGradient & gradPhi(const MooseVariableField< Real > &) const
Definition: Assembly.h:1327
std::vector< ADReal > _ad_detadx_map
Definition: Assembly.h:2843
void buildFaceFE(FEType type) const
Build FEs for a face with a type.
Definition: Assembly.C:292
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition: Assembly.h:2550
DenseVector< Number > & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
Get residual block for lower.
Definition: Assembly.h:1133
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:3390
bool _calculate_xyz
Definition: Assembly.h:2861
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:4332
MooseArray< std::vector< Point > > _current_tangents
The current tangent vectors at the quadrature points.
Definition: Assembly.h:2538
bool _calculate_curvatures
Definition: Assembly.h:2863
VariablePhiGradient _grad_phi_face_neighbor
Definition: Assembly.h:2720
const std::vector< VectorTag > & _residual_vector_tags
The residual vector tags that Assembly could possibly contribute to.
Definition: Assembly.h:2799
std::map< FEType, FEVectorBase * > _current_vector_fe_face_neighbor
The "neighbor face" vector fe object that matches the current elem.
Definition: Assembly.h:2401
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFace(FEType type) const
Definition: Assembly.h:1741
std::vector< dof_id_type > _neighbor_extra_elem_ids
Extra element IDs of neighbor.
Definition: Assembly.h:2543
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition: Assembly.h:2424
std::vector< VectorValue< ADReal > > _ad_dxyzdxi_map
AD quantities.
Definition: Assembly.h:2831
std::vector< std::pair< unsigned int, unsigned short > > _disp_numbers_and_directions
Container of displacement numbers and directions.
Definition: Assembly.h:2859
VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1509
std::vector< dof_id_type > _temp_dof_indices
Temporary work vector to keep from reallocating it.
Definition: Assembly.h:2825
std::set< FEType > _need_neighbor_div
Definition: Assembly.h:2874
OutputTools< Real >::VariablePhiCurl VariablePhiCurl
Definition: MooseTypes.h:351
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kee
Definition: Assembly.h:2683
std::vector< VectorValue< ADReal > > _ad_d2xyzdxi2_map
Definition: Assembly.h:2834
std::vector< ADReal > _ad_jac
Definition: Assembly.h:2837
std::set< FEType > _need_curl
Definition: Assembly.h:2871
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:4274
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_lower
Definition: Assembly.h:2781
VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1535
const VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &) const
Definition: Assembly.h:1341
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data
Definition: Assembly.h:2785
VariablePhiGradient _grad_phi_neighbor
Definition: Assembly.h:2716
ArbitraryQuadrature * _current_qface_arbitrary
The current arbitrary quadrature rule used on element faces.
Definition: Assembly.h:2528
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face
types of vector finite elements
Definition: Assembly.h:2520
VariablePhiValue _phi_face
Definition: Assembly.h:2711
VectorVariablePhiSecond _vector_second_phi
Definition: Assembly.h:2726
libMesh::QBase * _current_qrule_volume
The current volumetric quadrature for the element.
Definition: Assembly.h:2416
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries() const
Definition: Assembly.h:1298
const OutputTools< OutputType >::VariablePhiGradient & feGradPhi(FEType type) const
Definition: Assembly.h:1625
const Elem * _msm_elem
Definition: Assembly.h:2887
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealEigenMatrix
Definition: MooseTypes.h:151
libMesh::QBase * qruleFace(const Elem *elem, unsigned int side)
This is an abstraction over the internal qrules function.
Definition: Assembly.C:1917
bool _calculate_ad_coord
Whether to calculate coord with AD.
Definition: Assembly.h:2867
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_lower
Definition: Assembly.h:2773
const Elem * _current_lower_d_elem
The current lower dimensional element.
Definition: Assembly.h:2635
GlobalDataKey(const GlobalDataKey &)
Definition: Assembly.h:854
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:3315
const VariablePhiValue & phiFace() const
Definition: Assembly.h:1334
std::set< FEType > _need_second_derivative
Definition: Assembly.h:2869
bool computingResidualAndJacobian() const
Definition: Assembly.h:1959
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_lower
FE objects for lower dimensional elements.
Definition: Assembly.h:2560
const VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1453
std::set< FEType > _need_face_neighbor_div
Definition: Assembly.h:2875
FEGenericBase< Real > FEBase
libMesh::QBase * _qrule_msm
A qrule object for working on mortar segement elements.
Definition: Assembly.h:2590
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:3062
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiLower(FEType type) const
Definition: Assembly.h:2929
VariablePhiValue _phi_face_neighbor
Definition: Assembly.h:2719
libMesh::ElemSideBuilder _current_neighbor_side_elem_builder
In place side element builder for _current_neighbor_side_elem.
Definition: Assembly.h:2883
OutputTools< Real >::VariablePhiDivergence VariablePhiDivergence
Definition: MooseTypes.h:352
const Moose::CoordinateSystemType & coordSystem() const
Get the coordinate system type.
Definition: Assembly.h:316
Real _current_lower_d_elem_volume
The current lower dimensional element volume.
Definition: Assembly.h:2641
const OutputTools< OutputType >::VariablePhiValue & fePhiNeighbor(FEType type) const
Definition: Assembly.h:1687
libMesh::QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition: Assembly.h:2414
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension&#39;s actual fe objects indexed on type.
Definition: Assembly.h:2406
const VariablePhiSecond & secondPhi(const MooseVariableField< Real > &) const
Definition: Assembly.h:1329
VariablePhiValue _phi_neighbor
Definition: Assembly.h:2715
const Node *const & nodeNeighbor() const
Returns the reference to the neighboring node.
Definition: Assembly.h:551
const MooseArray< Real > & JxW() const
Returns the reference to the transformed jacobian weights.
Definition: Assembly.h:276
void reinitMortarElem(const Elem *elem)
reinitialize a mortar segment mesh element in order to get a proper JxW
Definition: Assembly.C:2404
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1717
Real _current_side_volume
Volume of the current side element.
Definition: Assembly.h:2612
std::set< FEType > _need_div
Definition: Assembly.h:2872
VectorVariablePhiCurl _vector_curl_phi
Definition: Assembly.h:2727
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:2802
const bool _displaced
Definition: Assembly.h:2319
void buildVectorFE(FEType type) const
Build Vector FEs with a type.
Definition: Assembly.C:453
VectorVariablePhiCurl _vector_curl_phi_face_neighbor
Definition: Assembly.h:2745
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:4416
void reinitFVFace(const FaceInfo &fi)
Definition: Assembly.C:1857
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_lower
Vector FE objects for lower dimensional elements.
Definition: Assembly.h:2562
const MooseArray< Real > & JxWFace() const
Returns the reference to the transformed jacobian weights on a current face.
Definition: Assembly.h:351
const MooseArray< Real > & JxWNeighbor() const
Returns the reference to the transformed jacobian weights on a current face.
Definition: Assembly.C:259
const Node * _current_node
The current node we are working with.
Definition: Assembly.h:2626
bool _building_helpers
Whether we are currently building the FE classes for the helpers.
Definition: Assembly.h:2380
bool _calculate_face_xyz
Definition: Assembly.h:2862
This is the XFEMInterface class.
Definition: XFEMInterface.h:37
DGJacobianType
Definition: MooseTypes.h:798
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
Definition: MooseTypes.h:349
std::vector< ADReal > _ad_dxidx_map
Definition: Assembly.h:2840
std::vector< ADReal > _ad_dxidy_map
Definition: Assembly.h:2841
std::vector< VectorValue< ADReal > > _ad_d2xyzdxideta_map
Definition: Assembly.h:2835
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face_neighbor
Definition: Assembly.h:2780
void addJacobian(GlobalDataKey)
Adds all local Jacobian to the global Jacobian matrices.
Definition: Assembly.C:3848
MooseArray< Point > _current_normals
The current Normal vectors at the quadrature points.
Definition: Assembly.h:2534
void buildVectorFaceFE(FEType type) const
Build Vector FEs for a face with a type.
Definition: Assembly.C:484
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.C:19
void havePRefinement(const std::unordered_set< FEFamily > &disable_p_refinement_for_families)
Indicate that we have p-refinement.
Definition: Assembly.C:4835
void setCurrentSubdomainID(SubdomainID i)
set the current subdomain ID
Definition: Assembly.h:424
const std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > & scalarFieldCouplingEntries() const
Definition: Assembly.h:1313
const MooseArray< ADReal > & adJxWFace() const
Definition: Assembly.h:280
MooseArray< VectorValue< ADReal > > _ad_q_points
Definition: Assembly.h:2839
const VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1350
VectorVariablePhiGradient _vector_grad_phi_face
Definition: Assembly.h:2731
MooseArray< VectorValue< ADReal > > _ad_q_points_face
Definition: Assembly.h:2852
VariablePhiValue & phiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1591
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const libMesh::CouplingMatrix * _cm
Coupling matrices.
Definition: Assembly.h:2322
const VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1409
const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase &fe)
Attaches the current elem/volume quadrature rule to the given fe.
Definition: Assembly.h:1911
void hasScalingVector()
signals this object that a vector containing variable scaling factors should be used when doing resid...
Definition: Assembly.C:4550
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:1458
VariablePhiGradient & gradPhi(const MooseVariableField< Real > &)
Definition: Assembly.h:1465
OutputTools< RealVectorValue >::VariablePhiValue VectorVariablePhiValue
Definition: MooseTypes.h:365
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhi(FEType type) const
Definition: Assembly.h:1765
std::unique_ptr< libMesh::QBase > fv_face
finite volume face/flux quadrature rule (meshdim-1)
Definition: Assembly.h:2450
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_dual_lower
Definition: Assembly.h:2774
void zeroCachedJacobian(GlobalDataKey)
Zero out previously-cached Jacobian rows.
Definition: Assembly.C:4488
CoordinateSystemType
Definition: MooseTypes.h:858
const VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1419
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:2194
void constrain_element_vector(DenseVector< Number > &rhs, std::vector< dof_id_type > &dofs, bool asymmetric_constraint_rows=true) const
void setNeighborQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for neighbor integration.
Definition: Assembly.C:709
bool computingResidual() const
Definition: Assembly.h:1949
void activateDual()
Indicates that dual shape functions are used for mortar constraint.
Definition: Assembly.h:617
void prepareVariableNonlocal(MooseVariableFieldBase *var)
Definition: Assembly.C:2780
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face
Definition: Assembly.h:2770
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:2777
const VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &) const
Definition: Assembly.h:1337
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:3382
MooseArray< Real > _coord_msm
The coordinate transformation coefficients evaluated on the quadrature points of the mortar segment m...
Definition: Assembly.h:2578
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:1124
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Keg
Definition: Assembly.h:2684
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1604
bool _need_lower_d_elem_volume
Whether we need to compute the lower dimensional element volume.
Definition: Assembly.h:2639
LocalDataKey(const LocalDataKey &)
Definition: Assembly.h:868
bool _user_added_fe_face_of_helper_type
Definition: Assembly.h:2366
const MooseArray< Point > & qPointsFace() const
Returns the reference to the current quadrature being used.
Definition: Assembly.h:345
DenseVector< Number > & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
Get local residual block for a variable and a tag.
Definition: Assembly.h:1115
VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1496
void buildVectorNeighborFE(FEType type) const
Build Vector FEs for a neighbor with a type.
Definition: Assembly.C:514
std::unique_ptr< ArbitraryQuadrature > arbitrary_vol
volume/elem (meshdim) custom points quadrature rule
Definition: Assembly.h:2452
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:1393
void initNonlocalCoupling()
Create pair of variables requiring nonlocal jacobian contributions.
Definition: Assembly.C:2649
ConstraintJacobianType
Definition: MooseTypes.h:845
const VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1443
std::map< unsigned int, FEBase * > _holder_fe_face_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2522
const bool & _computing_jacobian
Whether we are currently computing the Jacobian.
Definition: Assembly.h:2329
void computeCurrentNeighborVolume()
VariablePhiSecond & secondPhiFace(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1586
const Elem *const & neighbor() const
Return the neighbor element.
Definition: Assembly.h:470
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_neighbor
Definition: Assembly.h:2552
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:2270
void resize(const unsigned int new_m, const unsigned int new_n)
const OutputTools< OutputType >::VariablePhiValue & fePhiFaceNeighbor(FEType type) const
Definition: Assembly.h:1709
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1486
void cacheJacobianNonlocal(GlobalDataKey)
Takes the values that are currently in _sub_Keg and appends them to the cached values.
Definition: Assembly.C:4066
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:1335
VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1472
VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1551
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_neighbor_helper
Definition: Assembly.h:2375
void computeSinglePointMapAD(const Elem *elem, const std::vector< Real > &qw, unsigned p, FEBase *fe)
compute the finite element reference-physical mapping quantities (such as JxW) with possible dependen...
Definition: Assembly.C:1001
void helpersRequestData()
request phi, dphi, xyz, JxW, etc.
Definition: Assembly.C:4802
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_nonlocal_entry
Entries in the coupling matrix for field variables for nonlocal calculations.
Definition: Assembly.h:2343
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:4438
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)
Push a local residual block with proper scaling into cache.
Definition: Assembly.C:3264
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:2902
VectorVariablePhiSecond _vector_second_phi_face_neighbor
Definition: Assembly.h:2744
void buildLowerDFE(FEType type) const
Build FEs for a lower dimensional element with a type.
Definition: Assembly.C:358
unsigned int _current_side
The current side of the selected element (valid only when working with sides)
Definition: Assembly.h:2608
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
Definition: Assembly.h:235
const VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1448
void setCachedJacobian(GlobalDataKey)
Sets previously-cached Jacobian values via SparseMatrix::set() calls.
Definition: Assembly.C:4468
VariablePhiSecond _second_phi
Definition: Assembly.h:2753
std::map< unsigned int, FEBase * > _holder_fe_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2410
const libMesh::CouplingMatrix & _nonlocal_cm
Definition: Assembly.h:2323
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiNeighbor(FEType type) const
Definition: Assembly.h:1701
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:216
BoundaryID _current_boundary_id
The current boundary ID.
Definition: Assembly.h:2604
const OutputTools< OutputType >::VariablePhiGradient & feGradDualPhiLower(FEType type) const
Definition: Assembly.h:2937
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFace(FEType type) const
Definition: Assembly.h:1679
void prepareVariable(MooseVariableFieldBase *var)
Used for preparing the dense residual and jacobian blocks for one particular variable.
Definition: Assembly.C:2750
const Elem * _current_neighbor_side_elem
The current side element of the ncurrent neighbor element.
Definition: Assembly.h:2620
DenseMatrix< Number > _element_matrix
A working matrix to avoid repeated heap allocations when caching Jacobians that must have libMesh-lev...
Definition: Assembly.h:2897
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:2019
void copyFaceShapes(MooseVariableField< T > &v)
Definition: Assembly.C:3038
std::vector< dof_id_type > _extra_elem_ids
Extra element IDs.
Definition: Assembly.h:2541
const libMesh::QBase *const & qRuleNeighbor() const
Returns the reference to the current quadrature being used on a current neighbor. ...
Definition: Assembly.h:518
void clearCachedQRules()
Set the cached quadrature rules to nullptr.
Definition: Assembly.C:726
void addJacobianBlockTags(libMesh::SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const libMesh::DofMap &dof_map, std::vector< dof_id_type > &dof_indices, GlobalDataKey, const std::set< TagID > &tags)
Add element matrix for ivar rows and jvar columns to the global Jacobian matrix for given tags...
Definition: Assembly.C:4206
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:3337
bool _current_side_volume_computed
Boolean to indicate whether current element side volumes has been computed.
Definition: Assembly.h:2632
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data_face
Definition: Assembly.h:2788
std::vector< dof_id_type > _column_indices
Definition: Assembly.h:2902
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:2261
std::unique_ptr< ArbitraryQuadrature > arbitrary_face
area/face (meshdim-1) custom points quadrature rule
Definition: Assembly.h:2454
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:147
const VariablePhiValue & phi(const MooseVariableField< Real > &) const
Definition: Assembly.h:1325
const std::vector< Point > & qPointsMortar() const
Returns the reference to the mortar segment element quadrature points.
Definition: Assembly.h:264
const SubdomainID & currentSubdomainID() const
Return the current subdomain ID.
Definition: Assembly.h:419
const Real & elemVolume() const
Returns the reference to the current element volume.
Definition: Assembly.h:440
void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector< dof_id_type > &dof_indices)
Definition: Assembly.C:2900
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
Definition: Assembly.h:2551
void addJacobianNeighbor(GlobalDataKey)
Add ElementNeighbor, NeighborElement, and NeighborNeighbor portions of the Jacobian for compute objec...
Definition: Assembly.C:3883
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:2350
VectorVariablePhiDivergence _div_phi
Definition: Assembly.h:2765
VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1530
OutputTools< RealVectorValue >::VariablePhiCurl VectorVariablePhiCurl
Definition: MooseTypes.h:368
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...
void addResidualBlock(NumericVector< Number > &residual, DenseVector< Number > &res_block, const std::vector< dof_id_type > &dof_indices, const std::vector< Real > &scaling_factor)
Add a local residual block to a global residual vector with proper scaling.
Definition: Assembly.C:3249
bool _custom_mortar_qrule
Flag specifying whether a custom quadrature rule has been specified for mortar segment mesh...
Definition: Assembly.h:2592
const unsigned int & side() const
Returns the current side.
Definition: Assembly.h:446
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:132
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:3665
bool computingJacobian() const
Definition: Assembly.h:1954
Real _current_neighbor_lower_d_elem_volume
The current neighboring lower dimensional element volume.
Definition: Assembly.h:2645
bool _need_neighbor_lower_d_elem_volume
Whether we need to compute the neighboring lower dimensional element volume.
Definition: Assembly.h:2643
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition: Assembly.h:2422
bool _user_added_fe_of_helper_type
Whether user code requested a FEType the same as our _helper_type.
Definition: Assembly.h:2365
void setResidualBlock(NumericVector< Number > &residual, DenseVector< Number > &res_block, const std::vector< dof_id_type > &dof_indices, const std::vector< Real > &scaling_factor)
Set a local residual block to a global residual vector with proper scaling.
Definition: Assembly.C:3287
void setLowerQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for lower dimensional integration.
Definition: Assembly.C:690
Moose::CoordinateSystemType _coord_type
The coordinate system.
Definition: Assembly.h:2426
void cacheJacobianMortar(GlobalDataKey)
Cache all portions of the Jacobian, e.g.
Definition: Assembly.C:4126
std::unique_ptr< ArbitraryQuadrature > neighbor
area/face (meshdim-1) custom points quadrature rule for DG
Definition: Assembly.h:2456
unsigned int n() const
void buildVectorFaceNeighborFE(FEType type) const
Build Vector FEs for a neighbor face with a type.
Definition: Assembly.C:544
void buildVectorDualLowerDFE(FEType type) const
Definition: Assembly.C:428
void bumpVolumeQRuleOrder(Order volume_order, SubdomainID block)
Increases the element/volume quadrature order for the specified mesh block if and only if the current...
Definition: Assembly.C:575
const SubdomainID & currentNeighborSubdomainID() const
Return the current subdomain ID.
Definition: Assembly.h:497
VectorVariablePhiSecond _vector_second_phi_neighbor
Definition: Assembly.h:2738
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:1869
Storage for all of the information pretaining to a vector tag.
Definition: VectorTag.h:17
VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1571
const Node *const & node() const
Returns the reference to the node.
Definition: Assembly.h:545
VariablePhiSecond _second_phi
Definition: Assembly.h:2709
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:2348
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiNeighbor(FEType type) const
Definition: Assembly.h:1694
std::map< unsigned int, FEBase * > _holder_fe_lower_helper
helper object for transforming coordinates for lower dimensional element quadrature points ...
Definition: Assembly.h:2564
static constexpr subdomain_id_type invalid_subdomain_id
const libMesh::DofMap & _dof_map
DOF map.
Definition: Assembly.h:2352
VectorVariablePhiDivergence _vector_div_phi
Definition: Assembly.h:2728
void setCurrentNeighborSubdomainID(SubdomainID i)
set the current subdomain ID
Definition: Assembly.h:502
void computeADFace(const Elem &elem, const unsigned int side)
compute AD things on an element face
Definition: Assembly.C:2111
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_neighbor
Definition: Assembly.h:2779
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:3531
std::vector< std::vector< dof_id_type > > _cached_jacobian_cols
Column where the corresponding cached value should go.
Definition: Assembly.h:2814
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
Definition: Assembly.C:3791
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition: Assembly.h:2530
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:2925
void bumpAllQRuleOrder(Order order, SubdomainID block)
Increases the element/volume and face/area quadrature orders for the specified mesh block if and only...
Definition: Assembly.C:598
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition: Assembly.h:476
const VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1367
const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase &fe)
Attaches the current face/area quadrature rule to the given fe.
Definition: Assembly.h:1923
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition: Assembly.h:2610
const MooseArray< std::vector< Point > > & tangents() const
Returns the array of tangents for quadrature points on a current side.
Definition: Assembly.h:368
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:2819
const Elem *const & neighborLowerDElem() const
Return the neighboring lower dimensional element.
Definition: Assembly.h:482
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhi(FEType type) const
Definition: Assembly.h:1638
FEBase * _current_fe_helper
The current helper object for transforming coordinates.
Definition: Assembly.h:2412
bool _need_JxW_neighbor
Flag to indicate that JxW_neighbor is needed.
Definition: Assembly.h:2571
const VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1438
void copyNeighborShapes(MooseVariableField< T > &v)
Definition: Assembly.C:3075
void cacheJacobianCoupledVarPair(const MooseVariableBase &ivar, const MooseVariableBase &jvar)
Caches element matrix for ivar rows and jvar columns.
Definition: Assembly.C:4050
VectorVariablePhiSecond _vector_second_phi_face
Definition: Assembly.h:2732
const MooseArray< ADPoint > & adNormals() const
Definition: Assembly.h:393
VariablePhiGradient _grad_phi_face
Definition: Assembly.h:2712
MooseArray< Point > _current_q_points_face_neighbor
The current quadrature points on the neighbor face.
Definition: Assembly.h:2569
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:2881
const VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1397
VectorVariablePhiCurl _vector_curl_phi_face
Definition: Assembly.h:2733
bool _need_dual
Whether dual shape functions need to be computed for mortar constraints.
Definition: Assembly.h:2647
auto index_range(const T &sizable)
const std::vector< Real > & jxWMortar() const
Returns a reference to JxW for mortar segment elements.
Definition: Assembly.h:707
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:192
Key structure for APIs adding/caching local element residuals/Jacobians.
Definition: Assembly.h:862
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:387
DenseVector< Number > _element_vector
A working vector to avoid repeated heap allocations when caching residuals that must have libMesh-lev...
Definition: Assembly.h:2892
std::set< FEType > _need_face_div
Definition: Assembly.h:2873
const Real & sideElemVolume() const
Returns the reference to the volume of current side element.
Definition: Assembly.h:464
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition: Assembly.h:2602
const Elem *& sideElem()
Returns the side element.
Definition: Assembly.h:458
VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &)
Definition: Assembly.h:1526
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1612
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:168
std::map< unsigned int, const std::vector< Point > * > _holder_normals
Holds pointers to the dimension&#39;s normal vectors.
Definition: Assembly.h:2545
Base variable class.
std::map< FEType, FEVectorBase * > _current_vector_fe_neighbor
The "neighbor" vector fe object that matches the current elem.
Definition: Assembly.h:2399
void clearCachedResiduals(GlobalDataKey)
Clears all of the residuals in _cached_residual_rows and _cached_residual_values. ...
Definition: Assembly.C:3483
unsigned int THREAD_ID
Definition: MooseTypes.h:237
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition: Assembly.h:2628
std::vector< VectorValue< ADReal > > _ad_d2xyzdeta2_map
Definition: Assembly.h:2836
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:3102
void clearCachedJacobian()
Clear any currently cached jacobians.
Definition: Assembly.C:4498
uint8_t dof_id_type
const BoundaryID & currentBoundaryID() const
Return the current boundary ID.
Definition: Assembly.h:429
VectorVariablePhiDivergence _vector_div_phi_face_neighbor
Definition: Assembly.h:2746
libMesh::QBase *const & writeableQRuleFace()
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:328
const VariablePhiGradient & gradPhiFace() const
Definition: Assembly.h:1336
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knl
dprimary/dlower (or dneighbor/dlower)
Definition: Assembly.h:2701
const OutputTools< OutputType >::VariablePhiValue & fePhiFace(FEType type) const
Definition: Assembly.h:1659
VariablePhiValue & phi(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1577
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1473
VariablePhiGradient & gradPhi(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1578
void reinitFEFace(const Elem *elem, unsigned int side)
Just an internal helper function to reinit the face FE objects.
Definition: Assembly.C:1268
MooseArray< ADReal > _ad_JxW
Definition: Assembly.h:2838
MooseArray< ADReal > _ad_JxW_face
Definition: Assembly.h:2850
void computeFaceMap(const Elem &elem, const unsigned int side, const std::vector< Real > &qw)
Definition: Assembly.C:1348
VariablePhiValue & phiFace(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1581
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:2272
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:844