https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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#include <algorithm>
29
30// libMesh forward declarations
31namespace libMesh
32{
33class DofMap;
34class CouplingMatrix;
35class Elem;
36template <typename>
37class VectorValue;
39template <typename T>
40class FEGenericBase;
43class Node;
44template <typename T>
45class NumericVector;
46template <typename T>
47class SparseMatrix;
49}
50
51// MOOSE Forward Declares
52class FaceInfo;
53class MooseMesh;
55class SystemBase;
58template <typename>
59class MooseVariableFE;
64class XFEMInterface;
65class SubProblem;
67
68#ifdef MOOSE_KOKKOS_ENABLED
70{
71class Assembly;
72}
73#endif
74
83template <typename P, typename C>
84void coordTransformFactor(const SubProblem & s,
85 SubdomainID sub_id,
86 const P & point,
87 C & factor,
88 SubdomainID neighbor_sub_id = libMesh::Elem::invalid_subdomain_id);
89
90template <typename P, typename C>
92 SubdomainID sub_id,
93 const P & point,
94 C & factor,
95 SubdomainID neighbor_sub_id = libMesh::Elem::invalid_subdomain_id);
96
102{
103public:
104 Assembly(SystemBase & sys, THREAD_ID tid);
105 virtual ~Assembly();
106
111 template <typename T>
112 static const T * const & constify_ref(T * const & inref)
113 {
114 const T * const * ptr = &inref;
115 return *ptr;
116 }
117
124 const FEBase * const & getFE(FEType type, unsigned int dim) const
125 {
126 buildFE(type);
127 return constify_ref(_fe[dim][type]);
128 }
129
136 const FEBase * const & getFENeighbor(FEType type, unsigned int dim) const
137 {
138 buildNeighborFE(type);
139 return constify_ref(_fe_neighbor[dim][type]);
140 }
141
148 const FEBase * const & getFEFace(FEType type, unsigned int dim) const
149 {
150 buildFaceFE(type);
151 return constify_ref(_fe_face[dim][type]);
152 }
153
160 const FEBase * const & getFEFaceNeighbor(FEType type, unsigned int dim) const
161 {
163 return constify_ref(_fe_face_neighbor[dim][type]);
164 }
165
172 const FEVectorBase * const & getVectorFE(FEType type, unsigned int dim) const
173 {
174 buildVectorFE(type);
175 return constify_ref(_vector_fe[dim][type]);
176 }
177
184 const FEVectorBase * const & getVectorFENeighbor(FEType type, unsigned int dim) const
185 {
187 return constify_ref(_vector_fe_neighbor[dim][type]);
188 }
189
196 const FEVectorBase * const & getVectorFEFace(FEType type, unsigned int dim) const
197 {
198 buildVectorFaceFE(type);
199 return constify_ref(_vector_fe_face[dim][type]);
200 }
201
208 const FEVectorBase * const & getVectorFEFaceNeighbor(FEType type, unsigned int dim) const
209 {
212 }
213
214#ifdef MOOSE_KOKKOS_ENABLED
221#endif
222
227 const libMesh::QBase * const & qRule() const { return constify_ref(_current_qrule); }
228
234
235#ifdef MOOSE_KOKKOS_ENABLED
241 {
242 return qrules(dim, block).vol.get();
243 }
244#endif
245
250 const MooseArray<Point> & qPoints() const { return _current_q_points; }
251
256 const std::vector<Point> & qPointsMortar() const { return _fe_msm->get_xyz(); }
257
263
268 const MooseArray<Real> & JxW() const { return _current_JxW; }
269
270 const MooseArray<ADReal> & adJxW() const
271 {
272 _need_ad_volume_map = true;
273 return _ad_JxW;
274 }
275
277 {
278 _need_ad_face_map = true;
279 return _ad_JxW_face;
280 }
281
282 const MooseArray<ADReal> & adCurvatures() const;
283
288 const MooseArray<Real> & coordTransformation() const { return _coord; }
289
295
301
307
312 const libMesh::QBase * const & qRuleFace() const { return constify_ref(_current_qrule_face); }
313
319
320#ifdef MOOSE_KOKKOS_ENABLED
326 {
327 return qrules(dim, block).face.get();
328 }
329#endif
330
336
341 const MooseArray<Real> & JxWFace() const { return _current_JxW_face; }
342
347 const MooseArray<Point> & normals() const { return _current_normals; }
348
349 /***
350 * Returns the array of normals for quadrature points on a current side
351 */
352 const std::vector<Eigen::Map<RealDIMValue>> & mappedNormals() const { return _mapped_normals; }
353
359
363 unsigned int numExtraElemIntegers() const { return _extra_elem_ids.size() - 1; }
364
368 const dof_id_type & extraElemID(unsigned int id) const
369 {
370 mooseAssert(id < _extra_elem_ids.size(), "An invalid extra element integer id");
371 return _extra_elem_ids[id];
372 }
373
377 const dof_id_type & extraElemIDNeighbor(unsigned int id) const
378 {
379 mooseAssert(id < _neighbor_extra_elem_ids.size(), "An invalid extra element integer id");
380 return _neighbor_extra_elem_ids[id];
381 }
382
384 {
385 _need_ad_face_map = true;
386 return _ad_normals;
387 }
388
390 {
391 _calculate_xyz = true;
392 _need_ad_volume_map = true;
393 return _ad_q_points;
394 }
395
397 {
398 _calculate_face_xyz = true;
399 _need_ad_face_map = true;
400 return _ad_q_points_face;
401 }
402
403 template <bool is_ad>
405
410 const Elem * const & elem() const { return _current_elem; }
411
416
421
426
431
436 const Real & elemVolume() const { return _current_elem_volume; }
437
442 const unsigned int & side() const { return _current_side; }
443
448 const unsigned int & neighborSide() const { return _current_neighbor_side; }
449
454 const Elem * const & sideElem() const { return _current_side_elem; }
455
460 const Real & sideElemVolume() const { return _current_side_volume; }
461
466 const Elem * const & neighbor() const { return _current_neighbor_elem; }
467
472 const Elem * const & lowerDElem() const { return _current_lower_d_elem; }
473
478 const Elem * const & neighborLowerDElem() const { return _current_neighbor_lower_d_elem; }
479
480 /*
481 * @return The current lower-dimensional element volume
482 */
483 const Real & lowerDElemVolume() const;
484
485 /*
486 * @return The current neighbor lower-dimensional element volume
487 */
488 const Real & neighborLowerDElemVolume() const;
489
494
499
504 const Real & neighborVolume()
505 {
508 }
509
514 const libMesh::QBase * const & qRuleNeighbor() const
515 {
517 }
518
524
529 const MooseArray<Real> & JxWNeighbor() const;
530
536
541 const Node * const & node() const { return _current_node; }
542
547 const Node * const & nodeNeighbor() const { return _current_neighbor_node; }
548
557 void createQRules(QuadratureType type,
558 Order order,
559 Order volume_order,
560 Order face_order,
561 SubdomainID block,
562 bool allow_negative_qweights = true);
563
570 void bumpVolumeQRuleOrder(Order volume_order, SubdomainID block);
571
579 void bumpAllQRuleOrder(Order order, SubdomainID block);
580
589 void setVolumeQRule(libMesh::QBase * qrule, unsigned int dim);
590
599 void setFaceQRule(libMesh::QBase * qrule, unsigned int dim);
600
608 void setMortarQRule(Order order);
609
613 void activateDual() { _need_dual = true; }
614
619 bool needDual() const { return _need_dual; }
620
624 void clearCachedQRules();
625
626private:
633 void setLowerQRule(libMesh::QBase * qrule, unsigned int dim);
634
635public:
644 void setNeighborQRule(libMesh::QBase * qrule, unsigned int dim);
645
651 void reinit(const Elem * elem);
652
656 void setVolumeQRule(const Elem * elem);
657
662 void reinitElemFaceRef(const Elem * elem,
663 unsigned int elem_side,
664 Real tolerance,
665 const std::vector<Point> * const pts = nullptr,
666 const std::vector<Real> * const weights = nullptr);
667
672 void reinitNeighborFaceRef(const Elem * neighbor_elem,
673 unsigned int neighbor_side,
674 Real tolerance,
675 const std::vector<Point> * const pts,
676 const std::vector<Real> * const weights = nullptr);
677
681 void reinitDual(const Elem * elem, const std::vector<Point> & pts, const std::vector<Real> & JxW);
682
686 void reinitLowerDElem(const Elem * elem,
687 const std::vector<Point> * const pts = nullptr,
688 const std::vector<Real> * const weights = nullptr);
689
693 void reinitNeighborLowerDElem(const Elem * elem);
694
698 void reinitMortarElem(const Elem * elem);
699
703 const std::vector<Real> & jxWMortar() const { return *_JxW_msm; }
704
708 const libMesh::QBase * const & qRuleMortar() const { return constify_ref(_qrule_msm); }
709
710private:
714 void computeADFace(const Elem & elem, const unsigned int side);
715
716public:
720 void reinitAtPhysical(const Elem * elem, const std::vector<Point> & physical_points);
721
725 void reinit(const Elem * elem, const std::vector<Point> & reference_points);
726
730 void setFaceQRule(const Elem * const elem, const unsigned int side);
731
735 void reinit(const Elem * elem, unsigned int side);
736
740 void reinit(const Elem * elem, unsigned int side, const std::vector<Point> & reference_points);
741
742 void reinitFVFace(const FaceInfo & fi);
743
755 void reinitElemAndNeighbor(const Elem * elem,
756 unsigned int side,
757 const Elem * neighbor,
758 unsigned int neighbor_side,
759 const std::vector<Point> * neighbor_reference_points = nullptr);
760
764 void reinitNeighborAtPhysical(const Elem * neighbor,
765 unsigned int neighbor_side,
766 const std::vector<Point> & physical_points);
767
771 void reinitNeighborAtPhysical(const Elem * neighbor, const std::vector<Point> & physical_points);
772
776 void reinitNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
777
781 void reinit(const Node * node);
782
787
790
793
795 void prepareResidual();
796
797 void prepare();
798 void prepareNonlocal();
799
807 void prepareNeighbor();
808
813 void prepareLowerD();
814
815 void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector<dof_id_type> & dof_indices);
816 void prepareBlockNonlocal(unsigned int ivar,
817 unsigned jvar,
818 const std::vector<dof_id_type> & idof_indices,
819 const std::vector<dof_id_type> & jdof_indices);
820 void prepareScalar();
822
823 template <typename T>
825 void copyShapes(unsigned int var);
826
827 template <typename T>
829 void copyFaceShapes(unsigned int var);
830
831 template <typename T>
833 void copyNeighborShapes(unsigned int var);
834
841 {
842 // Blessed classes
843 friend class Assembly;
844 friend class SubProblem;
845 friend class FEProblemBase;
846 friend class DisplacedProblem;
851 };
852
859 {
860 // Blessed classes
861 friend class Assembly;
862 friend class TaggingInterface;
865 };
866
871 void addResidual(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
876 void addResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
881 void addResidualLower(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
882
887 void addResidualScalar(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
888
893 void cacheResidual(GlobalDataKey, const std::vector<VectorTag> & tags);
894
899 void cacheResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & tags);
900
904 void cacheResidualLower(GlobalDataKey, const std::vector<VectorTag> & tags);
905
911 void addCachedResiduals(GlobalDataKey, const std::vector<VectorTag> & tags);
912
921 void clearCachedResiduals(GlobalDataKey);
922
930 void addCachedResidualDirectly(NumericVector<Number> & residual,
931 GlobalDataKey,
932 const VectorTag & vector_tag);
933
937 void setResidual(NumericVector<Number> & residual, GlobalDataKey, const VectorTag & vector_tag);
938
942 void setResidualNeighbor(NumericVector<Number> & residual,
943 GlobalDataKey,
944 const VectorTag & vector_tag);
945
949 void addJacobian(GlobalDataKey);
950
954 void addJacobianNonlocal(GlobalDataKey);
955
960 void addJacobianNeighbor(GlobalDataKey);
961
965 void addJacobianScalar(GlobalDataKey);
966
971 void addJacobianOffDiagScalar(unsigned int ivar, GlobalDataKey);
972
977 unsigned int ivar,
978 unsigned int jvar,
979 const libMesh::DofMap & dof_map,
980 std::vector<dof_id_type> & dof_indices,
982 TagID tag);
983
989 unsigned int ivar,
990 unsigned int jvar,
991 const libMesh::DofMap & dof_map,
992 std::vector<dof_id_type> & dof_indices,
994 const std::set<TagID> & tags);
995
1000 unsigned int ivar,
1001 unsigned int jvar,
1002 const libMesh::DofMap & dof_map,
1003 const std::vector<dof_id_type> & idof_indices,
1004 const std::vector<dof_id_type> & jdof_indices,
1006 TagID tag);
1007
1012 unsigned int ivar,
1013 unsigned int jvar,
1014 const libMesh::DofMap & dof_map,
1015 const std::vector<dof_id_type> & idof_indices,
1016 const std::vector<dof_id_type> & jdof_indices,
1018 const std::set<TagID> & tags);
1019
1029
1036
1046
1052 unsigned int ivar,
1053 unsigned int jvar,
1054 const libMesh::DofMap & dof_map,
1055 std::vector<dof_id_type> & dof_indices,
1056 std::vector<dof_id_type> & neighbor_dof_indices,
1058 TagID tag);
1059
1065 unsigned int ivar,
1066 unsigned int jvar,
1067 const libMesh::DofMap & dof_map,
1068 std::vector<dof_id_type> & dof_indices,
1069 std::vector<dof_id_type> & neighbor_dof_indices,
1071 const std::set<TagID> & tags);
1072
1077
1082
1088
1096
1101
1106
1111 DenseVector<Number> & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
1112 {
1113 return _sub_Re[tag_id][var_num];
1114 }
1115
1120 DenseVector<Number> & residualBlockNeighbor(unsigned int var_num, LocalDataKey, TagID tag_id)
1121 {
1122 return _sub_Rn[tag_id][var_num];
1123 }
1124
1129 DenseVector<Number> & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
1130 {
1131 return _sub_Rl[tag_id][var_num];
1132 }
1133
1138 DenseMatrix<Number> & jacobianBlock(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1139 {
1140 jacobianBlockUsed(tag, ivar, jvar, true);
1141 return _sub_Kee[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1142 }
1143
1148 DenseMatrix<Number> &
1149 jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1150 {
1151 jacobianBlockNonlocalUsed(tag, ivar, jvar, true);
1152 return _sub_Keg[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1153 }
1154
1159 DenseMatrix<Number> & jacobianBlockNeighbor(
1160 Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag);
1161
1169 DenseMatrix<Number> & jacobianBlockMortar(Moose::ConstraintJacobianType type,
1170 unsigned int ivar,
1171 unsigned int jvar,
1172 LocalDataKey,
1173 TagID tag);
1174
1179 void cacheResidualNodes(const DenseVector<Number> & res,
1180 const std::vector<dof_id_type> & dof_index,
1181 LocalDataKey,
1182 TagID tag);
1183
1195 void
1196 cacheJacobian(numeric_index_type i, numeric_index_type j, Real value, LocalDataKey, TagID tag);
1197
1209 void cacheJacobian(numeric_index_type i,
1210 numeric_index_type j,
1211 Real value,
1212 LocalDataKey,
1213 const std::set<TagID> & tags);
1214
1222 void cacheJacobianBlock(const DenseMatrix<Number> & jac_block,
1223 const std::vector<dof_id_type> & idof_indices,
1224 const std::vector<dof_id_type> & jdof_indices,
1225 Real scaling_factor,
1226 LocalDataKey,
1227 const std::set<TagID> & tags);
1228
1238 template <typename Residuals, typename Indices>
1239 void cacheResiduals(const Residuals & residuals,
1240 const Indices & row_indices,
1241 Real scaling_factor,
1242 LocalDataKey,
1243 const std::set<TagID> & vector_tags);
1244
1252 template <typename Residuals, typename Indices>
1253 void cacheJacobian(const Residuals & residuals,
1254 const Indices & row_indices,
1255 Real scaling_factor,
1256 LocalDataKey,
1257 const std::set<TagID> & matrix_tags);
1258
1269 template <typename Residuals, typename Indices>
1270 void cacheResidualsWithoutConstraints(const Residuals & residuals,
1271 const Indices & row_indices,
1272 Real scaling_factor,
1273 LocalDataKey,
1274 const std::set<TagID> & vector_tags);
1275
1283 template <typename Residuals, typename Indices>
1284 void cacheJacobianWithoutConstraints(const Residuals & residuals,
1285 const Indices & row_indices,
1286 Real scaling_factor,
1287 LocalDataKey,
1288 const std::set<TagID> & matrix_tags);
1289
1290 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> & couplingEntries()
1291 {
1292 return _cm_ff_entry;
1293 }
1294 const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1296 {
1297 return _cm_ff_entry;
1298 }
1299 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1301 {
1302 return _cm_nonlocal_entry;
1303 }
1304 const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> &
1306 {
1307 return _cm_fs_entry;
1308 }
1309 const std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> &
1311 {
1312 return _cm_sf_entry;
1313 }
1314
1315 // Read-only references
1316 const VariablePhiValue & phi() const { return _phi; }
1317 template <typename T>
1319 {
1320 _need_ad_grad_phi = true;
1321 return _ad_grad_phi_data.at(v.feType());
1322 }
1323 const VariablePhiValue & phi(const MooseVariableField<Real> &) const { return _phi; }
1324 const VariablePhiGradient & gradPhi() const { return _grad_phi; }
1326 const VariablePhiSecond & secondPhi() const { return _second_phi; }
1328 {
1329 return _second_phi;
1330 }
1331
1332 const VariablePhiValue & phiFace() const { return _phi_face; }
1336 {
1337 return _grad_phi_face;
1338 }
1340 {
1341 return _second_phi_face;
1342 }
1343
1345 {
1346 return _phi_neighbor;
1347 }
1349 {
1350 return _grad_phi_neighbor;
1351 }
1356
1358 {
1359 return _phi_face_neighbor;
1360 }
1369
1371 {
1372 return _vector_phi;
1373 }
1390
1411
1435
1450 const VectorVariablePhiCurl &
1460
1461 // Writeable references
1465
1469
1479
1492
1493 // Writeable references with vector variable
1511
1532
1573
1574 // Writeable references with array variable
1578
1588
1601
1614
1615 template <typename OutputType>
1616 const typename OutputTools<OutputType>::VariablePhiValue & fePhi(FEType type) const
1617 {
1618 buildFE(type);
1619 return _fe_shape_data[type]->_phi;
1620 }
1621
1622 template <typename OutputType>
1624 {
1625 buildFE(type);
1626 return _fe_shape_data[type]->_grad_phi;
1627 }
1628
1629 template <typename OutputType>
1631 {
1632 return _ad_grad_phi_data[type];
1633 }
1634
1635 template <typename OutputType>
1637 {
1638 _need_second_derivative.insert(type);
1639 buildFE(type);
1640 return _fe_shape_data[type]->_second_phi;
1641 }
1642
1643 template <typename OutputType>
1644 const typename OutputTools<OutputType>::VariablePhiValue & fePhiLower(FEType type) const;
1645
1646 template <typename OutputType>
1647 const typename OutputTools<OutputType>::VariablePhiValue & feDualPhiLower(FEType type) const;
1648
1649 template <typename OutputType>
1650 const typename OutputTools<OutputType>::VariablePhiGradient & feGradPhiLower(FEType type) const;
1651
1652 template <typename OutputType>
1654 feGradDualPhiLower(FEType type) const;
1655
1656 template <typename OutputType>
1657 const typename OutputTools<OutputType>::VariablePhiValue & fePhiFace(FEType type) const
1658 {
1659 buildFaceFE(type);
1660 return _fe_shape_data_face[type]->_phi;
1661 }
1662
1663 template <typename OutputType>
1665 {
1666 buildFaceFE(type);
1667 return _fe_shape_data_face[type]->_grad_phi;
1668 }
1669
1670 template <typename OutputType>
1672 {
1673 return _ad_grad_phi_data_face[type];
1674 }
1675
1681
1686 void needADGradPhi() const { _need_ad_grad_phi = true; }
1687
1688 template <typename OutputType>
1690 {
1691 _need_second_derivative.insert(type);
1692 buildFaceFE(type);
1693 return _fe_shape_data_face[type]->_second_phi;
1694 }
1695
1696 template <typename OutputType>
1698 {
1699 buildNeighborFE(type);
1700 return _fe_shape_data_neighbor[type]->_phi;
1701 }
1702
1703 template <typename OutputType>
1705 {
1706 buildNeighborFE(type);
1707 return _fe_shape_data_neighbor[type]->_grad_phi;
1708 }
1709
1710 template <typename OutputType>
1712 {
1714 buildNeighborFE(type);
1715 return _fe_shape_data_neighbor[type]->_second_phi;
1716 }
1717
1718 template <typename OutputType>
1720 {
1721 buildFaceNeighborFE(type);
1722 return _fe_shape_data_face_neighbor[type]->_phi;
1723 }
1724
1725 template <typename OutputType>
1727 feGradPhiFaceNeighbor(FEType type) const
1728 {
1729 buildFaceNeighborFE(type);
1730 return _fe_shape_data_face_neighbor[type]->_grad_phi;
1731 }
1732
1733 template <typename OutputType>
1735 feSecondPhiFaceNeighbor(FEType type) const
1736 {
1738 buildFaceNeighborFE(type);
1739 return _fe_shape_data_face_neighbor[type]->_second_phi;
1740 }
1741
1742 template <typename OutputType>
1743 const typename OutputTools<OutputType>::VariablePhiCurl & feCurlPhi(FEType type) const
1744 {
1745 _need_curl.insert(type);
1746 buildFE(type);
1747 return _fe_shape_data[type]->_curl_phi;
1748 }
1749
1750 template <typename OutputType>
1752 {
1753 _need_curl.insert(type);
1754 buildFaceFE(type);
1755 return _fe_shape_data_face[type]->_curl_phi;
1756 }
1757
1758 template <typename OutputType>
1760 {
1761 _need_curl.insert(type);
1762 buildNeighborFE(type);
1763 return _fe_shape_data_neighbor[type]->_curl_phi;
1764 }
1765
1766 template <typename OutputType>
1768 {
1769 _need_curl.insert(type);
1770 buildFaceNeighborFE(type);
1771 return _fe_shape_data_face_neighbor[type]->_curl_phi;
1772 }
1773
1774 template <typename OutputType>
1776 {
1777 buildFE(type);
1778 return _fe_shape_data[type]->_div_phi;
1779 }
1780
1781 template <typename OutputType>
1783 {
1784 buildFaceFE(type);
1785 return _fe_shape_data_face[type]->_div_phi;
1786 }
1787
1788 template <typename OutputType>
1790 feDivPhiNeighbor(FEType type) const
1791 {
1792 buildNeighborFE(type);
1793 return _fe_shape_data_neighbor[type]->_div_phi;
1794 }
1795
1796 template <typename OutputType>
1798 feDivPhiFaceNeighbor(FEType type) const
1799 {
1800 buildFaceNeighborFE(type);
1801 return _fe_shape_data_face_neighbor[type]->_div_phi;
1802 }
1803
1805 Real elementVolume(const Elem * elem) const;
1806
1810 void setXFEM(std::shared_ptr<XFEMInterface> xfem) { _xfem = xfem; }
1811
1816 std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions);
1817
1826 void saveLocalArrayResidual(DenseVector<Number> & re,
1827 unsigned int i,
1828 unsigned int ntest,
1829 const RealEigenVector & v) const
1830 {
1831 for (unsigned int j = 0; j < v.size(); ++j, i += ntest)
1832 re(i) += v(j);
1833 }
1834
1835 void saveLocalADArray(std::vector<ADReal> & re,
1836 unsigned int i,
1837 unsigned int ntest,
1838 const ADRealEigenVector & v) const;
1839
1850 void saveDiagLocalArrayJacobian(DenseMatrix<Number> & ke,
1851 unsigned int i,
1852 unsigned int ntest,
1853 unsigned int j,
1854 unsigned int nphi,
1855 unsigned int ivar,
1856 const RealEigenVector & v) const
1857 {
1858 unsigned int pace = (_component_block_diagonal[ivar] ? 0 : nphi);
1859 for (unsigned int k = 0; k < v.size(); ++k, i += ntest, j += pace)
1860 ke(i, j) += v(k);
1861 }
1862
1875 void saveFullLocalArrayJacobian(DenseMatrix<Number> & ke,
1876 unsigned int i,
1877 unsigned int ntest,
1878 unsigned int j,
1879 unsigned int nphi,
1880 unsigned int ivar,
1881 unsigned int jvar,
1882 const RealEigenMatrix & v) const
1883 {
1884 if (ivar == jvar && _component_block_diagonal[ivar])
1885 {
1886 for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1887 ke(i, j) += v(k, k);
1888 }
1889 else
1890 {
1891 const unsigned int saved_j = j;
1892 for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1893 {
1894 j = saved_j;
1895 for (unsigned int l = 0; l < v.cols(); ++l, j += nphi)
1896 ke(i, j) += v(k, l);
1897 }
1898 }
1899 }
1900
1901 DenseVector<Real> getJacobianDiagonal(const DenseMatrix<Number> & ke)
1902 {
1903 unsigned int rows = ke.m();
1904 unsigned int cols = ke.n();
1905 DenseVector<Real> diag(rows);
1906 for (unsigned int i = 0; i < rows; i++)
1907 // % operation is needed to account for cases of no component coupling of array variables
1908 diag(i) = ke(i, i % cols);
1909 return diag;
1910 }
1911
1917 inline const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase & fe)
1918 {
1919 auto qrule = qrules(dim).vol.get();
1920 fe.attach_quadrature_rule(qrule);
1921 return qrule;
1922 }
1923
1929 inline const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase & fe)
1930 {
1931 auto qrule = qrules(dim).face.get();
1932 fe.attach_quadrature_rule(qrule);
1933 return qrule;
1934 }
1935
1944 void modifyArbitraryWeights(const std::vector<Real> & weights);
1945
1950
1955
1960
1964 const Elem * const & msmElem() const { return _msm_elem; }
1965
1970 void preparePRefinement();
1971
1975 void setCurrentLowerDElem(const Elem * const lower_d_elem);
1976
1977private:
1983 void reinitFE(const Elem * elem);
1984
1991 void reinitFEFace(const Elem * elem, unsigned int side);
1992
1993 void computeFaceMap(const Elem & elem, const unsigned int side, const std::vector<Real> & qw);
1994
1995 void reinitFEFaceNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1996
1997 void reinitFENeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1998
1999 template <typename Points, typename Coords>
2001 const Points & q_points,
2002 Coords & coord,
2003 SubdomainID sub_id);
2004
2006
2008
2010
2016 void modifyWeightsDueToXFEM(const Elem * elem);
2017
2024 void modifyFaceWeightsDueToXFEM(const Elem * elem, unsigned int side = 0);
2025
2030 template <typename OutputType>
2031 void computeGradPhiAD(const Elem * elem,
2032 unsigned int n_qp,
2035
2039 void resizeADMappingObjects(unsigned int n_qp, unsigned int dim);
2040
2045 void
2046 computeSinglePointMapAD(const Elem * elem, const std::vector<Real> & qw, unsigned p, FEBase * fe);
2047
2051 void addResidual(const VectorTag & vector_tag);
2055 void addResidualNeighbor(const VectorTag & vector_tag);
2060 void addResidualLower(const VectorTag & vector_tag);
2064 void addResidualScalar(const VectorTag & vector_tag);
2065
2069 void clearCachedResiduals(const VectorTag & vector_tag);
2070
2079 void cacheResidual(dof_id_type dof, Real value, TagID tag_id);
2080
2089 void cacheResidual(dof_id_type dof, Real value, const std::set<TagID> & tags);
2090
2095 void processLocalResidual(DenseVector<Number> & res_block,
2096 std::vector<dof_id_type> & dof_indices,
2097 const std::vector<Real> & scaling_factor);
2098
2102 void addResidualBlock(NumericVector<Number> & residual,
2103 DenseVector<Number> & res_block,
2104 const std::vector<dof_id_type> & dof_indices,
2105 const std::vector<Real> & scaling_factor);
2106
2110 void cacheResidualBlock(std::vector<Real> & cached_residual_values,
2111 std::vector<dof_id_type> & cached_residual_rows,
2112 DenseVector<Number> & res_block,
2113 const std::vector<dof_id_type> & dof_indices,
2114 const std::vector<Real> & scaling_factor);
2115
2119 void setResidualBlock(NumericVector<Number> & residual,
2120 DenseVector<Number> & res_block,
2121 const std::vector<dof_id_type> & dof_indices,
2122 const std::vector<Real> & scaling_factor);
2123
2128 DenseMatrix<Number> & jac_block,
2129 const MooseVariableBase & ivar,
2130 const MooseVariableBase & jvar,
2131 const std::vector<dof_id_type> & idof_indices,
2132 const std::vector<dof_id_type> & jdof_indices);
2133
2137 void cacheJacobianBlock(const DenseMatrix<Number> & jac_block,
2138 const MooseVariableBase & ivar,
2139 const MooseVariableBase & jvar,
2140 const std::vector<dof_id_type> & idof_indices,
2141 const std::vector<dof_id_type> & jdof_indices,
2142 TagID tag);
2143
2147 void cacheJacobianBlockNonzero(const DenseMatrix<Number> & jac_block,
2148 const MooseVariableBase & ivar,
2149 const MooseVariableBase & jvar,
2150 const std::vector<dof_id_type> & idof_indices,
2151 const std::vector<dof_id_type> & jdof_indices,
2152 TagID tag);
2153
2157 void addJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2158
2162 void cacheJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2163
2169 void clearCachedJacobian();
2170
2175 void buildFE(FEType type) const;
2176
2181 void buildFaceFE(FEType type) const;
2182
2187 void buildNeighborFE(FEType type) const;
2188
2193 void buildFaceNeighborFE(FEType type) const;
2194
2199 void buildLowerDFE(FEType type) const;
2200
2201 void buildLowerDDualFE(FEType type) const;
2202
2207 void buildVectorFE(FEType type) const;
2208
2213 void buildVectorFaceFE(FEType type) const;
2214
2219 void buildVectorNeighborFE(FEType type) const;
2220
2225 void buildVectorFaceNeighborFE(FEType type) const;
2226
2231 void buildVectorLowerDFE(FEType type) const;
2232 void buildVectorDualLowerDFE(FEType type) const;
2233
2238 void jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2239 {
2240 _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2241 }
2242
2247 char jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2248 {
2249 return _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2250 }
2251
2256 void jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2257 {
2258 _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2259 }
2260
2265 char jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2266 {
2267 return _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2268 }
2269
2274 void jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2275 {
2276 _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2277 }
2278
2283 char jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2284 {
2285 return _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2286 }
2287
2292 void jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2293 {
2294 _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2295 }
2296
2301 char jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2302 {
2303 return _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2304 }
2305
2309 void helpersRequestData();
2310
2313
2314 const bool _displaced;
2315
2319
2322
2325
2328
2330 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_ff_entry;
2332 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> _cm_fs_entry;
2334 std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> _cm_sf_entry;
2336 std::vector<std::pair<MooseVariableScalar *, MooseVariableScalar *>> _cm_ss_entry;
2338 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_nonlocal_entry;
2340 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_used;
2341 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_nonlocal_used;
2343 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_neighbor_used;
2345 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_lower_used;
2350
2352
2353 unsigned int _mesh_dimension;
2354
2357 const FEType _helper_type;
2358
2365
2368 std::vector<std::unique_ptr<FEBase>> _unique_fe_helper;
2369 std::vector<std::unique_ptr<FEBase>> _unique_fe_face_helper;
2370 std::vector<std::unique_ptr<FEBase>> _unique_fe_face_neighbor_helper;
2371 std::vector<std::unique_ptr<FEBase>> _unique_fe_neighbor_helper;
2372 std::vector<std::unique_ptr<FEBase>> _unique_fe_lower_helper;
2373
2376
2378 std::shared_ptr<XFEMInterface> _xfem;
2379
2381 std::map<FEType, FEBase *> _current_fe;
2383 std::map<FEType, FEBase *> _current_fe_face;
2385 std::map<FEType, FEBase *> _current_fe_neighbor;
2387 std::map<FEType, FEBase *> _current_fe_face_neighbor;
2388
2390 std::map<FEType, FEVectorBase *> _current_vector_fe;
2392 std::map<FEType, FEVectorBase *> _current_vector_fe_face;
2394 std::map<FEType, FEVectorBase *> _current_vector_fe_neighbor;
2396 std::map<FEType, FEVectorBase *> _current_vector_fe_face_neighbor;
2397
2398 /**** Volume Stuff ****/
2399
2401 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe;
2403 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe;
2405 std::map<unsigned int, FEBase *> _holder_fe_helper;
2426
2429 struct QRules
2430 {
2432 : vol(nullptr),
2433 face(nullptr),
2434 arbitrary_vol(nullptr),
2435 arbitrary_face(nullptr),
2436 neighbor(nullptr)
2437 {
2438 }
2439
2441 std::unique_ptr<libMesh::QBase> vol;
2443 std::unique_ptr<libMesh::QBase> face;
2445 std::unique_ptr<libMesh::QBase> fv_face;
2447 std::unique_ptr<ArbitraryQuadrature> arbitrary_vol;
2449 std::unique_ptr<ArbitraryQuadrature> arbitrary_face;
2451 std::unique_ptr<ArbitraryQuadrature> neighbor;
2452 };
2453
2458 std::unordered_map<SubdomainID, std::vector<QRules>> _qrules;
2459
2466 libMesh::QBase * qruleFace(const Elem * elem, unsigned int side);
2467 ArbitraryQuadrature * qruleArbitraryFace(const Elem * elem, unsigned int side);
2468
2469 template <typename T>
2470 T * qruleFaceHelper(const Elem * elem, unsigned int side, std::function<T *(QRules &)> rule_fn)
2471 {
2472 auto dim = elem->dim();
2473 auto neighbor = elem->neighbor_ptr(side);
2474 auto q = rule_fn(qrules(dim, elem->subdomain_id()));
2475 if (!neighbor)
2476 return q;
2477
2478 // find the maximum face quadrature order for all blocks the face is in
2479 auto neighbor_block = neighbor->subdomain_id();
2480 if (neighbor_block == elem->subdomain_id())
2481 return q;
2482
2483 auto q_neighbor = rule_fn(qrules(dim, neighbor_block));
2484 if (q->get_order() > q_neighbor->get_order())
2485 return q;
2486 return q_neighbor;
2487 }
2488
2489 inline QRules & qrules(unsigned int dim) { return qrules(dim, _current_subdomain_id); }
2490
2494 inline QRules & qrules(unsigned int dim, SubdomainID block)
2495 {
2496 if (_qrules.find(block) == _qrules.end())
2497 {
2498 mooseAssert(_qrules.find(Moose::ANY_BLOCK_ID) != _qrules.end(),
2499 "missing quadrature rules for specified block");
2500 mooseAssert(_qrules[Moose::ANY_BLOCK_ID].size() > dim,
2501 "quadrature rules not sized property for dimension");
2503 }
2504 mooseAssert(_qrules.find(block) != _qrules.end(),
2505 "missing quadrature rules for specified block");
2506 mooseAssert(_qrules[block].size() > dim, "quadrature rules not sized property for dimension");
2507 return _qrules[block][dim];
2508 }
2509
2510 /**** Face Stuff ****/
2511
2513 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face;
2515 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face;
2517 std::map<unsigned int, FEBase *> _holder_fe_face_helper;
2531 std::vector<Eigen::Map<RealDIMValue>> _mapped_normals;
2534
2536 std::vector<dof_id_type> _extra_elem_ids;
2538 std::vector<dof_id_type> _neighbor_extra_elem_ids;
2540 std::map<unsigned int, const std::vector<Point> *> _holder_normals;
2541
2542 /**** Neighbor Stuff ****/
2543
2545 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_neighbor;
2546 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face_neighbor;
2547 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_neighbor;
2548 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face_neighbor;
2549
2551 std::map<unsigned int, FEBase *> _holder_fe_neighbor_helper;
2552 std::map<unsigned int, FEBase *> _holder_fe_face_neighbor_helper;
2553
2555 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_lower;
2557 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_lower;
2559 std::map<unsigned int, FEBase *> _holder_fe_lower_helper;
2560
2574
2575 /********** mortar stuff *************/
2576
2578 const std::vector<Real> * _JxW_msm;
2580 std::unique_ptr<FEBase> _fe_msm;
2588
2592
2593protected:
2595 const Elem * _current_elem;
2603 unsigned int _current_side;
2621 const Node * _current_node;
2628
2643
2646
2647 /*
2648 * Residual contributions <tag_index, ivar>
2649 *
2650 * tag_index is the index into _residual_vector_tags, that is, _sub_Re[0] corresponds to the tag
2651 * with TagID _residual_vector_tags[0]._id
2652 *
2653 * When ivar corresponds to an array variable, the dense vector is in size of ndof * count,
2654 * where count is the number of components of the array variable. The local residual is ordered
2655 * as (r_i,j, i = 1,...,ndof; j = 1,...,count).
2656 *
2657 * Dense vectors for variables (ivar+i, i = 1,...,count) are empty.
2658 */
2659 std::vector<std::vector<DenseVector<Number>>> _sub_Re;
2660 std::vector<std::vector<DenseVector<Number>>> _sub_Rn;
2662 std::vector<std::vector<DenseVector<Number>>> _sub_Rl;
2663
2665 DenseVector<Number> _tmp_Re;
2666
2667 /*
2668 * Jacobian contributions <Tag, ivar, jvar>
2669 * When ivar corresponds to an array variable, the number of rows of the dense matrix is in size
2670 * of indof * icount, where icount is the number of components of ivar. When jvar corresponds to
2671 * an array variable, the number of columns of the dense matrix is in size of jndof * jcount,
2672 * where jcount is the number of components of jvar. The local residual is ordered as
2673 * (K_(i,j,k,l), k=1,...,jndof; l = 1,...,jcout; i = 1,...,indof; j = 1,...,icount).
2674 *
2675 * Dense matrices for variables (ivar+i, i = 1,...,icount) or (jvar+j, j = 1,...,jcount) are
2676 * empty.
2677 */
2678 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kee;
2679 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Keg;
2680
2682 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Ken;
2684 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kne;
2686 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knn;
2688 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kll;
2690 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kle;
2692 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kln;
2694 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kel;
2696 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knl;
2697
2699 DenseMatrix<Number> _tmp_Ke;
2700
2701 // Shape function values, gradients. second derivatives
2705
2709
2713
2717
2718 // Shape function values, gradients, second derivatives
2724
2730
2736
2742
2752
2762
2764 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data;
2765 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face;
2766 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_neighbor;
2767 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face_neighbor;
2768 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_lower;
2769 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_dual_lower;
2770
2772 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data;
2773 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face;
2774 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_neighbor;
2775 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face_neighbor;
2776 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_lower;
2777 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_dual_lower;
2778
2779 mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data;
2780 mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>> _ad_vector_grad_phi_data;
2781 mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data_face;
2782 mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>>
2787 mutable bool _need_ad_grad_phi_face = false;
2789 mutable bool _need_ad_grad_phi = false;
2794 mutable bool _need_ad_volume_map = false;
2797 mutable bool _need_ad_face_map = false;
2798
2808 const std::vector<VectorTag> & _residual_vector_tags;
2809
2811 std::vector<std::vector<Real>> _cached_residual_values;
2812
2814 std::vector<std::vector<dof_id_type>> _cached_residual_rows;
2815
2817
2819 std::vector<std::vector<Real>> _cached_jacobian_values;
2821 std::vector<std::vector<dof_id_type>> _cached_jacobian_rows;
2823 std::vector<std::vector<dof_id_type>> _cached_jacobian_cols;
2824
2826
2831 std::vector<bool> _component_block_diagonal;
2832
2834 std::vector<dof_id_type> _temp_dof_indices;
2835
2837 std::vector<Point> _temp_reference_points;
2838
2840 std::vector<VectorValue<ADReal>> _ad_dxyzdxi_map;
2841 std::vector<VectorValue<ADReal>> _ad_dxyzdeta_map;
2842 std::vector<VectorValue<ADReal>> _ad_dxyzdzeta_map;
2843 std::vector<VectorValue<ADReal>> _ad_d2xyzdxi2_map;
2844 std::vector<VectorValue<ADReal>> _ad_d2xyzdxideta_map;
2845 std::vector<VectorValue<ADReal>> _ad_d2xyzdeta2_map;
2846 std::vector<ADReal> _ad_jac;
2849 std::vector<ADReal> _ad_dxidx_map;
2850 std::vector<ADReal> _ad_dxidy_map;
2851 std::vector<ADReal> _ad_dxidz_map;
2852 std::vector<ADReal> _ad_detadx_map;
2853 std::vector<ADReal> _ad_detady_map;
2854 std::vector<ADReal> _ad_detadz_map;
2855 std::vector<ADReal> _ad_dzetadx_map;
2856 std::vector<ADReal> _ad_dzetady_map;
2857 std::vector<ADReal> _ad_dzetadz_map;
2858
2864
2868 std::vector<std::pair<unsigned int, unsigned short>> _disp_numbers_and_directions;
2869
2870 mutable bool _calculate_xyz;
2873
2877
2878 mutable std::set<FEType> _need_second_derivative;
2879 mutable std::set<FEType> _need_second_derivative_neighbor;
2880 mutable std::set<FEType> _need_curl;
2881 mutable std::set<FEType> _need_div;
2882 mutable std::set<FEType> _need_face_div;
2883 mutable std::set<FEType> _need_neighbor_div;
2884 mutable std::set<FEType> _need_face_neighbor_div;
2885
2892
2893 const Elem * _msm_elem = nullptr;
2894
2898 DenseVector<Number> _element_vector;
2899
2903 DenseMatrix<Number> _element_matrix;
2904
2908 std::vector<dof_id_type> _row_indices, _column_indices;
2909
2912
2915};
2916
2917inline const MooseArray<ADReal> &
2919{
2920 // Coord values for non-cartesian coordinate systems are functions of the locations of the
2921 // quadrature points in physical space. We also have no way of knowing whether this was called
2922 // from a volumetric or face object so we should set both volumetric and face xyz to true
2923 _calculate_xyz = true;
2924 _calculate_face_xyz = true;
2925 _need_ad_volume_map = true;
2926 _need_ad_face_map = true;
2927
2928 _calculate_ad_coord = true;
2929 return _ad_coord;
2930}
2931
2932template <typename OutputType>
2934Assembly::fePhiLower(FEType type) const
2935{
2936 buildLowerDFE(type);
2937 return _fe_shape_data_lower[type]->_phi;
2938}
2939
2940template <typename OutputType>
2943{
2944 buildLowerDDualFE(type);
2945 return _fe_shape_data_dual_lower[type]->_phi;
2946}
2947
2948template <typename OutputType>
2951{
2952 buildLowerDFE(type);
2953 return _fe_shape_data_lower[type]->_grad_phi;
2954}
2955
2956template <typename OutputType>
2959{
2960 buildLowerDDualFE(type);
2961 return _fe_shape_data_dual_lower[type]->_grad_phi;
2962}
2963
2964template <>
2966Assembly::feADGradPhi<RealVectorValue>(FEType type) const
2967{
2968 return _ad_vector_grad_phi_data[type];
2969}
2970
2971template <>
2973Assembly::feADGradPhiFace<RealVectorValue>(FEType type) const
2974{
2975 return _ad_vector_grad_phi_data_face[type];
2976}
2977
2978template <>
2980Assembly::fePhi<VectorValue<Real>>(FEType type) const;
2981
2982template <>
2984Assembly::feGradPhi<VectorValue<Real>>(FEType type) const;
2985
2986template <>
2988Assembly::feSecondPhi<VectorValue<Real>>(FEType type) const;
2989
2990template <>
2992Assembly::fePhiLower<VectorValue<Real>>(FEType type) const;
2993
2994template <>
2996Assembly::feDualPhiLower<VectorValue<Real>>(FEType type) const;
2997
2998template <>
3000Assembly::feGradPhiLower<VectorValue<Real>>(FEType type) const;
3001
3002template <>
3004Assembly::feGradDualPhiLower<VectorValue<Real>>(FEType type) const;
3005
3006template <>
3008Assembly::fePhiFace<VectorValue<Real>>(FEType type) const;
3009
3010template <>
3012Assembly::feGradPhiFace<VectorValue<Real>>(FEType type) const;
3013
3014template <>
3016Assembly::feSecondPhiFace<VectorValue<Real>>(FEType type) const;
3017
3018template <>
3020Assembly::fePhiNeighbor<VectorValue<Real>>(FEType type) const;
3021
3022template <>
3024Assembly::feGradPhiNeighbor<VectorValue<Real>>(FEType type) const;
3025
3026template <>
3028Assembly::feSecondPhiNeighbor<VectorValue<Real>>(FEType type) const;
3029
3030template <>
3032Assembly::fePhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3033
3034template <>
3036Assembly::feGradPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3037
3038template <>
3040Assembly::feSecondPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3041
3042template <>
3044Assembly::feCurlPhi<VectorValue<Real>>(FEType type) const;
3045
3046template <>
3048Assembly::feCurlPhiFace<VectorValue<Real>>(FEType type) const;
3049
3050template <>
3052Assembly::feCurlPhiNeighbor<VectorValue<Real>>(FEType type) const;
3053
3054template <>
3056Assembly::feCurlPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3057
3058template <>
3060Assembly::feDivPhi<VectorValue<Real>>(FEType type) const;
3061
3062template <>
3064Assembly::feDivPhiFace<VectorValue<Real>>(FEType type) const;
3065
3066template <>
3068Assembly::feDivPhiNeighbor<VectorValue<Real>>(FEType type) const;
3069
3070template <>
3072Assembly::feDivPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3073
3074template <>
3076Assembly::adGradPhi<RealVectorValue>(const MooseVariableFE<RealVectorValue> & v) const
3077{
3078 _need_ad_grad_phi = true;
3079 return _ad_vector_grad_phi_data.at(v.feType());
3080}
3081
3082template <typename Residuals, typename Indices>
3083void
3084Assembly::cacheResiduals(const Residuals & residuals,
3085 const Indices & input_row_indices,
3086 const Real scaling_factor,
3088 const std::set<TagID> & vector_tags)
3089{
3090 mooseAssert(residuals.size() == input_row_indices.size(),
3091 "The number of residuals should match the number of dof indices");
3092 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3093
3094 if (!computingResidual() || vector_tags.empty())
3095 return;
3096
3097 // A single row needs no constraining unless its dof is constrained (e.g. by a periodic boundary,
3098 // a hanging node, or a user constraint), in which case its residual must be distributed to the
3099 // constraining dofs
3100 if (residuals.size() == 1 && !_dof_map.is_constrained_dof(input_row_indices[0]))
3101 {
3102 // No constraining is required. (This is likely a finite volume computation if we only have a
3103 // single dof)
3105 residuals, input_row_indices, scaling_factor, LocalDataKey{}, vector_tags);
3106 return;
3107 }
3108
3109 // Need to make a copy because we might modify this in constrain_element_vector
3110 _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3111
3113 for (const auto i : index_range(_row_indices))
3114 _element_vector(i) = MetaPhysicL::raw_value(residuals[i]) * scaling_factor;
3115
3116 // At time of writing, this method doesn't do anything with the asymmetric_constraint_rows
3117 // argument, but we set it to false to be consistent with processLocalResidual
3119 _element_vector, _row_indices, /*asymmetric_constraint_rows=*/false);
3120
3121 for (const auto i : index_range(_row_indices))
3122 cacheResidual(_row_indices[i], _element_vector(i), vector_tags);
3123}
3124
3125template <typename Residuals, typename Indices>
3126void
3128 const Indices & row_indices,
3129 const Real scaling_factor,
3131 const std::set<TagID> & vector_tags)
3132{
3133 mooseAssert(residuals.size() == row_indices.size(),
3134 "The number of residuals should match the number of dof indices");
3135 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3136
3137 if (computingResidual() && !vector_tags.empty())
3138 for (const auto i : index_range(row_indices))
3140 row_indices[i], MetaPhysicL::raw_value(residuals[i]) * scaling_factor, vector_tags);
3141}
3142
3143template <typename Residuals, typename Indices>
3144void
3145Assembly::cacheJacobian(const Residuals & residuals,
3146 const Indices & input_row_indices,
3147 const Real scaling_factor,
3149 const std::set<TagID> & matrix_tags)
3150{
3151 if (!computingJacobian() || matrix_tags.empty())
3152 return;
3153
3154 // A single row needs no constraining unless its dof or one of its column dofs is constrained, in
3155 // which case its entries must be distributed to the constraining rows and columns
3156 const auto & single_row_dofs = residuals[0].derivatives().nude_indices();
3157 if (residuals.size() == 1 && !_dof_map.is_constrained_dof(input_row_indices[0]) &&
3158 std::none_of(single_row_dofs.begin(),
3159 single_row_dofs.end(),
3160 [this](const auto dof) { return _dof_map.is_constrained_dof(dof); }))
3161 {
3162 // No constraining is required. (This is likely a finite volume computation if we only have a
3163 // single dof)
3165 residuals, input_row_indices, scaling_factor, LocalDataKey{}, matrix_tags);
3166 return;
3167 }
3168
3169 const auto & compare_dofs = residuals[0].derivatives().nude_indices();
3170#ifndef NDEBUG
3171 auto compare_dofs_set = std::set<dof_id_type>(compare_dofs.begin(), compare_dofs.end());
3172
3173 for (const auto i : make_range(decltype(residuals.size())(1), residuals.size()))
3174 {
3175 const auto & residual = residuals[i];
3176 auto current_dofs_set = std::set<dof_id_type>(residual.derivatives().nude_indices().begin(),
3177 residual.derivatives().nude_indices().end());
3178 mooseAssert(compare_dofs_set == current_dofs_set,
3179 "We're going to see whether the dof sets are the same. IIRC the degree of freedom "
3180 "dependence (as indicated by the dof index set held by the ADReal) has to be the "
3181 "same for every residual passed to this method otherwise constrain_element_matrix "
3182 "will not work.");
3183 }
3184#endif
3185 _column_indices.assign(compare_dofs.begin(), compare_dofs.end());
3186
3187 // If there's no derivatives then there is nothing to do. Moreover, if we pass zero size column
3188 // indices to constrain_element_matrix then we will potentially get errors out of BLAS
3189 if (!_column_indices.size())
3190 return;
3191
3192 // Need to make a copy because we might modify this in constrain_element_matrix
3193 _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3194
3196 for (const auto i : index_range(_row_indices))
3197 {
3198 const auto & sparse_derivatives = residuals[i].derivatives();
3199
3200 for (const auto j : index_range(_column_indices))
3201 _element_matrix(i, j) = sparse_derivatives[_column_indices[j]] * scaling_factor;
3202 }
3203
3205
3206 for (const auto i : index_range(_row_indices))
3207 for (const auto j : index_range(_column_indices))
3208 cacheJacobian(_row_indices[i], _column_indices[j], _element_matrix(i, j), {}, matrix_tags);
3209}
3210
3211template <typename Residuals, typename Indices>
3212void
3214 const Indices & row_indices,
3215 const Real scaling_factor,
3217 const std::set<TagID> & matrix_tags)
3218{
3219 mooseAssert(residuals.size() == row_indices.size(),
3220 "The number of residuals should match the number of dof indices");
3221 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3222
3223 if (!computingJacobian() || matrix_tags.empty())
3224 return;
3225
3226 for (const auto i : index_range(row_indices))
3227 {
3228 const auto row_index = row_indices[i];
3229
3230 const auto & sparse_derivatives = residuals[i].derivatives();
3231 const auto & column_indices = sparse_derivatives.nude_indices();
3232 const auto & raw_derivatives = sparse_derivatives.nude_data();
3233
3234 for (std::size_t j = 0; j < column_indices.size(); ++j)
3236 row_index, column_indices[j], raw_derivatives[j] * scaling_factor, {}, matrix_tags);
3237 }
3238}
3239
3240inline const Real &
3246
3247inline const Real &
3253
3254inline void
3256 std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions)
3257{
3258 _disp_numbers_and_directions = std::move(disp_numbers_and_directions);
3259}
3260
3261inline void
3262Assembly::setCurrentLowerDElem(const Elem * const lower_d_elem)
3263{
3264 _current_lower_d_elem = lower_d_elem;
3265}
MooseVariableFE< Real > MooseVariable
Definition Assembly.h:61
MooseVariableFE< RealEigenVector > ArrayMooseVariable
Definition Assembly.h:63
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
MooseVariableFE< RealVectorValue > VectorMooseVariable
Definition Assembly.h:62
boundary_id_type BoundaryID
subdomain_id_type SubdomainID
OutputTools< RealVectorValue >::VariablePhiValue VectorVariablePhiValue
Definition MooseTypes.h:370
OutputTools< Real >::VariablePhiValue VariablePhiValue
Definition MooseTypes.h:353
OutputTools< RealVectorValue >::VariablePhiCurl VectorVariablePhiCurl
Definition MooseTypes.h:373
OutputTools< Real >::VariablePhiCurl VariablePhiCurl
Definition MooseTypes.h:356
unsigned int TagID
Definition MooseTypes.h:238
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
Definition MooseTypes.h:354
typename OutputTools< typename Moose::ADType< T >::type >::VariablePhiGradient ADTemplateVariablePhiGradient
Definition MooseTypes.h:691
OutputTools< RealVectorValue >::VariablePhiSecond VectorVariablePhiSecond
Definition MooseTypes.h:372
unsigned int THREAD_ID
Definition MooseTypes.h:237
OutputTools< RealVectorValue >::VariablePhiDivergence VectorVariablePhiDivergence
Definition MooseTypes.h:374
OutputTools< Real >::VariablePhiSecond VariablePhiSecond
Definition MooseTypes.h:355
OutputTools< Real >::VariablePhiDivergence VariablePhiDivergence
Definition MooseTypes.h:357
OutputTools< RealVectorValue >::VariablePhiGradient VectorVariablePhiGradient
Definition MooseTypes.h:371
unsigned int dim
Implements a fake quadrature rule where you can specify the locations (in the reference domain) of th...
VariablePhiCurl _curl_phi
Definition Assembly.h:2749
VariablePhiValue _phi
Definition Assembly.h:2746
VariablePhiGradient _grad_phi
Definition Assembly.h:2747
VariablePhiSecond _second_phi
Definition Assembly.h:2748
VariablePhiDivergence _div_phi
Definition Assembly.h:2750
Key structure for APIs manipulating global vectors/matrices.
Definition Assembly.h:841
GlobalDataKey(const GlobalDataKey &)
Definition Assembly.h:850
Key structure for APIs adding/caching local element residuals/Jacobians.
Definition Assembly.h:859
LocalDataKey(const LocalDataKey &)
Definition Assembly.h:864
VectorVariablePhiValue _phi
Definition Assembly.h:2756
VectorVariablePhiGradient _grad_phi
Definition Assembly.h:2757
VectorVariablePhiSecond _second_phi
Definition Assembly.h:2758
VectorVariablePhiCurl _curl_phi
Definition Assembly.h:2759
VectorVariablePhiDivergence _div_phi
Definition Assembly.h:2760
Keeps track of stuff related to assembling.
Definition Assembly.h:102
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:1149
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kll
dlower/dlower
Definition Assembly.h:2688
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:2831
void cacheJacobianNonlocal(GlobalDataKey)
Takes the values that are currently in _sub_Keg and appends them to the cached values.
Definition Assembly.C:4141
const VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1391
SystemBase & _sys
Definition Assembly.h:2311
std::map< unsigned int, FEBase * > _holder_fe_lower_helper
helper object for transforming coordinates for lower dimensional element quadrature points
Definition Assembly.h:2559
const VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1352
std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > _cm_sf_entry
Entries in the coupling matrix for scalar variables vs field variables.
Definition Assembly.h:2334
void addJacobian(GlobalDataKey)
Adds all local Jacobian to the global Jacobian matrices.
Definition Assembly.C:3923
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:2274
const Real & neighborLowerDElemVolume() const
Definition Assembly.h:3248
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:1875
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:3450
void assignDisplacements(std::vector< std::pair< unsigned int, unsigned short > > &&disp_numbers_and_directions)
Assign the displacement numbers and directions.
Definition Assembly.h:3255
const FEBase *const & getFENeighbor(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current 'neighbor' FE.
Definition Assembly.h:136
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:2772
const bool & _computing_jacobian
Whether we are currently computing the Jacobian.
Definition Assembly.h:2324
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition Assembly.h:2417
VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1467
const std::vector< Real > * _JxW_msm
A JxW for working on mortar segement elements.
Definition Assembly.h:2578
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kee
Definition Assembly.h:2678
std::set< FEType > _need_face_neighbor_div
Definition Assembly.h:2884
VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1524
void prepareLowerD()
Prepare the Jacobians and residuals for a lower dimensional element.
Definition Assembly.C:2916
void modifyWeightsDueToXFEM(const Elem *elem)
Update the integration weights for XFEM partial elements.
Definition Assembly.C:4583
VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1507
void reinitFVFace(const FaceInfo &fi)
Definition Assembly.C:1902
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFace(FEType type) const
Definition Assembly.h:1664
VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1512
std::vector< std::vector< DenseVector< Number > > > _sub_Re
Definition Assembly.h:2659
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:3508
void reinitFE(const Elem *elem)
Just an internal helper function to reinit the volume FE objects.
Definition Assembly.C:797
DenseMatrix< Number > _element_matrix
A working matrix to avoid repeated heap allocations when caching Jacobians that must have libMesh-lev...
Definition Assembly.h:2903
VectorVariablePhiValue _vector_phi_face_neighbor
Definition Assembly.h:2737
const VariablePhiValue & phiFace() const
Definition Assembly.h:1332
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & nonlocalCouplingEntries()
Definition Assembly.h:1300
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:654
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1475
MooseArray< Real > _curvatures
Definition Assembly.h:2862
std::vector< std::unique_ptr< FEBase > > _unique_fe_lower_helper
Definition Assembly.h:2372
MooseArray< Real > _coord_neighbor
The current coordinate transformation coefficients.
Definition Assembly.h:2570
const OutputTools< OutputType >::VariablePhiValue & fePhiFaceNeighbor(FEType type) const
Definition Assembly.h:1719
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1484
const bool _displaced
Definition Assembly.h:2314
void reinitFEFaceNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition Assembly.C:1618
void reinitFENeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition Assembly.C:1677
VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1549
void prepareVariableNonlocal(MooseVariableFieldBase *var)
Definition Assembly.C:2848
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhi(FEType type) const
Definition Assembly.h:1775
void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector< dof_id_type > &dof_indices)
Definition Assembly.C:2968
VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1553
std::vector< ADReal > _ad_dzetady_map
Definition Assembly.h:2856
VariablePhiGradient _grad_phi
Definition Assembly.h:2703
libMesh::QBase * _current_qrule_face
quadrature rule used on faces
Definition Assembly.h:2521
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiNeighbor(FEType type) const
Definition Assembly.h:1790
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:2828
virtual ~Assembly()
Definition Assembly.C:187
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:2343
bool _need_ad_grad_phi_face
Whether any object needs the AD face shape function gradients.
Definition Assembly.h:2787
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:3127
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:2238
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:3287
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1767
VectorVariablePhiCurl _vector_curl_phi
Definition Assembly.h:2722
MooseArray< VectorValue< ADReal > > _ad_q_points
Definition Assembly.h:2848
bool _current_side_volume_computed
Boolean to indicate whether current element side volumes has been computed.
Definition Assembly.h:2627
bool _need_ad_volume_map
Whether any object needs the AD element JxW, quadrature points or coordinate transformation.
Definition Assembly.h:2794
MooseArray< Real > _current_JxW_face
The current transformed jacobian weights on a face.
Definition Assembly.h:2527
const FEType _helper_type
The finite element type of the FE helper classes.
Definition Assembly.h:2357
Real _current_elem_volume
Volume of the current element.
Definition Assembly.h:2601
const MooseArray< Point > & normals() const
Returns the array of normals for quadrature points on a current side.
Definition Assembly.h:347
VectorVariablePhiSecond _vector_second_phi_face_neighbor
Definition Assembly.h:2739
const VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1386
void cacheJacobianCoupledVarPair(const MooseVariableBase &ivar, const MooseVariableBase &jvar)
Caches element matrix for ivar rows and jvar columns.
Definition Assembly.C:4125
const VariablePhiValue & phi(const MooseVariableField< Real > &) const
Definition Assembly.h:1323
bool _building_helpers
Whether we are currently building the FE classes for the helpers.
Definition Assembly.h:2375
void addJacobianScalar(GlobalDataKey)
Add Jacobians for pairs of scalar variables into the global Jacobian matrices.
Definition Assembly.C:4506
void setVolumeQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for volume integration.
void computeCurrentNeighborVolume()
const VariablePhiGradient & gradPhi() const
Definition Assembly.h:1324
FEBase * _current_fe_face_helper
helper object for transforming coordinates
Definition Assembly.h:2519
void cacheJacobianBlockNonzero(const 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:3731
FEBase * _current_fe_helper
The current helper object for transforming coordinates.
Definition Assembly.h:2407
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called....
Definition Assembly.h:2645
VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1537
void addJacobianLowerD(GlobalDataKey)
Add portions of the Jacobian of LowerLower, LowerSecondary, and SecondaryLower for boundary condition...
Definition Assembly.C:4074
libMesh::QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition Assembly.h:2409
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:325
const MooseArray< Point > & qPoints() const
Returns the reference to the quadrature points.
Definition Assembly.h:250
const bool & _computing_residual
Whether we are currently computing the residual.
Definition Assembly.h:2321
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:1826
MooseArray< VectorValue< ADReal > > _ad_normals
Definition Assembly.h:2860
VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1561
libMesh::QBase * writeableQRule(unsigned int dim, SubdomainID block, InternalDataKey)
Returns the pointer to the quadrature of specified block and dimension.
Definition Assembly.h:240
const std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > & scalarFieldCouplingEntries() const
Definition Assembly.h:1310
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:4513
void addJacobianNeighbor(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, TagID tag)
Adds three neighboring element matrices for ivar rows and jvar columns to the global Jacobian matrix.
void modifyArbitraryWeights(const std::vector< Real > &weights)
Modify the weights when using the arbitrary quadrature rule.
Definition Assembly.C:4624
void computeCurrentFaceVolume()
Definition Assembly.C:1818
VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1503
const VariablePhiGradient & gradPhiFace() const
Definition Assembly.h:1334
bool _need_JxW_neighbor
Flag to indicate that JxW_neighbor is needed.
Definition Assembly.h:2566
VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1499
const BoundaryID & currentBoundaryID() const
Return the current boundary ID.
Definition Assembly.h:425
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhi(FEType type) const
Definition Assembly.h:1636
VectorVariablePhiSecond _vector_second_phi
Definition Assembly.h:2721
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiLower(FEType type) const
Definition Assembly.h:2950
bool _user_added_fe_of_helper_type
Whether user code requested a FEType the same as our _helper_type.
Definition Assembly.h:2360
VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1545
const FEVectorBase *const & getVectorFENeighbor(FEType type, unsigned int dim) const
GetVector a reference to a pointer that will contain the current 'neighbor' FE.
Definition Assembly.h:184
VectorVariablePhiCurl _vector_curl_phi_neighbor
Definition Assembly.h:2734
void setCurrentNeighborSubdomainID(SubdomainID i)
set the current subdomain ID
Definition Assembly.h:498
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data
Definition Assembly.h:2780
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe
Each dimension's actual vector fe objects indexed on type.
Definition Assembly.h:2403
const MooseArray< ADPoint > & adQPointsFace() const
Definition Assembly.h:396
MooseArray< ADReal > _ad_JxW_face
Definition Assembly.h:2859
bool _calculate_xyz
Definition Assembly.h:2870
const VariablePhiValue & phi() const
Definition Assembly.h:1316
void buildFaceNeighborFE(FEType type) const
Build FEs for a neighbor face with a type.
Definition Assembly.C:346
const VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1374
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition Assembly.h:2597
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face
Definition Assembly.h:2773
const libMesh::CouplingMatrix & _nonlocal_cm
Definition Assembly.h:2318
VectorVariablePhiDivergence _vector_div_phi_neighbor
Definition Assembly.h:2735
Real _current_neighbor_volume
Volume of the current neighbor.
Definition Assembly.h:2619
const FEVectorBase *const & getVectorFE(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current volume FEVector.
Definition Assembly.h:172
const MooseArray< Moose::GenericType< Point, is_ad > > & genericQPoints() const
bool _need_neighbor_lower_d_elem_volume
Whether we need to compute the neighboring lower dimensional element volume.
Definition Assembly.h:2638
DenseVector< Real > getJacobianDiagonal(const DenseMatrix< Number > &ke)
Definition Assembly.h:1901
Moose::CoordinateSystemType _coord_type
The coordinate system.
Definition Assembly.h:2421
VectorVariablePhiGradient _vector_grad_phi_face_neighbor
Definition Assembly.h:2738
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:2259
std::map< FEType, FEBase * > _current_fe_neighbor
The "neighbor" fe object that matches the current elem.
Definition Assembly.h:2385
const OutputTools< OutputType >::VariablePhiValue & fePhiLower(FEType type) const
Definition Assembly.h:2934
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_lower
FE objects for lower dimensional elements.
Definition Assembly.h:2555
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
Definition Assembly.h:2660
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:2283
VariablePhiValue _phi_face_neighbor
Definition Assembly.h:2714
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:368
void buildVectorNeighborFE(FEType type) const
Build Vector FEs for a neighbor with a type.
Definition Assembly.C:545
std::vector< Eigen::Map< RealDIMValue > > _mapped_normals
Mapped normals.
Definition Assembly.h:2531
const libMesh::DofMap & _dof_map
DOF map.
Definition Assembly.h:2347
const VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1339
void setFaceQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for face integration.
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
Definition Assembly.h:2546
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1480
void prepareScalar()
Definition Assembly.C:3019
const OutputTools< OutputType >::VariablePhiValue & feDualPhiLower(FEType type) const
Definition Assembly.h:2942
std::set< FEType > _need_second_derivative_neighbor
Definition Assembly.h:2879
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Ken
jacobian contributions from the element and neighbor <Tag, ivar, jvar>
Definition Assembly.h:2682
std::vector< VectorValue< ADReal > > _ad_dxyzdxi_map
AD quantities.
Definition Assembly.h:2840
VariablePhiSecond _second_phi_face
Definition Assembly.h:2708
const MooseArray< ADReal > & adCurvatures() const
Definition Assembly.C:4857
bool _prepared_for_p_refinement
Whether helper FEs have been prepared for p-refinement.
Definition Assembly.h:2911
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_neighbor_helper
Definition Assembly.h:2370
std::vector< Point > _temp_reference_points
Temporary work data for reinitAtPhysical()
Definition Assembly.h:2837
std::vector< std::pair< MooseVariableScalar *, MooseVariableScalar * > > _cm_ss_entry
Entries in the coupling matrix for scalar variables.
Definition Assembly.h:2336
const Elem * _current_lower_d_elem
The current lower dimensional element.
Definition Assembly.h:2630
bool _need_ad_face_map
Whether any object needs the AD face JxW, normals, quadrature points, curvatures or coordinate transf...
Definition Assembly.h:2797
unsigned int _current_side
The current side of the selected element (valid only when working with sides)
Definition Assembly.h:2603
const bool & _computing_residual_and_jacobian
Whether we are currently computing the residual and Jacobian.
Definition Assembly.h:2327
void buildNeighborFE(FEType type) const
Build FEs for a neighbor with a type.
Definition Assembly.C:321
ArbitraryQuadrature * qruleArbitraryFace(const Elem *elem, unsigned int side)
Definition Assembly.C:1968
const OutputTools< OutputType >::VariablePhiGradient & feGradDualPhiLower(FEType type) const
Definition Assembly.h:2958
std::unordered_map< SubdomainID, std::vector< QRules > > _qrules
Holds quadrature rules for each dimension.
Definition Assembly.h:2458
void setCoordinateTransformation(const libMesh::QBase *qrule, const Points &q_points, Coords &coord, SubdomainID sub_id)
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:1837
std::map< FEType, FEVectorBase * > _current_vector_fe
The "volume" vector fe object that matches the current elem.
Definition Assembly.h:2390
std::vector< VectorValue< ADReal > > _ad_dxyzdzeta_map
Definition Assembly.h:2842
VariablePhiValue & phiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1579
VariablePhiSecond & secondPhi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1577
VariablePhiGradient _grad_phi_neighbor
Definition Assembly.h:2711
bool computingResidualAndJacobian() const
Definition Assembly.h:1959
libMesh::QBase *const & writeableQRuleNeighbor()
Returns the reference to the current quadrature being used on a current neighbor.
Definition Assembly.h:523
std::unique_ptr< FEBase > _fe_msm
A FE object for working on mortar segement elements.
Definition Assembly.h:2580
std::vector< ADReal > _ad_detadx_map
Definition Assembly.h:2852
void addJacobianNonlocal(GlobalDataKey)
Adds non-local Jacobian to the global Jacobian matrices.
Definition Assembly.C:3936
const VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1348
const unsigned int & neighborSide() const
Returns the current neighboring side.
Definition Assembly.h:448
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:3405
bool computingResidual() const
Definition Assembly.h:1949
void prepareNeighbor()
Definition Assembly.C:2878
VectorVariablePhiGradient _vector_grad_phi_neighbor
Definition Assembly.h:2732
const MooseArray< Point > & physicalPoints() const
The current points in physical space where we have reinited through reinitAtPhysical()
Definition Assembly.h:262
const Elem *const & elem() const
Return the current element.
Definition Assembly.h:410
std::map< FEType, FEVectorBase * > _current_vector_fe_face_neighbor
The "neighbor face" vector fe object that matches the current elem.
Definition Assembly.h:2396
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.
Definition Assembly.C:2486
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition Assembly.h:2623
std::vector< ADReal > _ad_dxidx_map
Definition Assembly.h:2849
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction)
Definition Assembly.h:2699
void buildFE(FEType type) const
Build FEs with a type.
Definition Assembly.C:267
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1735
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:3084
void setXFEM(std::shared_ptr< XFEMInterface > xfem)
Set the pointer to the XFEM controller object.
Definition Assembly.h:1810
VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1528
const Elem *const & neighborLowerDElem() const
Return the neighboring lower dimensional element.
Definition Assembly.h:478
const Elem * _current_neighbor_side_elem
The current side element of the ncurrent neighbor element.
Definition Assembly.h:2615
std::vector< ADReal > _ad_dxidz_map
Definition Assembly.h:2851
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:3522
VariablePhiGradient _grad_phi_face_neighbor
Definition Assembly.h:2715
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_neighbor
Definition Assembly.h:2547
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kle
dlower/dsecondary (or dlower/delement)
Definition Assembly.h:2690
MooseArray< ADReal > _ad_JxW
Definition Assembly.h:2847
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:3490
void copyFaceShapes(MooseVariableField< T > &v)
Definition Assembly.C:3106
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:3383
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction)
Definition Assembly.h:2665
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries()
Definition Assembly.h:1290
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:3355
const VariablePhiValue & phiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1333
bool _calculate_ad_coord
Whether to calculate coord with AD.
Definition Assembly.h:2876
const libMesh::CouplingMatrix * _cm
Coupling matrices.
Definition Assembly.h:2317
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:2247
VectorVariablePhiCurl _vector_curl_phi_face
Definition Assembly.h:2728
VariablePhiGradient & gradPhi(const MooseVariableField< Real > &)
Definition Assembly.h:1463
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition Assembly.h:2525
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_neighbor
Definition Assembly.h:2774
void needADGradPhi() const
Request that element reinitialization compute the AD shape function gradients.
Definition Assembly.h:1686
void cacheJacobianNeighbor(GlobalDataKey)
Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached val...
Definition Assembly.C:4163
const libMesh::QBase *const & qRuleMortar() const
Returns a reference to the quadrature rule for the mortar segments.
Definition Assembly.h:708
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:3227
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:2358
void setNeighborQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for neighbor integration.
Definition Assembly.C:746
void helpersRequestData()
request phi, dphi, xyz, JxW, etc.
Definition Assembly.C:4869
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knn
jacobian contributions from the neighbor <Tag, ivar, jvar>
Definition Assembly.h:2686
const MooseArray< ADPoint > & adQPoints() const
Definition Assembly.h:389
libMesh::QBase *const & writeableQRule()
Returns the reference to the current quadrature being used.
Definition Assembly.h:233
void clearCachedQRules()
Set the cached quadrature rules to nullptr.
Definition Assembly.C:763
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kln
dlower/dprimary (or dlower/dneighbor)
Definition Assembly.h:2692
VariablePhiSecond & secondPhi(const MooseVariableField< Real > &)
Definition Assembly.h:1464
libMesh::QBase * _current_qrule_neighbor
quadrature rule used on neighbors
Definition Assembly.h:2562
void setLowerQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for lower dimensional integration.
Definition Assembly.C:727
void buildLowerDFE(FEType type) const
Build FEs for a lower dimensional element with a type.
Definition Assembly.C:371
const VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1426
VariablePhiGradient _grad_phi_face
Definition Assembly.h:2707
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:2345
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries() const
Definition Assembly.h:1295
const std::vector< Point > & qPointsMortar() const
Returns the reference to the mortar segment element quadrature points.
Definition Assembly.h:256
std::map< unsigned int, const std::vector< Point > * > _holder_normals
Holds pointers to the dimension's normal vectors.
Definition Assembly.h:2540
const OutputTools< OutputType >::VariablePhiValue & fePhiNeighbor(FEType type) const
Definition Assembly.h:1697
libMesh::QBase *const & writeableQRuleFace()
Returns the reference to the current quadrature being used on a current face.
Definition Assembly.h:318
void setCurrentSubdomainID(SubdomainID i)
set the current subdomain ID
Definition Assembly.h:420
Real elementVolume(const Elem *elem) const
On-demand computation of volume element accounting for RZ/RSpherical.
Definition Assembly.C:3823
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition Assembly.h:2545
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...
const VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1361
const VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1335
const OutputTools< OutputType >::VariablePhiGradient & feGradPhi(FEType type) const
Definition Assembly.h:1623
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFace(FEType type) const
Definition Assembly.h:1751
const unsigned int & side() const
Returns the current side.
Definition Assembly.h:442
std::vector< VectorValue< ADReal > > _ad_d2xyzdeta2_map
Definition Assembly.h:2845
BoundaryID _current_boundary_id
The current boundary ID.
Definition Assembly.h:2599
MooseArray< std::vector< Point > > _current_tangents
The current tangent vectors at the quadrature points.
Definition Assembly.h:2533
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_helper
Definition Assembly.h:2369
std::map< FEType, FEBase * > _current_fe
The "volume" fe object that matches the current elem.
Definition Assembly.h:2381
VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1516
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhiFace(FEType type) const
Definition Assembly.h:1671
const std::vector< Eigen::Map< RealDIMValue > > & mappedNormals() const
Definition Assembly.h:352
const VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1382
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:2993
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_lower
Definition Assembly.h:2768
VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1495
const Real & lowerDElemVolume() const
Definition Assembly.h:3241
VariablePhiSecond _second_phi
Definition Assembly.h:2704
void cacheJacobianBlock(const DenseMatrix< Number > &jac_block, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, Real scaling_factor, LocalDataKey, const std::set< TagID > &tags)
Cache a local Jacobian block with the provided rows (idof_indices) and columns (jdof_indices) for eve...
Definition Assembly.C:3787
std::vector< VectorValue< ADReal > > _ad_d2xyzdxideta_map
Definition Assembly.h:2844
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:2494
const MooseArray< ADPoint > & adNormals() const
Definition Assembly.h:383
std::vector< std::pair< unsigned int, unsigned short > > _disp_numbers_and_directions
Container of displacement numbers and directions.
Definition Assembly.h:2868
T * qruleFaceHelper(const Elem *elem, unsigned int side, std::function< T *(QRules &)> rule_fn)
Definition Assembly.h:2470
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face
types of vector finite elements
Definition Assembly.h:2515
VectorVariablePhiValue _vector_phi
Definition Assembly.h:2719
void buildVectorLowerDFE(FEType type) const
Build Vector FEs for a lower dimensional element with a type.
Definition Assembly.C:422
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:4491
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiNeighbor(FEType type) const
Definition Assembly.h:1711
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension's actual fe objects indexed on type.
Definition Assembly.h:2401
std::set< FEType > _need_curl
Definition Assembly.h:2880
const VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1365
const VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1378
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:2368
unsigned int numExtraElemIntegers() const
Number of extra element integers Assembly tracked.
Definition Assembly.h:363
const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase &fe)
Attaches the current elem/volume quadrature rule to the given fe.
Definition Assembly.h:1917
void activateDual()
Indicates that dual shape functions are used for mortar constraint.
Definition Assembly.h:613
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_ff_entry
Entries in the coupling matrix for field variables.
Definition Assembly.h:2330
const Moose::CoordinateSystemType & coordSystem() const
Get the coordinate system type.
Definition Assembly.h:306
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_nonlocal_entry
Entries in the coupling matrix for field variables for nonlocal calculations.
Definition Assembly.h:2338
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition Assembly.h:2625
VectorVariablePhiSecond _vector_second_phi_neighbor
Definition Assembly.h:2733
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > & fieldScalarCouplingEntries() const
Definition Assembly.h:1305
const VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1370
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:1120
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1727
void buildLowerDDualFE(FEType type) const
Definition Assembly.C:398
VariablePhiValue _phi_neighbor
Definition Assembly.h:2710
VariablePhiValue & phiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1466
void addCachedResidualDirectly(NumericVector< Number > &residual, GlobalDataKey, const VectorTag &vector_tag)
Adds the values that have been cached by calling cacheResidual(), cacheResidualNeighbor(),...
Definition Assembly.C:3581
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition Assembly.h:2513
std::vector< ADReal > _ad_jac
Definition Assembly.h:2846
void addJacobianNeighbor(GlobalDataKey)
Add ElementNeighbor, NeighborElement, and NeighborNeighbor portions of the Jacobian for compute objec...
Definition Assembly.C:3958
VectorVariablePhiCurl _vector_curl_phi_face_neighbor
Definition Assembly.h:2740
void setMortarQRule(Order order)
Specifies a custom qrule for integration on mortar segment mesh.
Definition Assembly.C:772
void saveLocalADArray(std::vector< ADReal > &re, unsigned int i, unsigned int ntest, const ADRealEigenVector &v) const
Definition Assembly.C:3856
VariablePhiGradient & gradPhi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1576
const std::vector< VectorTag > & _residual_vector_tags
The residual vector tags that Assembly could possibly contribute to.
Definition Assembly.h:2808
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition Assembly.h:2609
VectorVariablePhiDivergence _vector_div_phi_face
Definition Assembly.h:2729
bool _user_added_fe_face_neighbor_of_helper_type
Definition Assembly.h:2362
const MooseArray< ADReal > & adJxWFace() const
Definition Assembly.h:276
std::vector< ADReal > _ad_dzetadx_map
Definition Assembly.h:2855
std::vector< dof_id_type > _column_indices
Definition Assembly.h:2908
const FEBase *const & getFE(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current volume FE.
Definition Assembly.h:124
const VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1344
MooseMesh & _mesh
Definition Assembly.h:2351
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:3186
std::vector< ADReal > _ad_detadz_map
Definition Assembly.h:2854
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:1138
std::vector< dof_id_type > _temp_dof_indices
Temporary work vector to keep from reallocating it.
Definition Assembly.h:2834
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition Assembly.h:2340
void buildVectorFaceNeighborFE(FEType type) const
Build Vector FEs for a neighbor face with a type.
Definition Assembly.C:578
ArbitraryQuadrature * _current_qface_arbitrary
The current arbitrary quadrature rule used on element faces.
Definition Assembly.h:2523
VectorVariablePhiGradient _vector_grad_phi
Definition Assembly.h:2720
const VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1395
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:2301
void prepareJacobianBlock()
Sizes and zeroes the Jacobian blocks used for the current element.
Definition Assembly.C:2752
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:2292
void resizeADMappingObjects(unsigned int n_qp, unsigned int dim)
resize any objects that contribute to automatic differentiation-related mapping calculations
Definition Assembly.C:1014
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:3332
const libMesh::QBase *const & qRuleNeighbor() const
Returns the reference to the current quadrature being used on a current neighbor.
Definition Assembly.h:514
std::vector< VectorValue< ADReal > > _ad_dxyzdeta_map
Definition Assembly.h:2841
bool computingJacobian() const
Definition Assembly.h:1954
const Node * _current_node
The current node we are working with.
Definition Assembly.h:2621
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1602
DenseVector< Number > & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
Get residual block for lower.
Definition Assembly.h:1129
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data_face
Definition Assembly.h:2783
void cacheJacobianMortar(GlobalDataKey)
Cache all portions of the Jacobian, e.g.
Definition Assembly.C:4201
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:612
THREAD_ID _tid
Thread number (id)
Definition Assembly.h:2349
bool _calculate_face_xyz
Definition Assembly.h:2871
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kel
dsecondary/dlower (or delement/dlower)
Definition Assembly.h:2694
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_dual_lower
Definition Assembly.h:2777
MooseArray< Point > _current_normals
The current Normal vectors at the quadrature points.
Definition Assembly.h:2529
void cacheJacobian(GlobalDataKey)
Takes the values that are currently in _sub_Kee and appends them to the cached values.
Definition Assembly.C:4111
bool _calculate_curvatures
Definition Assembly.h:2872
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME)
Definition Assembly.h:2811
const Node *const & node() const
Returns the reference to the node.
Definition Assembly.h:541
std::vector< std::vector< dof_id_type > > _cached_jacobian_cols
Column where the corresponding cached value should go.
Definition Assembly.h:2823
ArbitraryQuadrature * _current_qrule_arbitrary
The current arbitrary quadrature rule used within the element interior.
Definition Assembly.h:2413
void computeADFace(const Elem &elem, const unsigned int side)
compute AD things on an element face
Definition Assembly.C:2165
libMesh::ElemSideBuilder _current_side_elem_builder
In place side element builder for _current_side_elem.
Definition Assembly.h:2887
const VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1403
void setCurrentBoundaryID(BoundaryID i)
set the current boundary ID
Definition Assembly.h:430
void computeFaceMap(const Elem &elem, const unsigned int side, const std::vector< Real > &qw)
Definition Assembly.C:1393
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_lower
Vector FE objects for lower dimensional elements.
Definition Assembly.h:2557
void setCachedJacobian(GlobalDataKey)
Sets previously-cached Jacobian values via SparseMatrix::set() calls.
Definition Assembly.C:4542
const VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1422
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:635
libMesh::QBase * qruleFace(const Elem *elem, unsigned int side)
This is an abstraction over the internal qrules function.
Definition Assembly.C:1962
void preparePRefinement()
Prepare helper FEs for p-refinement.
Definition Assembly.C:4902
std::vector< std::vector< DenseVector< Number > > > _sub_Rl
residual contributions for each variable from the lower dimensional element
Definition Assembly.h:2662
std::map< FEType, FEBase * > _current_fe_face
The "face" fe object that matches the current elem.
Definition Assembly.h:2383
VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1494
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
Definition Assembly.C:3866
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:2265
VectorVariablePhiDivergence _vector_div_phi
Definition Assembly.h:2723
const OutputTools< OutputType >::VariablePhiValue & fePhi(FEType type) const
Definition Assembly.h:1616
const VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1456
const VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1407
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
Definition Assembly.C:1864
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:377
const VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1431
std::vector< dof_id_type > _neighbor_extra_elem_ids
Extra element IDs of neighbor.
Definition Assembly.h:2538
libMesh::ElemSideBuilder _compute_face_map_side_elem_builder
In place side element builder for computeFaceMap()
Definition Assembly.h:2891
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:3458
VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1533
void modifyFaceWeightsDueToXFEM(const Elem *elem, unsigned int side=0)
Update the face integration weights for XFEM partial elements.
Definition Assembly.C:4603
unsigned int _max_cached_residuals
Definition Assembly.h:2816
void buildFaceFE(FEType type) const
Build FEs for a face with a type.
Definition Assembly.C:296
const Real & sideElemVolume() const
Returns the reference to the volume of current side element.
Definition Assembly.h:460
std::shared_ptr< XFEMInterface > _xfem
The XFEM controller.
Definition Assembly.h:2378
std::map< unsigned int, FEBase * > _holder_fe_face_neighbor_helper
Definition Assembly.h:2552
std::set< FEType > _need_neighbor_div
Definition Assembly.h:2883
SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition Assembly.h:2611
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhi(FEType type) const
Definition Assembly.h:1630
std::map< FEType, FEVectorBase * > _current_vector_fe_face
The "face" vector fe object that matches the current elem.
Definition Assembly.h:2392
VariablePhiValue _phi
Definition Assembly.h:2702
bool _custom_mortar_qrule
Flag specifying whether a custom quadrature rule has been specified for mortar segment mesh.
Definition Assembly.h:2587
libMesh::ElemSideBuilder _current_neighbor_side_elem_builder
In place side element builder for _current_neighbor_side_elem.
Definition Assembly.h:2889
const SubdomainID & currentNeighborSubdomainID() const
Return the current subdomain ID.
Definition Assembly.h:493
std::vector< std::vector< dof_id_type > > _cached_jacobian_rows
Row where the corresponding cached value should go.
Definition Assembly.h:2821
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data_face
Definition Assembly.h:2781
MooseArray< ADReal > _ad_coord
The AD version of the current coordinate transformation coefficients.
Definition Assembly.h:2425
const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase &fe)
Attaches the current face/area quadrature rule to the given fe.
Definition Assembly.h:1929
std::vector< std::unique_ptr< FEBase > > _unique_fe_neighbor_helper
Definition Assembly.h:2371
VariablePhiSecond & secondPhiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1584
std::map< FEType, FEBase * > _current_fe_face_neighbor
The "neighbor face" fe object that matches the current elem.
Definition Assembly.h:2387
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:1044
void needADGradPhiFace() const
Request that face reinitialization compute the AD shape function gradients.
Definition Assembly.h:1680
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1488
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_neighbor
Definition Assembly.h:2766
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:2256
VariablePhiValue & phi(const MooseVariableField< Real > &)
Definition Assembly.h:1462
VariablePhiValue & phiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1589
bool _need_lower_d_elem_volume
Whether we need to compute the lower dimensional element volume.
Definition Assembly.h:2634
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face_neighbor
Definition Assembly.h:2775
QRules & qrules(unsigned int dim)
Definition Assembly.h:2489
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:2337
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition Assembly.h:2617
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFace(FEType type) const
Definition Assembly.h:1782
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Keg
Definition Assembly.h:2679
SubProblem & _subproblem
Definition Assembly.h:2312
std::set< FEType > _need_face_div
Definition Assembly.h:2882
const std::vector< Real > & jxWMortar() const
Returns a reference to JxW for mortar segment elements.
Definition Assembly.h:703
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:2039
const MooseArray< std::vector< Point > > & tangents() const
Returns the array of tangents for quadrature points on a current side.
Definition Assembly.h:358
const ADTemplateVariablePhiGradient< T > & adGradPhi(const MooseVariableFE< T > &v) const
Definition Assembly.h:1318
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:3908
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:2064
void init(const libMesh::CouplingMatrix *cm)
Initialize the Assembly object and set the CouplingMatrix for use throughout.
const Real & elemVolume() const
Returns the reference to the current element volume.
Definition Assembly.h:436
VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1541
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:4349
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiNeighbor(FEType type) const
Definition Assembly.h:1704
VectorVariablePhiGradient _vector_grad_phi_face
Definition Assembly.h:2726
VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1470
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > _cm_fs_entry
Entries in the coupling matrix for field variables vs scalar variables.
Definition Assembly.h:2332
Real _current_side_volume
Volume of the current side element.
Definition Assembly.h:2607
void copyShapes(MooseVariableField< T > &v)
Definition Assembly.C:3069
const MooseArray< Real > & coordTransformation() const
Returns the reference to the coordinate transformation coefficients.
Definition Assembly.h:288
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:3317
VariablePhiSecond _second_phi_neighbor
Definition Assembly.h:2712
Real _current_neighbor_lower_d_elem_volume
The current neighboring lower dimensional element volume.
Definition Assembly.h:2640
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition Assembly.h:2423
void prepare()
Definition Assembly.C:2785
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_lower
Definition Assembly.h:2776
void buildVectorFE(FEType type) const
Build Vector FEs with a type.
Definition Assembly.C:478
VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1565
const OutputTools< OutputType >::VariablePhiValue & fePhiFace(FEType type) const
Definition Assembly.h:1657
VariablePhiGradient & gradPhiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1580
static const T *const & constify_ref(T *const &inref)
Workaround for C++ compilers thinking they can't just cast a const-reference-to-pointer to const-refe...
Definition Assembly.h:112
DenseVector< Number > & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
Get local residual block for a variable and a tag.
Definition Assembly.h:1111
ArbitraryQuadrature * _current_qrule_arbitrary_face
The current arbitrary quadrature rule used on the element face.
Definition Assembly.h:2415
const MooseArray< Real > & JxW() const
Returns the reference to the transformed jacobian weights.
Definition Assembly.h:268
VariablePhiValue _phi_face
Definition Assembly.h:2706
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_nonlocal_used
Definition Assembly.h:2341
const FEBase *const & getFEFaceNeighbor(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current "neighbor" FE.
Definition Assembly.h:160
VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1557
void prepareResidual()
Sizes and zeroes the residual for the current element.
Definition Assembly.C:2776
void setCurrentLowerDElem(const Elem *const lower_d_elem)
Set the current lower dimensional element.
Definition Assembly.h:3262
bool needDual() const
Indicates whether dual shape functions are used (computation is now repeated on each element so expen...
Definition Assembly.h:619
void buildVectorFaceFE(FEType type) const
Build Vector FEs for a face with a type.
Definition Assembly.C:512
VectorVariablePhiValue _vector_phi_neighbor
Definition Assembly.h:2731
const MooseArray< Real > & JxWNeighbor() const
Returns the reference to the transformed jacobian weights on a current face.
Definition Assembly.C:260
bool _user_added_fe_neighbor_of_helper_type
Definition Assembly.h:2363
const MooseArray< Point > & qPointsFace() const
Returns the reference to the current quadrature being used.
Definition Assembly.h:335
VectorVariablePhiValue _vector_phi_face
Definition Assembly.h:2725
void reinitFEFace(const Elem *elem, unsigned int side)
Just an internal helper function to reinit the face FE objects.
Definition Assembly.C:1313
const MooseArray< ADReal > & adJxW() const
Definition Assembly.h:270
const MooseArray< Point > & qPointsFaceNeighbor() const
Returns the reference to the current quadrature points being used on the neighbor face.
Definition Assembly.h:535
std::map< unsigned int, FEBase * > _holder_fe_neighbor_helper
Each dimension's helper objects.
Definition Assembly.h:2551
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:4281
VectorVariablePhiSecond _vector_second_phi_face
Definition Assembly.h:2727
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:1850
const Elem *const & msmElem() const
Definition Assembly.h:1964
const libMesh::QBase *const & qRuleFace() const
Returns the reference to the current quadrature being used on a current face.
Definition Assembly.h:312
void reinitNeighborLowerDElem(const Elem *elem)
reinitialize a neighboring lower dimensional element
Definition Assembly.C:2451
void initNonlocalCoupling()
Create pair of variables requiring nonlocal jacobian contributions.
Definition Assembly.C:2717
MooseArray< ADReal > _ad_curvatures
Definition Assembly.h:2863
VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1520
const VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1451
const Real & neighborVolume()
Returns the reference to the current neighbor volume.
Definition Assembly.h:504
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFace(FEType type) const
Definition Assembly.h:1689
bool _need_ad_grad_phi
Whether any object needs the AD element shape function gradients.
Definition Assembly.h:2789
libMesh::QBase * _qrule_msm
A qrule object for working on mortar segement elements.
Definition Assembly.h:2585
unsigned int _max_cached_jacobians
Definition Assembly.h:2825
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition Assembly.h:2605
std::set< FEType > _need_div
Definition Assembly.h:2881
const FEBase *const & getFEFace(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current "face" FE.
Definition Assembly.h:148
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:2814
const MooseArray< Real > & JxWFace() const
Returns the reference to the transformed jacobian weights on a current face.
Definition Assembly.h:341
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data
Definition Assembly.h:2779
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1597
const VariablePhiGradient & gradPhi(const MooseVariableField< Real > &) const
Definition Assembly.h:1325
std::map< unsigned int, FEBase * > _holder_fe_helper
Each dimension's helper objects.
Definition Assembly.h:2405
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1606
MooseArray< Point > _current_q_points_face_neighbor
The current quadrature points on the neighbor face.
Definition Assembly.h:2564
std::vector< ADReal > _ad_dzetadz_map
Definition Assembly.h:2857
std::vector< ADReal > _ad_detady_map
Definition Assembly.h:2853
const Elem *const & sideElem() const
Returns the side element.
Definition Assembly.h:454
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhi(FEType type) const
Definition Assembly.h:1743
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kne
jacobian contributions from the neighbor and element <Tag, ivar, jvar>
Definition Assembly.h:2684
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition Assembly.h:2419
void zeroCachedJacobian(GlobalDataKey)
Zero out previously-cached Jacobian rows.
Definition Assembly.C:4562
void buildVectorDualLowerDFE(FEType type) const
Definition Assembly.C:450
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
Definition Assembly.h:227
const Elem * _current_neighbor_lower_d_elem
The current neighboring lower dimensional element.
Definition Assembly.h:2632
VariablePhiValue & phi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1575
libMesh::QBase * _current_qrule_lower
quadrature rule used on lower dimensional elements.
Definition Assembly.h:2591
const VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1357
void clearCachedResiduals(GlobalDataKey)
Clears all of the residuals in _cached_residual_rows and _cached_residual_values.
Definition Assembly.C:3551
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:4407
void computeCurrentElemVolume()
Definition Assembly.C:1799
const MooseArray< Real > & mortarCoordTransformation() const
Returns the reference to the coordinate transformation coefficients on the mortar segment mesh.
Definition Assembly.h:294
unsigned int _current_neighbor_side
The current side of the selected neighboring element (valid only when working with sides)
Definition Assembly.h:2613
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knl
dprimary/dlower (or dneighbor/dlower)
Definition Assembly.h:2696
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:3427
MooseArray< VectorValue< ADReal > > _ad_q_points_face
Definition Assembly.h:2861
void reinitMortarElem(const Elem *elem)
reinitialize a mortar segment mesh element in order to get a proper JxW
Definition Assembly.C:2472
std::vector< VectorValue< ADReal > > _ad_d2xyzdxi2_map
Definition Assembly.h:2843
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1610
const Elem * _current_elem
The current "element" we are currently on.
Definition Assembly.h:2595
std::map< unsigned int, FEBase * > _holder_fe_face_helper
Each dimension's helper objects.
Definition Assembly.h:2517
const VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1446
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face_neighbor
Definition Assembly.h:2548
const VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1417
VectorVariablePhiDivergence _vector_div_phi_face_neighbor
Definition Assembly.h:2741
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1593
void reinitNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Reinitializes the neighbor side using reference coordinates.
Definition Assembly.C:1732
const Elem * _msm_elem
Definition Assembly.h:2893
libMesh::QBase * _current_qrule_volume
The current volumetric quadrature for the element.
Definition Assembly.h:2411
void addJacobianNeighborLowerD(GlobalDataKey)
Add all portions of the Jacobian except PrimaryPrimary, e.g.
Definition Assembly.C:3996
std::map< FEType, FEVectorBase * > _current_vector_fe_neighbor
The "neighbor" vector fe object that matches the current elem.
Definition Assembly.h:2394
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1471
MooseArray< Real > _coord_msm
The coordinate transformation coefficients evaluated on the quadrature points of the mortar segment m...
Definition Assembly.h:2573
const FEVectorBase *const & getVectorFEFaceNeighbor(FEType type, unsigned int dim) const
GetVector a reference to a pointer that will contain the current "neighbor" FE.
Definition Assembly.h:208
Real _current_lower_d_elem_volume
The current lower dimensional element volume.
Definition Assembly.h:2636
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:3608
const VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1441
std::vector< std::vector< Real > > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition Assembly.h:2819
bool _user_added_fe_face_of_helper_type
Definition Assembly.h:2361
void clearCachedJacobian()
Clear any currently cached jacobians.
Definition Assembly.C:4572
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.
const Node *const & nodeNeighbor() const
Returns the reference to the neighboring node.
Definition Assembly.h:547
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_dual_lower
Definition Assembly.h:2769
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data
Shape function values, gradients, second derivatives for each FE type.
Definition Assembly.h:2764
std::vector< Point > _current_neighbor_ref_points
The current reference points on the neighbor element.
Definition Assembly.h:2914
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:3213
void copyNeighborShapes(MooseVariableField< T > &v)
Definition Assembly.C:3143
std::set< FEType > _need_second_derivative
Definition Assembly.h:2878
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiNeighbor(FEType type) const
Definition Assembly.h:1759
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:2908
std::vector< dof_id_type > _extra_elem_ids
Extra element IDs.
Definition Assembly.h:2536
void addCachedResiduals(GlobalDataKey, const std::vector< VectorTag > &tags)
Pushes all cached residuals to the global residual vectors associated with each tag.
Definition Assembly.C:3536
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face_neighbor
Definition Assembly.h:2767
bool _user_added_fe_lower_of_helper_type
Definition Assembly.h:2364
MooseArray< Real > _current_JxW_neighbor
The current transformed jacobian weights on a neighbor's face.
Definition Assembly.h:2568
std::vector< ADReal > _ad_dxidy_map
Definition Assembly.h:2850
unsigned int _mesh_dimension
Definition Assembly.h:2353
DenseVector< Number > _element_vector
A working vector to avoid repeated heap allocations when caching residuals that must have libMesh-lev...
Definition Assembly.h:2898
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1798
const VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1412
VariablePhiSecond _second_phi_face_neighbor
Definition Assembly.h:2716
VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1569
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:3599
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face
Definition Assembly.h:2765
const VariablePhiSecond & secondPhi() const
Definition Assembly.h:1326
const VariablePhiSecond & secondPhi(const MooseVariableField< Real > &) const
Definition Assembly.h:1327
const Elem *const & neighbor() const
Return the neighbor element.
Definition Assembly.h:466
void prepareOffDiagScalar()
Definition Assembly.C:3043
void prepareNonlocal()
Definition Assembly.C:2792
const SubdomainID & currentSubdomainID() const
Return the current subdomain ID.
Definition Assembly.h:415
const FEVectorBase *const & getVectorFEFace(FEType type, unsigned int dim) const
GetVector a reference to a pointer that will contain the current "face" FE.
Definition Assembly.h:196
void prepareVariable(MooseVariableFieldBase *var)
Used for preparing the dense residual and jacobian blocks for one particular variable.
Definition Assembly.C:2818
VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1468
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition Assembly.h:472
const VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1436
const VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1399
bool _need_dual
Whether dual shape functions need to be computed for mortar constraints.
Definition Assembly.h:2642
const MooseArray< ADReal > & adCoordTransformation() const
Returns the reference to the AD version of the coordinate transformation coefficients.
Definition Assembly.h:2918
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
forward declarations
Definition MooseArray.h:18
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Base variable class.
const libMesh::FEType & feType() const
Get the type of finite element object.
Class for stuff related to variables.
This class provides an interface for common operations on field variables of both FE and FV types wit...
Class for stuff related to variables.
Class for scalar variables (they are different).
The Kokkos assembly class.
A NodeFaceConstraint is used when you need to create constraints between two surfaces in a mesh.
Nonlinear system to be solved.
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79
Base class for a system (of equations)
Definition SystemBase.h:87
Storage for all of the information pretaining to a vector tag.
Definition VectorTag.h:18
This is the XFEMInterface class.
void resize(const unsigned int new_m, const unsigned int new_n)
void resize(const unsigned int n)
void constrain_element_matrix(DenseMatrix< Number > &matrix, std::vector< dof_id_type > &elem_dofs, bool asymmetric_constraint_rows=true) const
bool is_constrained_dof(const dof_id_type dof) const
void constrain_element_vector(DenseVector< Number > &rhs, std::vector< dof_id_type > &dofs, bool asymmetric_constraint_rows=true) const
auto raw_value(const Eigen::Map< T > &in)
ConstraintJacobianType
Definition MooseTypes.h:855
const SubdomainID ANY_BLOCK_ID
Definition MooseTypes.C:19
CoordinateSystemType
Definition MooseTypes.h:868
DGJacobianType
Definition MooseTypes.h:808
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
FEGenericBase< RealGradient > FEVectorBase
VectorValue< Real > RealVectorValue
Definition SubProblem.h:34
FEGenericBase< Real > FEBase
Data structure for tracking/grouping a set of quadrature rules for a particular dimensionality of mes...
Definition Assembly.h:2430
std::unique_ptr< ArbitraryQuadrature > arbitrary_vol
volume/elem (meshdim) custom points quadrature rule
Definition Assembly.h:2447
std::unique_ptr< ArbitraryQuadrature > neighbor
area/face (meshdim-1) custom points quadrature rule for DG
Definition Assembly.h:2451
std::unique_ptr< libMesh::QBase > fv_face
finite volume face/flux quadrature rule (meshdim-1)
Definition Assembly.h:2445
std::unique_ptr< libMesh::QBase > vol
volume/elem (meshdim) quadrature rule
Definition Assembly.h:2441
std::unique_ptr< ArbitraryQuadrature > arbitrary_face
area/face (meshdim-1) custom points quadrature rule
Definition Assembly.h:2449
std::unique_ptr< libMesh::QBase > face
area/face (meshdim-1) quadrature rule
Definition Assembly.h:2443