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 * const & sideElem() const { 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 
1841  unsigned int i,
1842  unsigned int ntest,
1843  unsigned int j,
1844  unsigned int nphi,
1845  unsigned int ivar,
1846  const RealEigenVector & v) const
1847  {
1848  unsigned int pace = (_component_block_diagonal[ivar] ? 0 : nphi);
1849  for (unsigned int k = 0; k < v.size(); ++k, i += ntest, j += pace)
1850  ke(i, j) += v(k);
1851  }
1852 
1866  unsigned int i,
1867  unsigned int ntest,
1868  unsigned int j,
1869  unsigned int nphi,
1870  unsigned int ivar,
1871  unsigned int jvar,
1872  const RealEigenMatrix & v) const
1873  {
1874  if (ivar == jvar && _component_block_diagonal[ivar])
1875  {
1876  for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1877  ke(i, j) += v(k, k);
1878  }
1879  else
1880  {
1881  const unsigned int saved_j = j;
1882  for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1883  {
1884  j = saved_j;
1885  for (unsigned int l = 0; l < v.cols(); ++l, j += nphi)
1886  ke(i, j) += v(k, l);
1887  }
1888  }
1889  }
1890 
1892  {
1893  unsigned int rows = ke.m();
1894  unsigned int cols = ke.n();
1895  DenseVector<Real> diag(rows);
1896  for (unsigned int i = 0; i < rows; i++)
1897  // % operation is needed to account for cases of no component coupling of array variables
1898  diag(i) = ke(i, i % cols);
1899  return diag;
1900  }
1901 
1907  inline const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase & fe)
1908  {
1909  auto qrule = qrules(dim).vol.get();
1910  fe.attach_quadrature_rule(qrule);
1911  return qrule;
1912  }
1913 
1919  inline const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase & fe)
1920  {
1921  auto qrule = qrules(dim).face.get();
1922  fe.attach_quadrature_rule(qrule);
1923  return qrule;
1924  }
1925 
1930  void hasScalingVector();
1931 
1940  void modifyArbitraryWeights(const std::vector<Real> & weights);
1941 
1945  bool computingResidual() const { return _computing_residual; }
1946 
1950  bool computingJacobian() const { return _computing_jacobian; }
1951 
1956 
1960  const Elem * const & msmElem() const { return _msm_elem; }
1961 
1971  void havePRefinement(const std::unordered_set<FEFamily> & disable_p_refinement_for_families);
1972 
1976  void setCurrentLowerDElem(const Elem * const lower_d_elem);
1977 
1978 private:
1984  void reinitFE(const Elem * elem);
1985 
1992  void reinitFEFace(const Elem * elem, unsigned int side);
1993 
1994  void computeFaceMap(const Elem & elem, const unsigned int side, const std::vector<Real> & qw);
1995 
1996  void reinitFEFaceNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1997 
1998  void reinitFENeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1999 
2000  template <typename Points, typename Coords>
2001  void setCoordinateTransformation(const libMesh::QBase * qrule,
2002  const Points & q_points,
2003  Coords & coord,
2004  SubdomainID sub_id);
2005 
2006  void computeCurrentElemVolume();
2007 
2008  void computeCurrentFaceVolume();
2009 
2011 
2017  void modifyWeightsDueToXFEM(const Elem * elem);
2018 
2025  void modifyFaceWeightsDueToXFEM(const Elem * elem, unsigned int side = 0);
2026 
2031  template <typename OutputType>
2032  void computeGradPhiAD(const Elem * elem,
2033  unsigned int n_qp,
2036 
2040  void resizeADMappingObjects(unsigned int n_qp, unsigned int dim);
2041 
2046  void
2047  computeSinglePointMapAD(const Elem * elem, const std::vector<Real> & qw, unsigned p, FEBase * fe);
2048 
2052  void addResidual(const VectorTag & vector_tag);
2056  void addResidualNeighbor(const VectorTag & vector_tag);
2061  void addResidualLower(const VectorTag & vector_tag);
2065  void addResidualScalar(const VectorTag & vector_tag);
2066 
2070  void clearCachedResiduals(const VectorTag & vector_tag);
2071 
2080  void cacheResidual(dof_id_type dof, Real value, TagID tag_id);
2081 
2090  void cacheResidual(dof_id_type dof, Real value, const std::set<TagID> & tags);
2091 
2096  void processLocalResidual(DenseVector<Number> & res_block,
2097  std::vector<dof_id_type> & dof_indices,
2098  const std::vector<Real> & scaling_factor);
2099 
2103  void addResidualBlock(NumericVector<Number> & residual,
2104  DenseVector<Number> & res_block,
2105  const std::vector<dof_id_type> & dof_indices,
2106  const std::vector<Real> & scaling_factor);
2107 
2111  void cacheResidualBlock(std::vector<Real> & cached_residual_values,
2112  std::vector<dof_id_type> & cached_residual_rows,
2113  DenseVector<Number> & res_block,
2114  const std::vector<dof_id_type> & dof_indices,
2115  const std::vector<Real> & scaling_factor);
2116 
2120  void setResidualBlock(NumericVector<Number> & residual,
2121  DenseVector<Number> & res_block,
2122  const std::vector<dof_id_type> & dof_indices,
2123  const std::vector<Real> & scaling_factor);
2124 
2129  DenseMatrix<Number> & jac_block,
2130  const MooseVariableBase & ivar,
2131  const MooseVariableBase & jvar,
2132  const std::vector<dof_id_type> & idof_indices,
2133  const std::vector<dof_id_type> & jdof_indices);
2134 
2138  void cacheJacobianBlock(DenseMatrix<Number> & jac_block,
2139  const MooseVariableBase & ivar,
2140  const MooseVariableBase & jvar,
2141  const std::vector<dof_id_type> & idof_indices,
2142  const std::vector<dof_id_type> & jdof_indices,
2143  TagID tag);
2144 
2149  const MooseVariableBase & ivar,
2150  const MooseVariableBase & jvar,
2151  const std::vector<dof_id_type> & idof_indices,
2152  const std::vector<dof_id_type> & jdof_indices,
2153  TagID tag);
2154 
2158  void addJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2159 
2163  void cacheJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2164 
2170  void clearCachedJacobian();
2171 
2176  void buildFE(FEType type) const;
2177 
2182  void buildFaceFE(FEType type) const;
2183 
2188  void buildNeighborFE(FEType type) const;
2189 
2194  void buildFaceNeighborFE(FEType type) const;
2195 
2200  void buildLowerDFE(FEType type) const;
2201 
2202  void buildLowerDDualFE(FEType type) const;
2203 
2208  void buildVectorFE(FEType type) const;
2209 
2214  void buildVectorFaceFE(FEType type) const;
2215 
2220  void buildVectorNeighborFE(FEType type) const;
2221 
2226  void buildVectorFaceNeighborFE(FEType type) const;
2227 
2232  void buildVectorLowerDFE(FEType type) const;
2233  void buildVectorDualLowerDFE(FEType type) const;
2234 
2239  void jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2240  {
2241  _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2242  }
2243 
2248  char jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2249  {
2250  return _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2251  }
2252 
2257  void jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2258  {
2259  _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2260  }
2261 
2266  char jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2267  {
2268  return _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2269  }
2270 
2275  void jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2276  {
2277  _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2278  }
2279 
2284  char jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2285  {
2286  return _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2287  }
2288 
2293  void jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2294  {
2295  _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2296  }
2297 
2302  char jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2303  {
2304  return _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2305  }
2306 
2310  void helpersRequestData();
2311 
2314 
2315  const bool _displaced;
2316 
2320 
2322  const bool & _computing_residual;
2323 
2325  const bool & _computing_jacobian;
2326 
2329 
2331  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_ff_entry;
2333  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> _cm_fs_entry;
2335  std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> _cm_sf_entry;
2337  std::vector<std::pair<MooseVariableScalar *, MooseVariableScalar *>> _cm_ss_entry;
2339  std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_nonlocal_entry;
2341  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_used;
2342  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_nonlocal_used;
2344  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_neighbor_used;
2346  std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_lower_used;
2351 
2353 
2354  unsigned int _mesh_dimension;
2355 
2359 
2366 
2369  std::vector<std::unique_ptr<FEBase>> _unique_fe_helper;
2370  std::vector<std::unique_ptr<FEBase>> _unique_fe_face_helper;
2371  std::vector<std::unique_ptr<FEBase>> _unique_fe_face_neighbor_helper;
2372  std::vector<std::unique_ptr<FEBase>> _unique_fe_neighbor_helper;
2373  std::vector<std::unique_ptr<FEBase>> _unique_fe_lower_helper;
2374 
2377 
2379  std::shared_ptr<XFEMInterface> _xfem;
2380 
2382  std::map<FEType, FEBase *> _current_fe;
2384  std::map<FEType, FEBase *> _current_fe_face;
2386  std::map<FEType, FEBase *> _current_fe_neighbor;
2388  std::map<FEType, FEBase *> _current_fe_face_neighbor;
2389 
2391  std::map<FEType, FEVectorBase *> _current_vector_fe;
2393  std::map<FEType, FEVectorBase *> _current_vector_fe_face;
2395  std::map<FEType, FEVectorBase *> _current_vector_fe_neighbor;
2397  std::map<FEType, FEVectorBase *> _current_vector_fe_face_neighbor;
2398 
2399  /**** Volume Stuff ****/
2400 
2402  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe;
2404  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe;
2406  std::map<unsigned int, FEBase *> _holder_fe_helper;
2427 
2430  struct QRules
2431  {
2433  : vol(nullptr),
2434  face(nullptr),
2435  arbitrary_vol(nullptr),
2436  arbitrary_face(nullptr),
2437  neighbor(nullptr)
2438  {
2439  }
2440 
2442  std::unique_ptr<libMesh::QBase> vol;
2444  std::unique_ptr<libMesh::QBase> face;
2446  std::unique_ptr<libMesh::QBase> fv_face;
2448  std::unique_ptr<ArbitraryQuadrature> arbitrary_vol;
2450  std::unique_ptr<ArbitraryQuadrature> arbitrary_face;
2452  std::unique_ptr<ArbitraryQuadrature> neighbor;
2453  };
2454 
2459  std::unordered_map<SubdomainID, std::vector<QRules>> _qrules;
2460 
2467  libMesh::QBase * qruleFace(const Elem * elem, unsigned int side);
2468  ArbitraryQuadrature * qruleArbitraryFace(const Elem * elem, unsigned int side);
2469 
2470  template <typename T>
2471  T * qruleFaceHelper(const Elem * elem, unsigned int side, std::function<T *(QRules &)> rule_fn)
2472  {
2473  auto dim = elem->dim();
2474  auto neighbor = elem->neighbor_ptr(side);
2475  auto q = rule_fn(qrules(dim, elem->subdomain_id()));
2476  if (!neighbor)
2477  return q;
2478 
2479  // find the maximum face quadrature order for all blocks the face is in
2480  auto neighbor_block = neighbor->subdomain_id();
2481  if (neighbor_block == elem->subdomain_id())
2482  return q;
2483 
2484  auto q_neighbor = rule_fn(qrules(dim, neighbor_block));
2485  if (q->get_order() > q_neighbor->get_order())
2486  return q;
2487  return q_neighbor;
2488  }
2489 
2490  inline QRules & qrules(unsigned int dim) { return qrules(dim, _current_subdomain_id); }
2491 
2495  inline QRules & qrules(unsigned int dim, SubdomainID block)
2496  {
2497  if (_qrules.find(block) == _qrules.end())
2498  {
2499  mooseAssert(_qrules.find(Moose::ANY_BLOCK_ID) != _qrules.end(),
2500  "missing quadrature rules for specified block");
2501  mooseAssert(_qrules[Moose::ANY_BLOCK_ID].size() > dim,
2502  "quadrature rules not sized property for dimension");
2503  return _qrules[Moose::ANY_BLOCK_ID][dim];
2504  }
2505  mooseAssert(_qrules.find(block) != _qrules.end(),
2506  "missing quadrature rules for specified block");
2507  mooseAssert(_qrules[block].size() > dim, "quadrature rules not sized property for dimension");
2508  return _qrules[block][dim];
2509  }
2510 
2511  /**** Face Stuff ****/
2512 
2514  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face;
2516  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face;
2518  std::map<unsigned int, FEBase *> _holder_fe_face_helper;
2532  std::vector<Eigen::Map<RealDIMValue>> _mapped_normals;
2535 
2537  std::vector<dof_id_type> _extra_elem_ids;
2539  std::vector<dof_id_type> _neighbor_extra_elem_ids;
2541  std::map<unsigned int, const std::vector<Point> *> _holder_normals;
2542 
2543  /**** Neighbor Stuff ****/
2544 
2546  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_neighbor;
2547  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face_neighbor;
2548  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_neighbor;
2549  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face_neighbor;
2550 
2552  std::map<unsigned int, FEBase *> _holder_fe_neighbor_helper;
2553  std::map<unsigned int, FEBase *> _holder_fe_face_neighbor_helper;
2554 
2556  mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_lower;
2558  mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_lower;
2560  std::map<unsigned int, FEBase *> _holder_fe_lower_helper;
2561 
2567  mutable bool _need_JxW_neighbor;
2575 
2576  /********** mortar stuff *************/
2577 
2579  const std::vector<Real> * _JxW_msm;
2581  std::unique_ptr<FEBase> _fe_msm;
2589 
2593 
2594 protected:
2596  const Elem * _current_elem;
2604  unsigned int _current_side;
2606  const Elem * _current_side_elem;
2622  const Node * _current_node;
2629 
2644 
2647 
2648  /*
2649  * Residual contributions <tag_index, ivar>
2650  *
2651  * tag_index is the index into _residual_vector_tags, that is, _sub_Re[0] corresponds to the tag
2652  * with TagID _residual_vector_tags[0]._id
2653  *
2654  * When ivar corresponds to an array variable, the dense vector is in size of ndof * count,
2655  * where count is the number of components of the array variable. The local residual is ordered
2656  * as (r_i,j, i = 1,...,ndof; j = 1,...,count).
2657  *
2658  * Dense vectors for variables (ivar+i, i = 1,...,count) are empty.
2659  */
2660  std::vector<std::vector<DenseVector<Number>>> _sub_Re;
2661  std::vector<std::vector<DenseVector<Number>>> _sub_Rn;
2663  std::vector<std::vector<DenseVector<Number>>> _sub_Rl;
2664 
2667 
2668  /*
2669  * Jacobian contributions <Tag, ivar, jvar>
2670  * When ivar corresponds to an array variable, the number of rows of the dense matrix is in size
2671  * of indof * icount, where icount is the number of components of ivar. When jvar corresponds to
2672  * an array variable, the number of columns of the dense matrix is in size of jndof * jcount,
2673  * where jcount is the number of components of jvar. The local residual is ordered as
2674  * (K_(i,j,k,l), k=1,...,jndof; l = 1,...,jcout; i = 1,...,indof; j = 1,...,icount).
2675  *
2676  * Dense matrices for variables (ivar+i, i = 1,...,icount) or (jvar+j, j = 1,...,jcount) are
2677  * empty.
2678  */
2679  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kee;
2680  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Keg;
2681 
2683  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Ken;
2685  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kne;
2687  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knn;
2689  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kll;
2691  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kle;
2693  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kln;
2695  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kel;
2697  std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knl;
2698 
2701 
2702  // Shape function values, gradients. second derivatives
2706 
2710 
2714 
2718 
2719  // Shape function values, gradients, second derivatives
2725 
2731 
2737 
2743 
2745  {
2746  public:
2752  };
2753 
2755  {
2756  public:
2762  };
2763 
2765  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data;
2766  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face;
2767  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_neighbor;
2768  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face_neighbor;
2769  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_lower;
2770  mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_dual_lower;
2771 
2773  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data;
2774  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face;
2775  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_neighbor;
2776  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face_neighbor;
2777  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_lower;
2778  mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_dual_lower;
2779 
2780  mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data;
2781  mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>> _ad_vector_grad_phi_data;
2782  mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data_face;
2783  mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>>
2785 
2795  const std::vector<VectorTag> & _residual_vector_tags;
2796 
2798  std::vector<std::vector<Real>> _cached_residual_values;
2799 
2801  std::vector<std::vector<dof_id_type>> _cached_residual_rows;
2802 
2804 
2806  std::vector<std::vector<Real>> _cached_jacobian_values;
2808  std::vector<std::vector<dof_id_type>> _cached_jacobian_rows;
2810  std::vector<std::vector<dof_id_type>> _cached_jacobian_cols;
2811 
2813 
2818  std::vector<bool> _component_block_diagonal;
2819 
2821  std::vector<dof_id_type> _temp_dof_indices;
2822 
2824  std::vector<Point> _temp_reference_points;
2825 
2827  std::vector<VectorValue<ADReal>> _ad_dxyzdxi_map;
2828  std::vector<VectorValue<ADReal>> _ad_dxyzdeta_map;
2829  std::vector<VectorValue<ADReal>> _ad_dxyzdzeta_map;
2830  std::vector<VectorValue<ADReal>> _ad_d2xyzdxi2_map;
2831  std::vector<VectorValue<ADReal>> _ad_d2xyzdxideta_map;
2832  std::vector<VectorValue<ADReal>> _ad_d2xyzdeta2_map;
2833  std::vector<ADReal> _ad_jac;
2836  std::vector<ADReal> _ad_dxidx_map;
2837  std::vector<ADReal> _ad_dxidy_map;
2838  std::vector<ADReal> _ad_dxidz_map;
2839  std::vector<ADReal> _ad_detadx_map;
2840  std::vector<ADReal> _ad_detady_map;
2841  std::vector<ADReal> _ad_detadz_map;
2842  std::vector<ADReal> _ad_dzetadx_map;
2843  std::vector<ADReal> _ad_dzetady_map;
2844  std::vector<ADReal> _ad_dzetadz_map;
2845 
2851 
2855  std::vector<std::pair<unsigned int, unsigned short>> _disp_numbers_and_directions;
2856 
2857  mutable bool _calculate_xyz;
2858  mutable bool _calculate_face_xyz;
2860 
2863  mutable bool _calculate_ad_coord;
2864 
2865  mutable std::set<FEType> _need_second_derivative;
2866  mutable std::set<FEType> _need_second_derivative_neighbor;
2867  mutable std::set<FEType> _need_curl;
2868  mutable std::set<FEType> _need_div;
2869  mutable std::set<FEType> _need_face_div;
2870  mutable std::set<FEType> _need_neighbor_div;
2871  mutable std::set<FEType> _need_face_neighbor_div;
2872 
2874  const NumericVector<Real> * _scaling_vector = nullptr;
2875 
2882 
2883  const Elem * _msm_elem = nullptr;
2884 
2889 
2894 
2898  std::vector<dof_id_type> _row_indices, _column_indices;
2899 
2902 
2904  std::vector<Point> _current_neighbor_ref_points;
2905 };
2906 
2907 template <typename OutputType>
2910 {
2911  buildLowerDFE(type);
2912  return _fe_shape_data_lower[type]->_phi;
2913 }
2914 
2915 template <typename OutputType>
2918 {
2919  buildLowerDDualFE(type);
2920  return _fe_shape_data_dual_lower[type]->_phi;
2921 }
2922 
2923 template <typename OutputType>
2926 {
2927  buildLowerDFE(type);
2928  return _fe_shape_data_lower[type]->_grad_phi;
2929 }
2930 
2931 template <typename OutputType>
2934 {
2935  buildLowerDDualFE(type);
2936  return _fe_shape_data_dual_lower[type]->_grad_phi;
2937 }
2938 
2939 template <>
2941 Assembly::feADGradPhi<RealVectorValue>(FEType type) const
2942 {
2943  return _ad_vector_grad_phi_data[type];
2944 }
2945 
2946 template <>
2948 Assembly::feADGradPhiFace<RealVectorValue>(FEType type) const
2949 {
2950  return _ad_vector_grad_phi_data_face[type];
2951 }
2952 
2953 template <>
2955 Assembly::fePhi<VectorValue<Real>>(FEType type) const;
2956 
2957 template <>
2959 Assembly::feGradPhi<VectorValue<Real>>(FEType type) const;
2960 
2961 template <>
2963 Assembly::feSecondPhi<VectorValue<Real>>(FEType type) const;
2964 
2965 template <>
2967 Assembly::fePhiLower<VectorValue<Real>>(FEType type) const;
2968 
2969 template <>
2971 Assembly::feDualPhiLower<VectorValue<Real>>(FEType type) const;
2972 
2973 template <>
2975 Assembly::feGradPhiLower<VectorValue<Real>>(FEType type) const;
2976 
2977 template <>
2979 Assembly::feGradDualPhiLower<VectorValue<Real>>(FEType type) const;
2980 
2981 template <>
2983 Assembly::fePhiFace<VectorValue<Real>>(FEType type) const;
2984 
2985 template <>
2987 Assembly::feGradPhiFace<VectorValue<Real>>(FEType type) const;
2988 
2989 template <>
2991 Assembly::feSecondPhiFace<VectorValue<Real>>(FEType type) const;
2992 
2993 template <>
2995 Assembly::fePhiNeighbor<VectorValue<Real>>(FEType type) const;
2996 
2997 template <>
2999 Assembly::feGradPhiNeighbor<VectorValue<Real>>(FEType type) const;
3000 
3001 template <>
3003 Assembly::feSecondPhiNeighbor<VectorValue<Real>>(FEType type) const;
3004 
3005 template <>
3007 Assembly::fePhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3008 
3009 template <>
3011 Assembly::feGradPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3012 
3013 template <>
3015 Assembly::feSecondPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3016 
3017 template <>
3019 Assembly::feCurlPhi<VectorValue<Real>>(FEType type) const;
3020 
3021 template <>
3023 Assembly::feCurlPhiFace<VectorValue<Real>>(FEType type) const;
3024 
3025 template <>
3027 Assembly::feCurlPhiNeighbor<VectorValue<Real>>(FEType type) const;
3028 
3029 template <>
3031 Assembly::feCurlPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3032 
3033 template <>
3035 Assembly::feDivPhi<VectorValue<Real>>(FEType type) const;
3036 
3037 template <>
3039 Assembly::feDivPhiFace<VectorValue<Real>>(FEType type) const;
3040 
3041 template <>
3043 Assembly::feDivPhiNeighbor<VectorValue<Real>>(FEType type) const;
3044 
3045 template <>
3047 Assembly::feDivPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3048 
3049 template <>
3051 Assembly::adGradPhi<RealVectorValue>(const MooseVariableFE<RealVectorValue> & v) const
3052 {
3053  return _ad_vector_grad_phi_data.at(v.feType());
3054 }
3055 
3056 template <typename Residuals, typename Indices>
3057 void
3058 Assembly::cacheResiduals(const Residuals & residuals,
3059  const Indices & input_row_indices,
3060  const Real scaling_factor,
3061  LocalDataKey,
3062  const std::set<TagID> & vector_tags)
3063 {
3064  mooseAssert(residuals.size() == input_row_indices.size(),
3065  "The number of residuals should match the number of dof indices");
3066  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3067 
3068  if (!computingResidual() || vector_tags.empty())
3069  return;
3070 
3071  if (residuals.size() == 1)
3072  {
3073  // No constraining is required. (This is likely a finite volume computation if we only have a
3074  // single dof)
3076  residuals, input_row_indices, scaling_factor, LocalDataKey{}, vector_tags);
3077  return;
3078  }
3079 
3080  // Need to make a copy because we might modify this in constrain_element_vector
3081  _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3082 
3084  for (const auto i : index_range(_row_indices))
3085  _element_vector(i) = MetaPhysicL::raw_value(residuals[i]) * scaling_factor;
3086 
3087  // At time of writing, this method doesn't do anything with the asymmetric_constraint_rows
3088  // argument, but we set it to false to be consistent with processLocalResidual
3090  _element_vector, _row_indices, /*asymmetric_constraint_rows=*/false);
3091 
3092  for (const auto i : index_range(_row_indices))
3093  cacheResidual(_row_indices[i], _element_vector(i), vector_tags);
3094 }
3095 
3096 template <typename Residuals, typename Indices>
3097 void
3099  const Indices & row_indices,
3100  const Real scaling_factor,
3101  LocalDataKey,
3102  const std::set<TagID> & vector_tags)
3103 {
3104  mooseAssert(residuals.size() == row_indices.size(),
3105  "The number of residuals should match the number of dof indices");
3106  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3107 
3108  if (computingResidual() && !vector_tags.empty())
3109  for (const auto i : index_range(row_indices))
3110  cacheResidual(
3111  row_indices[i], MetaPhysicL::raw_value(residuals[i]) * scaling_factor, vector_tags);
3112 }
3113 
3114 template <typename Residuals, typename Indices>
3115 void
3116 Assembly::cacheJacobian(const Residuals & residuals,
3117  const Indices & input_row_indices,
3118  const Real scaling_factor,
3119  LocalDataKey,
3120  const std::set<TagID> & matrix_tags)
3121 {
3122  if (!computingJacobian() || matrix_tags.empty())
3123  return;
3124 
3125  if (residuals.size() == 1)
3126  {
3127  // No constraining is required. (This is likely a finite volume computation if we only have a
3128  // single dof)
3130  residuals, input_row_indices, scaling_factor, LocalDataKey{}, matrix_tags);
3131  return;
3132  }
3133 
3134  const auto & compare_dofs = residuals[0].derivatives().nude_indices();
3135 #ifndef NDEBUG
3136  auto compare_dofs_set = std::set<dof_id_type>(compare_dofs.begin(), compare_dofs.end());
3137 
3138  for (const auto i : make_range(decltype(residuals.size())(1), residuals.size()))
3139  {
3140  const auto & residual = residuals[i];
3141  auto current_dofs_set = std::set<dof_id_type>(residual.derivatives().nude_indices().begin(),
3142  residual.derivatives().nude_indices().end());
3143  mooseAssert(compare_dofs_set == current_dofs_set,
3144  "We're going to see whether the dof sets are the same. IIRC the degree of freedom "
3145  "dependence (as indicated by the dof index set held by the ADReal) has to be the "
3146  "same for every residual passed to this method otherwise constrain_element_matrix "
3147  "will not work.");
3148  }
3149 #endif
3150  _column_indices.assign(compare_dofs.begin(), compare_dofs.end());
3151 
3152  // If there's no derivatives then there is nothing to do. Moreover, if we pass zero size column
3153  // indices to constrain_element_matrix then we will potentially get errors out of BLAS
3154  if (!_column_indices.size())
3155  return;
3156 
3157  // Need to make a copy because we might modify this in constrain_element_matrix
3158  _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3159 
3161  for (const auto i : index_range(_row_indices))
3162  {
3163  const auto & sparse_derivatives = residuals[i].derivatives();
3164 
3165  for (const auto j : index_range(_column_indices))
3166  _element_matrix(i, j) = sparse_derivatives[_column_indices[j]] * scaling_factor;
3167  }
3168 
3170 
3171  for (const auto i : index_range(_row_indices))
3172  for (const auto j : index_range(_column_indices))
3173  cacheJacobian(_row_indices[i], _column_indices[j], _element_matrix(i, j), {}, matrix_tags);
3174 }
3175 
3176 template <typename Residuals, typename Indices>
3177 void
3178 Assembly::cacheJacobianWithoutConstraints(const Residuals & residuals,
3179  const Indices & row_indices,
3180  const Real scaling_factor,
3181  LocalDataKey,
3182  const std::set<TagID> & matrix_tags)
3183 {
3184  mooseAssert(residuals.size() == row_indices.size(),
3185  "The number of residuals should match the number of dof indices");
3186  mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3187 
3188  if (!computingJacobian() || matrix_tags.empty())
3189  return;
3190 
3191  for (const auto i : index_range(row_indices))
3192  {
3193  const auto row_index = row_indices[i];
3194 
3195  const auto & sparse_derivatives = residuals[i].derivatives();
3196  const auto & column_indices = sparse_derivatives.nude_indices();
3197  const auto & raw_derivatives = sparse_derivatives.nude_data();
3198 
3199  for (std::size_t j = 0; j < column_indices.size(); ++j)
3200  cacheJacobian(
3201  row_index, column_indices[j], raw_derivatives[j] * scaling_factor, {}, matrix_tags);
3202  }
3203 }
3204 
3205 inline const Real &
3207 {
3210 }
3211 
3212 inline const Real &
3214 {
3217 }
3218 
3219 inline void
3221  std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions)
3222 {
3223  _disp_numbers_and_directions = std::move(disp_numbers_and_directions);
3224 }
3225 
3226 inline void
3227 Assembly::setCurrentLowerDElem(const Elem * const lower_d_elem)
3228 {
3229  _current_lower_d_elem = lower_d_elem;
3230 }
const Real & neighborVolume()
Returns the reference to the current neighbor volume.
Definition: Assembly.h:508
VariablePhiSecond _second_phi_face
Definition: Assembly.h:2709
const Elem *const & elem() const
Return the current element.
Definition: Assembly.h:414
VariablePhiSecond _second_phi_face_neighbor
Definition: Assembly.h:2717
MooseArray< VectorValue< ADReal > > _ad_normals
Definition: Assembly.h:2847
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:2881
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:2514
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition: Assembly.h:2618
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:2414
std::map< FEType, FEBase * > _current_fe
The "volume" fe object that matches the current elem.
Definition: Assembly.h:2382
MooseArray< Real > _curvatures
Definition: Assembly.h:2849
std::vector< ADReal > _ad_detadz_map
Definition: Assembly.h:2841
VectorVariablePhiValue _phi
Definition: Assembly.h:2757
SystemBase & _sys
Definition: Assembly.h:2312
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:2801
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:2808
Eigen::Matrix< ADReal, Eigen::Dynamic, 1 > ADRealEigenVector
Definition: MooseTypes.h:148
unsigned int _max_cached_residuals
Definition: Assembly.h:2803
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data_face
Definition: Assembly.h:2782
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhi(FEType type) const
Definition: Assembly.h:1733
bool _user_added_fe_lower_of_helper_type
Definition: Assembly.h:2365
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called...
Definition: Assembly.h:2646
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:2373
MooseArray< ADReal > _ad_coord
The AD version of the current coordinate transformation coefficients.
Definition: Assembly.h:2426
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:2404
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:2571
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:2471
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:2322
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kle
dlower/dsecondary (or dlower/delement)
Definition: Assembly.h:2691
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.C:3791
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:2765
Class for stuff related to variables.
Definition: Adaptivity.h:33
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:2720
MooseArray< Real > _current_JxW_neighbor
The current transformed jacobian weights on a neighbor&#39;s face.
Definition: Assembly.h:2569
std::shared_ptr< XFEMInterface > _xfem
The XFEM controller.
Definition: Assembly.h:2379
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:3227
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:2695
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition: Assembly.h:2424
const OutputTools< OutputType >::VariablePhiValue & fePhiLower(FEType type) const
Definition: Assembly.h:2909
VariablePhiDivergence _div_phi
Definition: Assembly.h:2751
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:2563
const Real & neighborLowerDElemVolume() const
Definition: Assembly.h:3213
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:1840
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:2239
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:2704
std::map< unsigned int, FEBase * > _holder_fe_neighbor_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2552
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:2581
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face_neighbor
Definition: Assembly.h:2768
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:2713
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:2626
std::vector< ADReal > _ad_detady_map
Definition: Assembly.h:2840
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:2275
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:2733
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:2844
std::vector< std::unique_ptr< FEBase > > _unique_fe_neighbor_helper
Definition: Assembly.h:2372
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kll
dlower/dlower
Definition: Assembly.h:2689
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:2363
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:2901
VariablePhiValue _phi
Definition: Assembly.h:2747
Real _current_neighbor_volume
Volume of the current neighbor.
Definition: Assembly.h:2620
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:2293
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:2384
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:2904
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:2693
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:2610
void addJacobianNonlocal(GlobalDataKey)
Adds non-local Jacobian to the global Jacobian matrices.
Definition: Assembly.C:3871
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:2661
const OutputTools< OutputType >::VariablePhiValue & feDualPhiLower(FEType type) const
Definition: Assembly.h:2917
MooseMesh & _mesh
Definition: Assembly.h:2352
const VariablePhiValue & phi() const
Definition: Assembly.h:1319
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_neighbor
Definition: Assembly.h:2767
std::map< unsigned int, FEBase * > _holder_fe_face_neighbor_helper
Definition: Assembly.h:2553
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:2528
void modifyWeightsDueToXFEM(const Elem *elem)
Update the integration weights for XFEM partial elements.
Definition: Assembly.C:4519
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:2700
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:2596
VectorVariablePhiCurl _vector_curl_phi_neighbor
Definition: Assembly.h:2735
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:2350
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:163
VectorVariablePhiGradient _vector_grad_phi
Definition: Assembly.h:2721
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:2370
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_nonlocal_used
Definition: Assembly.h:2342
std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > _cm_sf_entry
Entries in the coupling matrix for scalar variables vs field variables.
Definition: Assembly.h:2335
VectorVariablePhiValue _vector_phi_neighbor
Definition: Assembly.h:2732
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:2284
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:2549
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:2818
Real _current_elem_volume
Volume of the current element.
Definition: Assembly.h:2602
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:2388
const MooseArray< ADReal > & adCurvatures() const
Definition: Assembly.C:4799
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:2393
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:2369
const FEType _helper_type
The finite element type of the FE helper classes.
Definition: Assembly.h:2358
const Elem *const & msmElem() const
Definition: Assembly.h:1960
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:4441
const bool & _computing_residual_and_jacobian
Whether we are currently computing the residual and Jacobian.
Definition: Assembly.h:2328
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knn
jacobian contributions from the neighbor <Tag, ivar, jvar>
Definition: Assembly.h:2687
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:85
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:2522
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:2866
std::vector< std::vector< Real > > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition: Assembly.h:2806
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:2248
VariablePhiValue _phi
Definition: Assembly.h:2703
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:2331
void addJacobianNeighborLowerD(GlobalDataKey)
Add all portions of the Jacobian except PrimaryPrimary, e.g.
Definition: Assembly.C:3931
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:2391
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition: Assembly.h:1595
VariablePhiGradient _grad_phi
Definition: Assembly.h:2748
std::vector< VectorValue< ADReal > > _ad_dxyzdeta_map
Definition: Assembly.h:2828
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &)
Definition: Assembly.h:1477
void prepareScalar()
Definition: Assembly.C:2951
DenseVector< Real > getJacobianDiagonal(DenseMatrix< Number > &ke)
Definition: Assembly.h:1891
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:4539
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:2444
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:2666
unsigned int _mesh_dimension
Definition: Assembly.h:2354
std::vector< Eigen::Map< RealDIMValue > > _mapped_normals
Mapped normals.
Definition: Assembly.h:2532
VectorVariablePhiDivergence _vector_div_phi_face
Definition: Assembly.h:2730
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:4046
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:2874
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:3220
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:2430
unsigned int _max_cached_jacobians
Definition: Assembly.h:2812
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:2683
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_dual_lower
Definition: Assembly.h:2778
Nonlinear system to be solved.
VectorVariablePhiValue _vector_phi_face
Definition: Assembly.h:2726
std::vector< VectorValue< ADReal > > _ad_dxyzdzeta_map
Definition: Assembly.h:2829
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:2824
std::vector< std::pair< MooseVariableScalar *, MooseVariableScalar * > > _cm_ss_entry
Entries in the coupling matrix for scalar variables.
Definition: Assembly.h:2337
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kne
jacobian contributions from the neighbor and element <Tag, ivar, jvar>
Definition: Assembly.h:2685
const Elem * _current_neighbor_lower_d_elem
The current neighboring lower dimensional element.
Definition: Assembly.h:2633
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:2614
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:2364
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:2774
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:2663
VariablePhiCurl _curl_phi
Definition: Assembly.h:2750
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:37
QRules & qrules(unsigned int dim)
Definition: Assembly.h:2490
VectorVariablePhiGradient _vector_grad_phi_face_neighbor
Definition: Assembly.h:2739
std::unique_ptr< libMesh::QBase > vol
volume/elem (meshdim) quadrature rule
Definition: Assembly.h:2442
void prepareOffDiagScalar()
Definition: Assembly.C:2975
VectorVariablePhiSecond _second_phi
Definition: Assembly.h:2759
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:3843
std::vector< ADReal > _ad_dzetadx_map
Definition: Assembly.h:2842
void addJacobianLowerD(GlobalDataKey)
Add portions of the Jacobian of LowerLower, LowerSecondary, and SecondaryLower for boundary condition...
Definition: Assembly.C:4009
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:2302
VectorVariablePhiGradient _grad_phi
Definition: Assembly.h:2758
MooseArray< ADReal > _ad_curvatures
Definition: Assembly.h:2850
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:2416
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:4566
FEBase * _current_fe_face_helper
helper object for transforming coordinates
Definition: Assembly.h:2520
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > _cm_fs_entry
Entries in the coupling matrix for field variables vs scalar variables.
Definition: Assembly.h:2333
const std::vector< Real > * _JxW_msm
A JxW for working on mortar segement elements.
Definition: Assembly.h:2579
std::vector< ADReal > _ad_dzetady_map
Definition: Assembly.h:2843
dof_id_type numeric_index_type
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data
Definition: Assembly.h:2780
std::unordered_map< SubdomainID, std::vector< QRules > > _qrules
Holds quadrature rules for each dimension.
Definition: Assembly.h:2459
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:2760
std::map< FEType, FEBase * > _current_fe_neighbor
The "neighbor" fe object that matches the current elem.
Definition: Assembly.h:2386
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:4098
SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition: Assembly.h:2612
VectorVariablePhiValue _vector_phi_face_neighbor
Definition: Assembly.h:2738
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:2660
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:2838
const Real & lowerDElemVolume() const
Definition: Assembly.h:3206
VectorVariablePhiDivergence _vector_div_phi_neighbor
Definition: Assembly.h:2736
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:2495
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:2341
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:3178
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:93
libMesh::QBase * _current_qrule_lower
quadrature rule used on lower dimensional elements.
Definition: Assembly.h:2592
SubProblem & _subproblem
Definition: Assembly.h:2313
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:2839
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:2546
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:2857
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:4342
MooseArray< std::vector< Point > > _current_tangents
The current tangent vectors at the quadrature points.
Definition: Assembly.h:2534
bool _calculate_curvatures
Definition: Assembly.h:2859
VariablePhiGradient _grad_phi_face_neighbor
Definition: Assembly.h:2716
const std::vector< VectorTag > & _residual_vector_tags
The residual vector tags that Assembly could possibly contribute to.
Definition: Assembly.h:2795
std::map< FEType, FEVectorBase * > _current_vector_fe_face_neighbor
The "neighbor face" vector fe object that matches the current elem.
Definition: Assembly.h:2397
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:2539
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition: Assembly.h:2420
std::vector< VectorValue< ADReal > > _ad_dxyzdxi_map
AD quantities.
Definition: Assembly.h:2827
std::vector< std::pair< unsigned int, unsigned short > > _disp_numbers_and_directions
Container of displacement numbers and directions.
Definition: Assembly.h:2855
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:2821
std::set< FEType > _need_neighbor_div
Definition: Assembly.h:2870
OutputTools< Real >::VariablePhiCurl VariablePhiCurl
Definition: MooseTypes.h:351
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kee
Definition: Assembly.h:2679
std::vector< VectorValue< ADReal > > _ad_d2xyzdxi2_map
Definition: Assembly.h:2830
std::vector< ADReal > _ad_jac
Definition: Assembly.h:2833
std::set< FEType > _need_curl
Definition: Assembly.h:2867
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:4284
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_lower
Definition: Assembly.h:2777
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:2781
VariablePhiGradient _grad_phi_neighbor
Definition: Assembly.h:2712
ArbitraryQuadrature * _current_qface_arbitrary
The current arbitrary quadrature rule used on element faces.
Definition: Assembly.h:2524
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face
types of vector finite elements
Definition: Assembly.h:2516
VariablePhiValue _phi_face
Definition: Assembly.h:2707
VectorVariablePhiSecond _vector_second_phi
Definition: Assembly.h:2722
libMesh::QBase * _current_qrule_volume
The current volumetric quadrature for the element.
Definition: Assembly.h:2412
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:2883
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:2863
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_lower
Definition: Assembly.h:2769
const Elem * _current_lower_d_elem
The current lower dimensional element.
Definition: Assembly.h:2631
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:2865
bool computingResidualAndJacobian() const
Definition: Assembly.h:1955
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_lower
FE objects for lower dimensional elements.
Definition: Assembly.h:2556
const VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1453
std::set< FEType > _need_face_neighbor_div
Definition: Assembly.h:2871
FEGenericBase< Real > FEBase
libMesh::QBase * _qrule_msm
A qrule object for working on mortar segement elements.
Definition: Assembly.h:2586
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:3058
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiLower(FEType type) const
Definition: Assembly.h:2925
VariablePhiValue _phi_face_neighbor
Definition: Assembly.h:2715
libMesh::ElemSideBuilder _current_neighbor_side_elem_builder
In place side element builder for _current_neighbor_side_elem.
Definition: Assembly.h:2879
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:2637
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:2410
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension&#39;s actual fe objects indexed on type.
Definition: Assembly.h:2402
const VariablePhiSecond & secondPhi(const MooseVariableField< Real > &) const
Definition: Assembly.h:1329
VariablePhiValue _phi_neighbor
Definition: Assembly.h:2711
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:2608
std::set< FEType > _need_div
Definition: Assembly.h:2868
VectorVariablePhiCurl _vector_curl_phi
Definition: Assembly.h:2723
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:2798
const bool _displaced
Definition: Assembly.h:2315
void buildVectorFE(FEType type) const
Build Vector FEs with a type.
Definition: Assembly.C:453
VectorVariablePhiCurl _vector_curl_phi_face_neighbor
Definition: Assembly.h:2741
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:4426
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:2558
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:2622
bool _building_helpers
Whether we are currently building the FE classes for the helpers.
Definition: Assembly.h:2376
bool _calculate_face_xyz
Definition: Assembly.h:2858
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:2836
std::vector< ADReal > _ad_dxidy_map
Definition: Assembly.h:2837
std::vector< VectorValue< ADReal > > _ad_d2xyzdxideta_map
Definition: Assembly.h:2831
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face_neighbor
Definition: Assembly.h:2776
void addJacobian(GlobalDataKey)
Adds all local Jacobian to the global Jacobian matrices.
Definition: Assembly.C:3858
MooseArray< Point > _current_normals
The current Normal vectors at the quadrature points.
Definition: Assembly.h:2530
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:4845
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:2835
const VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &) const
Definition: Assembly.h:1350
VectorVariablePhiGradient _vector_grad_phi_face
Definition: Assembly.h:2727
MooseArray< VectorValue< ADReal > > _ad_q_points_face
Definition: Assembly.h:2848
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:2318
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:1907
void hasScalingVector()
signals this object that a vector containing variable scaling factors should be used when doing resid...
Definition: Assembly.C:4560
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:2446
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_dual_lower
Definition: Assembly.h:2770
void zeroCachedJacobian(GlobalDataKey)
Zero out previously-cached Jacobian rows.
Definition: Assembly.C:4498
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:1945
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:2766
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:2773
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:2574
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:2680
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:2635
LocalDataKey(const LocalDataKey &)
Definition: Assembly.h:868
bool _user_added_fe_face_of_helper_type
Definition: Assembly.h:2362
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:2448
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:2518
const Elem *const & sideElem() const
Returns the side element.
Definition: Assembly.h:458
const bool & _computing_jacobian
Whether we are currently computing the Jacobian.
Definition: Assembly.h:2325
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:2548
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:2266
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:4076
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:2371
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:4812
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_nonlocal_entry
Entries in the coupling matrix for field variables for nonlocal calculations.
Definition: Assembly.h:2339
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:4448
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:2898
VectorVariablePhiSecond _vector_second_phi_face_neighbor
Definition: Assembly.h:2740
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:2604
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:4478
VariablePhiSecond _second_phi
Definition: Assembly.h:2749
std::map< unsigned int, FEBase * > _holder_fe_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:2406
const libMesh::CouplingMatrix & _nonlocal_cm
Definition: Assembly.h:2319
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:2600
const OutputTools< OutputType >::VariablePhiGradient & feGradDualPhiLower(FEType type) const
Definition: Assembly.h:2933
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:2616
DenseMatrix< Number > _element_matrix
A working matrix to avoid repeated heap allocations when caching Jacobians that must have libMesh-lev...
Definition: Assembly.h:2893
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:2537
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:4216
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:2628
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data_face
Definition: Assembly.h:2784
std::vector< dof_id_type > _column_indices
Definition: Assembly.h:2898
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:2257
std::unique_ptr< ArbitraryQuadrature > arbitrary_face
area/face (meshdim-1) custom points quadrature rule
Definition: Assembly.h:2450
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:2547
void addJacobianNeighbor(GlobalDataKey)
Add ElementNeighbor, NeighborElement, and NeighborNeighbor portions of the Jacobian for compute objec...
Definition: Assembly.C:3893
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:2346
VectorVariablePhiDivergence _div_phi
Definition: Assembly.h:2761
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:2588
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:1950
Real _current_neighbor_lower_d_elem_volume
The current neighboring lower dimensional element volume.
Definition: Assembly.h:2641
bool _need_neighbor_lower_d_elem_volume
Whether we need to compute the neighboring lower dimensional element volume.
Definition: Assembly.h:2639
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition: Assembly.h:2418
bool _user_added_fe_of_helper_type
Whether user code requested a FEType the same as our _helper_type.
Definition: Assembly.h:2361
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:2422
void cacheJacobianMortar(GlobalDataKey)
Cache all portions of the Jacobian, e.g.
Definition: Assembly.C:4136
std::unique_ptr< ArbitraryQuadrature > neighbor
area/face (meshdim-1) custom points quadrature rule for DG
Definition: Assembly.h:2452
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:2734
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:1865
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:2705
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:2344
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:2560
static constexpr subdomain_id_type invalid_subdomain_id
const libMesh::DofMap & _dof_map
DOF map.
Definition: Assembly.h:2348
VectorVariablePhiDivergence _vector_div_phi
Definition: Assembly.h:2724
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:2775
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:2810
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
Definition: Assembly.C:3801
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition: Assembly.h:2526
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:1919
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition: Assembly.h:2606
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:2815
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:2408
bool _need_JxW_neighbor
Flag to indicate that JxW_neighbor is needed.
Definition: Assembly.h:2567
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:4060
VectorVariablePhiSecond _vector_second_phi_face
Definition: Assembly.h:2728
const MooseArray< ADPoint > & adNormals() const
Definition: Assembly.h:393
VariablePhiGradient _grad_phi_face
Definition: Assembly.h:2708
MooseArray< Point > _current_q_points_face_neighbor
The current quadrature points on the neighbor face.
Definition: Assembly.h:2565
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:2877
const VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition: Assembly.h:1397
VectorVariablePhiCurl _vector_curl_phi_face
Definition: Assembly.h:2729
bool _need_dual
Whether dual shape functions need to be computed for mortar constraints.
Definition: Assembly.h:2643
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:2888
std::set< FEType > _need_face_div
Definition: Assembly.h:2869
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:2598
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:2541
Base variable class.
std::map< FEType, FEVectorBase * > _current_vector_fe_neighbor
The "neighbor" vector fe object that matches the current elem.
Definition: Assembly.h:2395
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:2624
std::vector< VectorValue< ADReal > > _ad_d2xyzdeta2_map
Definition: Assembly.h:2832
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:3098
void clearCachedJacobian()
Clear any currently cached jacobians.
Definition: Assembly.C:4508
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:2742
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:2697
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:2834
MooseArray< ADReal > _ad_JxW_face
Definition: Assembly.h:2846
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