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
682 void reinitNeighborSurfaceElemRef(const Elem * neighbor_elem, const std::vector<Point> & pts);
683
687 void reinitDual(const Elem * elem, const std::vector<Point> & pts, const std::vector<Real> & JxW);
688
692 void reinitLowerDElem(const Elem * elem,
693 const std::vector<Point> * const pts = nullptr,
694 const std::vector<Real> * const weights = nullptr);
695
699 void reinitNeighborLowerDElem(const Elem * elem);
700
704 void reinitMortarElem(const Elem * elem);
705
709 const std::vector<Real> & jxWMortar() const { return *_JxW_msm; }
710
714 const libMesh::QBase * const & qRuleMortar() const { return constify_ref(_qrule_msm); }
715
716private:
720 void computeADFace(const Elem & elem, const unsigned int side);
721
722public:
726 void reinitAtPhysical(const Elem * elem, const std::vector<Point> & physical_points);
727
731 void reinit(const Elem * elem, const std::vector<Point> & reference_points);
732
736 void setFaceQRule(const Elem * const elem, const unsigned int side);
737
741 void reinit(const Elem * elem, unsigned int side);
742
746 void reinit(const Elem * elem, unsigned int side, const std::vector<Point> & reference_points);
747
748 void reinitFVFace(const FaceInfo & fi);
749
761 void reinitElemAndNeighbor(const Elem * elem,
762 unsigned int side,
763 const Elem * neighbor,
764 unsigned int neighbor_side,
765 const std::vector<Point> * neighbor_reference_points = nullptr);
766
770 void reinitNeighborAtPhysical(const Elem * neighbor,
771 unsigned int neighbor_side,
772 const std::vector<Point> & physical_points);
773
777 void reinitNeighborAtPhysical(const Elem * neighbor, const std::vector<Point> & physical_points);
778
782 void reinitNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
783
787 void reinit(const Node * node);
788
793
796
799
801 void prepareResidual();
802
803 void prepare();
804 void prepareNonlocal();
805
813 void prepareNeighbor();
814
819 void prepareLowerD();
820
821 void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector<dof_id_type> & dof_indices);
822 void prepareBlockNonlocal(unsigned int ivar,
823 unsigned jvar,
824 const std::vector<dof_id_type> & idof_indices,
825 const std::vector<dof_id_type> & jdof_indices);
826 void prepareScalar();
828
829 template <typename T>
831 void copyShapes(unsigned int var);
832
833 template <typename T>
835 void copyFaceShapes(unsigned int var);
836
837 template <typename T>
839 void copyNeighborShapes(unsigned int var);
840
847 {
848 // Blessed classes
849 friend class Assembly;
850 friend class SubProblem;
851 friend class FEProblemBase;
852 friend class DisplacedProblem;
857 };
858
865 {
866 // Blessed classes
867 friend class Assembly;
868 friend class TaggingInterface;
871 };
872
877 void addResidual(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
882 void addResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
887 void addResidualLower(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
888
893 void addResidualScalar(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
894
899 void cacheResidual(GlobalDataKey, const std::vector<VectorTag> & tags);
900
905 void cacheResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & tags);
906
910 void cacheResidualLower(GlobalDataKey, const std::vector<VectorTag> & tags);
911
917 void addCachedResiduals(GlobalDataKey, const std::vector<VectorTag> & tags);
918
927 void clearCachedResiduals(GlobalDataKey);
928
936 void addCachedResidualDirectly(NumericVector<Number> & residual,
937 GlobalDataKey,
938 const VectorTag & vector_tag);
939
943 void setResidual(NumericVector<Number> & residual, GlobalDataKey, const VectorTag & vector_tag);
944
948 void setResidualNeighbor(NumericVector<Number> & residual,
949 GlobalDataKey,
950 const VectorTag & vector_tag);
951
955 void addJacobian(GlobalDataKey);
956
960 void addJacobianNonlocal(GlobalDataKey);
961
966 void addJacobianNeighbor(GlobalDataKey);
967
971 void addJacobianScalar(GlobalDataKey);
972
977 void addJacobianOffDiagScalar(unsigned int ivar, GlobalDataKey);
978
983 unsigned int ivar,
984 unsigned int jvar,
985 const libMesh::DofMap & dof_map,
986 std::vector<dof_id_type> & dof_indices,
988 TagID tag);
989
995 unsigned int ivar,
996 unsigned int jvar,
997 const libMesh::DofMap & dof_map,
998 std::vector<dof_id_type> & dof_indices,
1000 const std::set<TagID> & tags);
1001
1006 unsigned int ivar,
1007 unsigned int jvar,
1008 const libMesh::DofMap & dof_map,
1009 const std::vector<dof_id_type> & idof_indices,
1010 const std::vector<dof_id_type> & jdof_indices,
1012 TagID tag);
1013
1018 unsigned int ivar,
1019 unsigned int jvar,
1020 const libMesh::DofMap & dof_map,
1021 const std::vector<dof_id_type> & idof_indices,
1022 const std::vector<dof_id_type> & jdof_indices,
1024 const std::set<TagID> & tags);
1025
1035
1042
1052
1058 unsigned int ivar,
1059 unsigned int jvar,
1060 const libMesh::DofMap & dof_map,
1061 std::vector<dof_id_type> & dof_indices,
1062 std::vector<dof_id_type> & neighbor_dof_indices,
1064 TagID tag);
1065
1071 unsigned int ivar,
1072 unsigned int jvar,
1073 const libMesh::DofMap & dof_map,
1074 std::vector<dof_id_type> & dof_indices,
1075 std::vector<dof_id_type> & neighbor_dof_indices,
1077 const std::set<TagID> & tags);
1078
1083
1088
1094
1102
1107
1112
1117 DenseVector<Number> & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
1118 {
1119 return _sub_Re[tag_id][var_num];
1120 }
1121
1126 DenseVector<Number> & residualBlockNeighbor(unsigned int var_num, LocalDataKey, TagID tag_id)
1127 {
1128 return _sub_Rn[tag_id][var_num];
1129 }
1130
1135 DenseVector<Number> & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
1136 {
1137 return _sub_Rl[tag_id][var_num];
1138 }
1139
1144 DenseMatrix<Number> & jacobianBlock(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1145 {
1146 jacobianBlockUsed(tag, ivar, jvar, true);
1147 return _sub_Kee[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1148 }
1149
1154 DenseMatrix<Number> &
1155 jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1156 {
1157 jacobianBlockNonlocalUsed(tag, ivar, jvar, true);
1158 return _sub_Keg[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1159 }
1160
1165 DenseMatrix<Number> & jacobianBlockNeighbor(
1166 Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag);
1167
1175 DenseMatrix<Number> & jacobianBlockMortar(Moose::ConstraintJacobianType type,
1176 unsigned int ivar,
1177 unsigned int jvar,
1178 LocalDataKey,
1179 TagID tag);
1180
1185 void cacheResidualNodes(const DenseVector<Number> & res,
1186 const std::vector<dof_id_type> & dof_index,
1187 LocalDataKey,
1188 TagID tag);
1189
1201 void
1202 cacheJacobian(numeric_index_type i, numeric_index_type j, Real value, LocalDataKey, TagID tag);
1203
1215 void cacheJacobian(numeric_index_type i,
1216 numeric_index_type j,
1217 Real value,
1218 LocalDataKey,
1219 const std::set<TagID> & tags);
1220
1228 void cacheJacobianBlock(const DenseMatrix<Number> & jac_block,
1229 const std::vector<dof_id_type> & idof_indices,
1230 const std::vector<dof_id_type> & jdof_indices,
1231 Real scaling_factor,
1232 LocalDataKey,
1233 const std::set<TagID> & tags);
1234
1244 template <typename Residuals, typename Indices>
1245 void cacheResiduals(const Residuals & residuals,
1246 const Indices & row_indices,
1247 Real scaling_factor,
1248 LocalDataKey,
1249 const std::set<TagID> & vector_tags);
1250
1258 template <typename Residuals, typename Indices>
1259 void cacheJacobian(const Residuals & residuals,
1260 const Indices & row_indices,
1261 Real scaling_factor,
1262 LocalDataKey,
1263 const std::set<TagID> & matrix_tags);
1264
1275 template <typename Residuals, typename Indices>
1276 void cacheResidualsWithoutConstraints(const Residuals & residuals,
1277 const Indices & row_indices,
1278 Real scaling_factor,
1279 LocalDataKey,
1280 const std::set<TagID> & vector_tags);
1281
1289 template <typename Residuals, typename Indices>
1290 void cacheJacobianWithoutConstraints(const Residuals & residuals,
1291 const Indices & row_indices,
1292 Real scaling_factor,
1293 LocalDataKey,
1294 const std::set<TagID> & matrix_tags);
1295
1296 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> & couplingEntries()
1297 {
1298 return _cm_ff_entry;
1299 }
1300 const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1302 {
1303 return _cm_ff_entry;
1304 }
1305 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1307 {
1308 return _cm_nonlocal_entry;
1309 }
1310 const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> &
1312 {
1313 return _cm_fs_entry;
1314 }
1315 const std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> &
1317 {
1318 return _cm_sf_entry;
1319 }
1320
1321 // Read-only references
1322 const VariablePhiValue & phi() const { return _phi; }
1323 template <typename T>
1325 {
1326 _need_ad_grad_phi = true;
1327 return _ad_grad_phi_data.at(v.feType());
1328 }
1329 const VariablePhiValue & phi(const MooseVariableField<Real> &) const { return _phi; }
1330 const VariablePhiGradient & gradPhi() const { return _grad_phi; }
1332 const VariablePhiSecond & secondPhi() const { return _second_phi; }
1334 {
1335 return _second_phi;
1336 }
1337
1338 const VariablePhiValue & phiFace() const { return _phi_face; }
1342 {
1343 return _grad_phi_face;
1344 }
1346 {
1347 return _second_phi_face;
1348 }
1349
1351 {
1352 return _phi_neighbor;
1353 }
1355 {
1356 return _grad_phi_neighbor;
1357 }
1362
1364 {
1365 return _phi_face_neighbor;
1366 }
1375
1377 {
1378 return _vector_phi;
1379 }
1396
1417
1441
1456 const VectorVariablePhiCurl &
1466
1467 // Writeable references
1471
1475
1485
1498
1499 // Writeable references with vector variable
1517
1538
1579
1580 // Writeable references with array variable
1584
1594
1607
1620
1621 template <typename OutputType>
1622 const typename OutputTools<OutputType>::VariablePhiValue & fePhi(FEType type) const
1623 {
1624 buildFE(type);
1625 return _fe_shape_data[type]->_phi;
1626 }
1627
1628 template <typename OutputType>
1630 {
1631 buildFE(type);
1632 return _fe_shape_data[type]->_grad_phi;
1633 }
1634
1635 template <typename OutputType>
1637 {
1638 return _ad_grad_phi_data[type];
1639 }
1640
1641 template <typename OutputType>
1643 {
1644 _need_second_derivative.insert(type);
1645 buildFE(type);
1646 return _fe_shape_data[type]->_second_phi;
1647 }
1648
1649 template <typename OutputType>
1650 const typename OutputTools<OutputType>::VariablePhiValue & fePhiLower(FEType type) const;
1651
1652 template <typename OutputType>
1653 const typename OutputTools<OutputType>::VariablePhiValue & feDualPhiLower(FEType type) const;
1654
1655 template <typename OutputType>
1656 const typename OutputTools<OutputType>::VariablePhiGradient & feGradPhiLower(FEType type) const;
1657
1658 template <typename OutputType>
1660 feGradDualPhiLower(FEType type) const;
1661
1662 template <typename OutputType>
1663 const typename OutputTools<OutputType>::VariablePhiValue & fePhiFace(FEType type) const
1664 {
1665 buildFaceFE(type);
1666 return _fe_shape_data_face[type]->_phi;
1667 }
1668
1669 template <typename OutputType>
1671 {
1672 buildFaceFE(type);
1673 return _fe_shape_data_face[type]->_grad_phi;
1674 }
1675
1676 template <typename OutputType>
1678 {
1679 return _ad_grad_phi_data_face[type];
1680 }
1681
1687
1692 void needADGradPhi() const { _need_ad_grad_phi = true; }
1693
1694 template <typename OutputType>
1696 {
1697 _need_second_derivative.insert(type);
1698 buildFaceFE(type);
1699 return _fe_shape_data_face[type]->_second_phi;
1700 }
1701
1702 template <typename OutputType>
1704 {
1705 buildNeighborFE(type);
1706 return _fe_shape_data_neighbor[type]->_phi;
1707 }
1708
1709 template <typename OutputType>
1711 {
1712 buildNeighborFE(type);
1713 return _fe_shape_data_neighbor[type]->_grad_phi;
1714 }
1715
1716 template <typename OutputType>
1718 {
1720 buildNeighborFE(type);
1721 return _fe_shape_data_neighbor[type]->_second_phi;
1722 }
1723
1724 template <typename OutputType>
1726 {
1727 buildFaceNeighborFE(type);
1728 return _fe_shape_data_face_neighbor[type]->_phi;
1729 }
1730
1731 template <typename OutputType>
1733 feGradPhiFaceNeighbor(FEType type) const
1734 {
1735 buildFaceNeighborFE(type);
1736 return _fe_shape_data_face_neighbor[type]->_grad_phi;
1737 }
1738
1739 template <typename OutputType>
1741 feSecondPhiFaceNeighbor(FEType type) const
1742 {
1744 buildFaceNeighborFE(type);
1745 return _fe_shape_data_face_neighbor[type]->_second_phi;
1746 }
1747
1748 template <typename OutputType>
1749 const typename OutputTools<OutputType>::VariablePhiCurl & feCurlPhi(FEType type) const
1750 {
1751 _need_curl.insert(type);
1752 buildFE(type);
1753 return _fe_shape_data[type]->_curl_phi;
1754 }
1755
1756 template <typename OutputType>
1758 {
1759 _need_curl.insert(type);
1760 buildFaceFE(type);
1761 return _fe_shape_data_face[type]->_curl_phi;
1762 }
1763
1764 template <typename OutputType>
1766 {
1767 _need_curl.insert(type);
1768 buildNeighborFE(type);
1769 return _fe_shape_data_neighbor[type]->_curl_phi;
1770 }
1771
1772 template <typename OutputType>
1774 {
1775 _need_curl.insert(type);
1776 buildFaceNeighborFE(type);
1777 return _fe_shape_data_face_neighbor[type]->_curl_phi;
1778 }
1779
1780 template <typename OutputType>
1782 {
1783 buildFE(type);
1784 return _fe_shape_data[type]->_div_phi;
1785 }
1786
1787 template <typename OutputType>
1789 {
1790 buildFaceFE(type);
1791 return _fe_shape_data_face[type]->_div_phi;
1792 }
1793
1794 template <typename OutputType>
1796 feDivPhiNeighbor(FEType type) const
1797 {
1798 buildNeighborFE(type);
1799 return _fe_shape_data_neighbor[type]->_div_phi;
1800 }
1801
1802 template <typename OutputType>
1804 feDivPhiFaceNeighbor(FEType type) const
1805 {
1806 buildFaceNeighborFE(type);
1807 return _fe_shape_data_face_neighbor[type]->_div_phi;
1808 }
1809
1811 Real elementVolume(const Elem * elem) const;
1812
1816 void setXFEM(std::shared_ptr<XFEMInterface> xfem) { _xfem = xfem; }
1817
1822 std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions);
1823
1832 void saveLocalArrayResidual(DenseVector<Number> & re,
1833 unsigned int i,
1834 unsigned int ntest,
1835 const RealEigenVector & v) const
1836 {
1837 for (unsigned int j = 0; j < v.size(); ++j, i += ntest)
1838 re(i) += v(j);
1839 }
1840
1841 void saveLocalADArray(std::vector<ADReal> & re,
1842 unsigned int i,
1843 unsigned int ntest,
1844 const ADRealEigenVector & v) const;
1845
1856 void saveDiagLocalArrayJacobian(DenseMatrix<Number> & ke,
1857 unsigned int i,
1858 unsigned int ntest,
1859 unsigned int j,
1860 unsigned int nphi,
1861 unsigned int ivar,
1862 const RealEigenVector & v) const
1863 {
1864 unsigned int pace = (_component_block_diagonal[ivar] ? 0 : nphi);
1865 for (unsigned int k = 0; k < v.size(); ++k, i += ntest, j += pace)
1866 ke(i, j) += v(k);
1867 }
1868
1881 void saveFullLocalArrayJacobian(DenseMatrix<Number> & ke,
1882 unsigned int i,
1883 unsigned int ntest,
1884 unsigned int j,
1885 unsigned int nphi,
1886 unsigned int ivar,
1887 unsigned int jvar,
1888 const RealEigenMatrix & v) const
1889 {
1890 if (ivar == jvar && _component_block_diagonal[ivar])
1891 {
1892 for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1893 ke(i, j) += v(k, k);
1894 }
1895 else
1896 {
1897 const unsigned int saved_j = j;
1898 for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1899 {
1900 j = saved_j;
1901 for (unsigned int l = 0; l < v.cols(); ++l, j += nphi)
1902 ke(i, j) += v(k, l);
1903 }
1904 }
1905 }
1906
1907 DenseVector<Real> getJacobianDiagonal(const DenseMatrix<Number> & ke)
1908 {
1909 unsigned int rows = ke.m();
1910 unsigned int cols = ke.n();
1911 DenseVector<Real> diag(rows);
1912 for (unsigned int i = 0; i < rows; i++)
1913 // % operation is needed to account for cases of no component coupling of array variables
1914 diag(i) = ke(i, i % cols);
1915 return diag;
1916 }
1917
1923 inline const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase & fe)
1924 {
1925 auto qrule = qrules(dim).vol.get();
1926 fe.attach_quadrature_rule(qrule);
1927 return qrule;
1928 }
1929
1935 inline const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase & fe)
1936 {
1937 auto qrule = qrules(dim).face.get();
1938 fe.attach_quadrature_rule(qrule);
1939 return qrule;
1940 }
1941
1950 void modifyArbitraryWeights(const std::vector<Real> & weights);
1951
1956
1961
1966
1970 const Elem * const & msmElem() const { return _msm_elem; }
1971
1976 void preparePRefinement();
1977
1981 void setCurrentLowerDElem(const Elem * const lower_d_elem);
1982
1983private:
1989 void reinitFE(const Elem * elem);
1990
1997 void reinitFEFace(const Elem * elem, unsigned int side);
1998
1999 void computeFaceMap(const Elem & elem, const unsigned int side, const std::vector<Real> & qw);
2000
2001 void reinitFEFaceNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
2002
2003 void reinitFENeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
2004
2005 template <typename Points, typename Coords>
2007 const Points & q_points,
2008 Coords & coord,
2009 SubdomainID sub_id);
2010
2012
2014
2016
2022 void modifyWeightsDueToXFEM(const Elem * elem);
2023
2030 void modifyFaceWeightsDueToXFEM(const Elem * elem, unsigned int side = 0);
2031
2036 template <typename OutputType>
2037 void computeGradPhiAD(const Elem * elem,
2038 unsigned int n_qp,
2041
2045 void resizeADMappingObjects(unsigned int n_qp, unsigned int dim);
2046
2051 void
2052 computeSinglePointMapAD(const Elem * elem, const std::vector<Real> & qw, unsigned p, FEBase * fe);
2053
2061 void computeADElemNodePoints(const Elem & elem, bool do_derivatives);
2062
2066 void addResidual(const VectorTag & vector_tag);
2070 void addResidualNeighbor(const VectorTag & vector_tag);
2075 void addResidualLower(const VectorTag & vector_tag);
2079 void addResidualScalar(const VectorTag & vector_tag);
2080
2084 void clearCachedResiduals(const VectorTag & vector_tag);
2085
2094 void cacheResidual(dof_id_type dof, Real value, TagID tag_id);
2095
2104 void cacheResidual(dof_id_type dof, Real value, const std::set<TagID> & tags);
2105
2110 void processLocalResidual(DenseVector<Number> & res_block,
2111 std::vector<dof_id_type> & dof_indices,
2112 const std::vector<Real> & scaling_factor);
2113
2117 void addResidualBlock(NumericVector<Number> & residual,
2118 DenseVector<Number> & res_block,
2119 const std::vector<dof_id_type> & dof_indices,
2120 const std::vector<Real> & scaling_factor);
2121
2125 void cacheResidualBlock(std::vector<Real> & cached_residual_values,
2126 std::vector<dof_id_type> & cached_residual_rows,
2127 DenseVector<Number> & res_block,
2128 const std::vector<dof_id_type> & dof_indices,
2129 const std::vector<Real> & scaling_factor);
2130
2134 void setResidualBlock(NumericVector<Number> & residual,
2135 DenseVector<Number> & res_block,
2136 const std::vector<dof_id_type> & dof_indices,
2137 const std::vector<Real> & scaling_factor);
2138
2143 DenseMatrix<Number> & jac_block,
2144 const MooseVariableBase & ivar,
2145 const MooseVariableBase & jvar,
2146 const std::vector<dof_id_type> & idof_indices,
2147 const std::vector<dof_id_type> & jdof_indices);
2148
2152 void cacheJacobianBlock(const DenseMatrix<Number> & jac_block,
2153 const MooseVariableBase & ivar,
2154 const MooseVariableBase & jvar,
2155 const std::vector<dof_id_type> & idof_indices,
2156 const std::vector<dof_id_type> & jdof_indices,
2157 TagID tag);
2158
2162 void cacheJacobianBlockNonzero(const DenseMatrix<Number> & jac_block,
2163 const MooseVariableBase & ivar,
2164 const MooseVariableBase & jvar,
2165 const std::vector<dof_id_type> & idof_indices,
2166 const std::vector<dof_id_type> & jdof_indices,
2167 TagID tag);
2168
2172 void addJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2173
2177 void cacheJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2178
2184 void clearCachedJacobian();
2185
2190 void buildFE(FEType type) const;
2191
2196 void buildFaceFE(FEType type) const;
2197
2202 void buildNeighborFE(FEType type) const;
2203
2208 void buildFaceNeighborFE(FEType type) const;
2209
2214 void buildLowerDFE(FEType type) const;
2215
2216 void buildLowerDDualFE(FEType type) const;
2217
2222 void buildVectorFE(FEType type) const;
2223
2228 void buildVectorFaceFE(FEType type) const;
2229
2234 void buildVectorNeighborFE(FEType type) const;
2235
2240 void buildVectorFaceNeighborFE(FEType type) const;
2241
2246 void buildVectorLowerDFE(FEType type) const;
2247 void buildVectorDualLowerDFE(FEType type) const;
2248
2253 void jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2254 {
2255 _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2256 }
2257
2262 char jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2263 {
2264 return _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2265 }
2266
2271 void jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2272 {
2273 _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2274 }
2275
2280 char jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2281 {
2282 return _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2283 }
2284
2289 void jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2290 {
2291 _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2292 }
2293
2298 char jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2299 {
2300 return _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2301 }
2302
2307 void jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2308 {
2309 _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2310 }
2311
2316 char jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2317 {
2318 return _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2319 }
2320
2324 void helpersRequestData();
2325
2328
2329 const bool _displaced;
2330
2334
2337
2340
2343
2345 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_ff_entry;
2347 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> _cm_fs_entry;
2349 std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> _cm_sf_entry;
2351 std::vector<std::pair<MooseVariableScalar *, MooseVariableScalar *>> _cm_ss_entry;
2353 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_nonlocal_entry;
2355 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_used;
2356 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_nonlocal_used;
2358 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_neighbor_used;
2360 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_lower_used;
2365
2367
2368 unsigned int _mesh_dimension;
2369
2372 const FEType _helper_type;
2373
2380
2383 std::vector<std::unique_ptr<FEBase>> _unique_fe_helper;
2384 std::vector<std::unique_ptr<FEBase>> _unique_fe_face_helper;
2385 std::vector<std::unique_ptr<FEBase>> _unique_fe_face_neighbor_helper;
2386 std::vector<std::unique_ptr<FEBase>> _unique_fe_neighbor_helper;
2387 std::vector<std::unique_ptr<FEBase>> _unique_fe_lower_helper;
2388
2391
2393 std::shared_ptr<XFEMInterface> _xfem;
2394
2396 std::map<FEType, FEBase *> _current_fe;
2398 std::map<FEType, FEBase *> _current_fe_face;
2400 std::map<FEType, FEBase *> _current_fe_neighbor;
2402 std::map<FEType, FEBase *> _current_fe_face_neighbor;
2403
2405 std::map<FEType, FEVectorBase *> _current_vector_fe;
2407 std::map<FEType, FEVectorBase *> _current_vector_fe_face;
2409 std::map<FEType, FEVectorBase *> _current_vector_fe_neighbor;
2411 std::map<FEType, FEVectorBase *> _current_vector_fe_face_neighbor;
2412
2413 /**** Volume Stuff ****/
2414
2416 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe;
2418 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe;
2420 std::map<unsigned int, FEBase *> _holder_fe_helper;
2441
2444 struct QRules
2445 {
2447 : vol(nullptr),
2448 face(nullptr),
2449 arbitrary_vol(nullptr),
2450 arbitrary_face(nullptr),
2451 neighbor(nullptr)
2452 {
2453 }
2454
2456 std::unique_ptr<libMesh::QBase> vol;
2458 std::unique_ptr<libMesh::QBase> face;
2460 std::unique_ptr<libMesh::QBase> fv_face;
2462 std::unique_ptr<ArbitraryQuadrature> arbitrary_vol;
2464 std::unique_ptr<ArbitraryQuadrature> arbitrary_face;
2466 std::unique_ptr<ArbitraryQuadrature> neighbor;
2467 };
2468
2473 std::unordered_map<SubdomainID, std::vector<QRules>> _qrules;
2474
2481 libMesh::QBase * qruleFace(const Elem * elem, unsigned int side);
2482 ArbitraryQuadrature * qruleArbitraryFace(const Elem * elem, unsigned int side);
2483
2484 template <typename T>
2485 T * qruleFaceHelper(const Elem * elem, unsigned int side, std::function<T *(QRules &)> rule_fn)
2486 {
2487 auto dim = elem->dim();
2488 auto neighbor = elem->neighbor_ptr(side);
2489 auto q = rule_fn(qrules(dim, elem->subdomain_id()));
2490 if (!neighbor)
2491 return q;
2492
2493 // find the maximum face quadrature order for all blocks the face is in
2494 auto neighbor_block = neighbor->subdomain_id();
2495 if (neighbor_block == elem->subdomain_id())
2496 return q;
2497
2498 auto q_neighbor = rule_fn(qrules(dim, neighbor_block));
2499 if (q->get_order() > q_neighbor->get_order())
2500 return q;
2501 return q_neighbor;
2502 }
2503
2504 inline QRules & qrules(unsigned int dim) { return qrules(dim, _current_subdomain_id); }
2505
2509 inline QRules & qrules(unsigned int dim, SubdomainID block)
2510 {
2511 if (_qrules.find(block) == _qrules.end())
2512 {
2513 mooseAssert(_qrules.find(Moose::ANY_BLOCK_ID) != _qrules.end(),
2514 "missing quadrature rules for specified block");
2515 mooseAssert(_qrules[Moose::ANY_BLOCK_ID].size() > dim,
2516 "quadrature rules not sized property for dimension");
2518 }
2519 mooseAssert(_qrules.find(block) != _qrules.end(),
2520 "missing quadrature rules for specified block");
2521 mooseAssert(_qrules[block].size() > dim, "quadrature rules not sized property for dimension");
2522 return _qrules[block][dim];
2523 }
2524
2525 /**** Face Stuff ****/
2526
2528 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face;
2530 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face;
2532 std::map<unsigned int, FEBase *> _holder_fe_face_helper;
2546 std::vector<Eigen::Map<RealDIMValue>> _mapped_normals;
2549
2551 std::vector<dof_id_type> _extra_elem_ids;
2553 std::vector<dof_id_type> _neighbor_extra_elem_ids;
2555 std::map<unsigned int, const std::vector<Point> *> _holder_normals;
2556
2557 /**** Neighbor Stuff ****/
2558
2560 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_neighbor;
2561 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face_neighbor;
2562 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_neighbor;
2563 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face_neighbor;
2564
2566 std::map<unsigned int, FEBase *> _holder_fe_neighbor_helper;
2567 std::map<unsigned int, FEBase *> _holder_fe_face_neighbor_helper;
2568
2570 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_lower;
2572 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_lower;
2574 std::map<unsigned int, FEBase *> _holder_fe_lower_helper;
2575
2589
2590 /********** mortar stuff *************/
2591
2593 const std::vector<Real> * _JxW_msm;
2595 std::unique_ptr<FEBase> _fe_msm;
2603
2607
2608protected:
2610 const Elem * _current_elem;
2618 unsigned int _current_side;
2636 const Node * _current_node;
2643
2658
2661
2662 /*
2663 * Residual contributions <tag_index, ivar>
2664 *
2665 * tag_index is the index into _residual_vector_tags, that is, _sub_Re[0] corresponds to the tag
2666 * with TagID _residual_vector_tags[0]._id
2667 *
2668 * When ivar corresponds to an array variable, the dense vector is in size of ndof * count,
2669 * where count is the number of components of the array variable. The local residual is ordered
2670 * as (r_i,j, i = 1,...,ndof; j = 1,...,count).
2671 *
2672 * Dense vectors for variables (ivar+i, i = 1,...,count) are empty.
2673 */
2674 std::vector<std::vector<DenseVector<Number>>> _sub_Re;
2675 std::vector<std::vector<DenseVector<Number>>> _sub_Rn;
2677 std::vector<std::vector<DenseVector<Number>>> _sub_Rl;
2678
2680 DenseVector<Number> _tmp_Re;
2681
2682 /*
2683 * Jacobian contributions <Tag, ivar, jvar>
2684 * When ivar corresponds to an array variable, the number of rows of the dense matrix is in size
2685 * of indof * icount, where icount is the number of components of ivar. When jvar corresponds to
2686 * an array variable, the number of columns of the dense matrix is in size of jndof * jcount,
2687 * where jcount is the number of components of jvar. The local residual is ordered as
2688 * (K_(i,j,k,l), k=1,...,jndof; l = 1,...,jcout; i = 1,...,indof; j = 1,...,icount).
2689 *
2690 * Dense matrices for variables (ivar+i, i = 1,...,icount) or (jvar+j, j = 1,...,jcount) are
2691 * empty.
2692 */
2693 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kee;
2694 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Keg;
2695
2697 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Ken;
2699 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kne;
2701 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knn;
2703 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kll;
2705 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kle;
2707 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kln;
2709 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kel;
2711 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knl;
2712
2714 DenseMatrix<Number> _tmp_Ke;
2715
2716 // Shape function values, gradients. second derivatives
2720
2724
2728
2732
2733 // Shape function values, gradients, second derivatives
2739
2745
2751
2757
2767
2777
2779 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data;
2780 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face;
2781 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_neighbor;
2782 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face_neighbor;
2783 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_lower;
2784 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_dual_lower;
2785
2787 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data;
2788 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face;
2789 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_neighbor;
2790 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face_neighbor;
2791 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_lower;
2792 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_dual_lower;
2793
2794 mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data;
2795 mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>> _ad_vector_grad_phi_data;
2796 mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data_face;
2797 mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>>
2802 mutable bool _need_ad_grad_phi_face = false;
2804 mutable bool _need_ad_grad_phi = false;
2809 mutable bool _need_ad_volume_map = false;
2812 mutable bool _need_ad_face_map = false;
2813
2823 const std::vector<VectorTag> & _residual_vector_tags;
2824
2826 std::vector<std::vector<Real>> _cached_residual_values;
2827
2829 std::vector<std::vector<dof_id_type>> _cached_residual_rows;
2830
2832
2834 std::vector<std::vector<Real>> _cached_jacobian_values;
2836 std::vector<std::vector<dof_id_type>> _cached_jacobian_rows;
2838 std::vector<std::vector<dof_id_type>> _cached_jacobian_cols;
2839
2841
2846 std::vector<bool> _component_block_diagonal;
2847
2849 std::vector<dof_id_type> _temp_dof_indices;
2850
2852 std::vector<Point> _temp_reference_points;
2853
2855 std::vector<VectorValue<ADReal>> _ad_dxyzdxi_map;
2856 std::vector<VectorValue<ADReal>> _ad_dxyzdeta_map;
2857 std::vector<VectorValue<ADReal>> _ad_dxyzdzeta_map;
2858 std::vector<VectorValue<ADReal>> _ad_d2xyzdxi2_map;
2859 std::vector<VectorValue<ADReal>> _ad_d2xyzdxideta_map;
2860 std::vector<VectorValue<ADReal>> _ad_d2xyzdeta2_map;
2861 std::vector<ADReal> _ad_jac;
2864 std::vector<ADReal> _ad_dxidx_map;
2865 std::vector<ADReal> _ad_dxidy_map;
2866 std::vector<ADReal> _ad_dxidz_map;
2867 std::vector<ADReal> _ad_detadx_map;
2868 std::vector<ADReal> _ad_detady_map;
2869 std::vector<ADReal> _ad_detadz_map;
2870 std::vector<ADReal> _ad_dzetadx_map;
2871 std::vector<ADReal> _ad_dzetady_map;
2872 std::vector<ADReal> _ad_dzetadz_map;
2873
2879
2883 std::vector<std::pair<unsigned int, unsigned short>> _disp_numbers_and_directions;
2884
2886 std::vector<VectorValue<ADReal>> _ad_elem_node_points;
2888 std::vector<dof_id_type> _ad_elem_disp_dof_indices;
2889 std::vector<Number> _ad_elem_disp_unit_soln;
2890 std::vector<Number> _ad_elem_disp_nodal_soln;
2891
2892 mutable bool _calculate_xyz;
2895
2899
2900 mutable std::set<FEType> _need_second_derivative;
2901 mutable std::set<FEType> _need_second_derivative_neighbor;
2902 mutable std::set<FEType> _need_curl;
2903 mutable std::set<FEType> _need_div;
2904 mutable std::set<FEType> _need_face_div;
2905 mutable std::set<FEType> _need_neighbor_div;
2906 mutable std::set<FEType> _need_face_neighbor_div;
2907
2914
2915 const Elem * _msm_elem = nullptr;
2916
2920 DenseVector<Number> _element_vector;
2921
2925 DenseMatrix<Number> _element_matrix;
2926
2930 std::vector<dof_id_type> _row_indices, _column_indices;
2931
2934
2937};
2938
2939inline const MooseArray<ADReal> &
2941{
2942 // Coord values for non-cartesian coordinate systems are functions of the locations of the
2943 // quadrature points in physical space. We also have no way of knowing whether this was called
2944 // from a volumetric or face object so we should set both volumetric and face xyz to true
2945 _calculate_xyz = true;
2946 _calculate_face_xyz = true;
2947 _need_ad_volume_map = true;
2948 _need_ad_face_map = true;
2949
2950 _calculate_ad_coord = true;
2951 return _ad_coord;
2952}
2953
2954template <typename OutputType>
2956Assembly::fePhiLower(FEType type) const
2957{
2958 buildLowerDFE(type);
2959 return _fe_shape_data_lower[type]->_phi;
2960}
2961
2962template <typename OutputType>
2965{
2966 buildLowerDDualFE(type);
2967 return _fe_shape_data_dual_lower[type]->_phi;
2968}
2969
2970template <typename OutputType>
2973{
2974 buildLowerDFE(type);
2975 return _fe_shape_data_lower[type]->_grad_phi;
2976}
2977
2978template <typename OutputType>
2981{
2982 buildLowerDDualFE(type);
2983 return _fe_shape_data_dual_lower[type]->_grad_phi;
2984}
2985
2986template <>
2988Assembly::feADGradPhi<RealVectorValue>(FEType type) const
2989{
2990 return _ad_vector_grad_phi_data[type];
2991}
2992
2993template <>
2995Assembly::feADGradPhiFace<RealVectorValue>(FEType type) const
2996{
2997 return _ad_vector_grad_phi_data_face[type];
2998}
2999
3000template <>
3002Assembly::fePhi<VectorValue<Real>>(FEType type) const;
3003
3004template <>
3006Assembly::feGradPhi<VectorValue<Real>>(FEType type) const;
3007
3008template <>
3010Assembly::feSecondPhi<VectorValue<Real>>(FEType type) const;
3011
3012template <>
3014Assembly::fePhiLower<VectorValue<Real>>(FEType type) const;
3015
3016template <>
3018Assembly::feDualPhiLower<VectorValue<Real>>(FEType type) const;
3019
3020template <>
3022Assembly::feGradPhiLower<VectorValue<Real>>(FEType type) const;
3023
3024template <>
3026Assembly::feGradDualPhiLower<VectorValue<Real>>(FEType type) const;
3027
3028template <>
3030Assembly::fePhiFace<VectorValue<Real>>(FEType type) const;
3031
3032template <>
3034Assembly::feGradPhiFace<VectorValue<Real>>(FEType type) const;
3035
3036template <>
3038Assembly::feSecondPhiFace<VectorValue<Real>>(FEType type) const;
3039
3040template <>
3042Assembly::fePhiNeighbor<VectorValue<Real>>(FEType type) const;
3043
3044template <>
3046Assembly::feGradPhiNeighbor<VectorValue<Real>>(FEType type) const;
3047
3048template <>
3050Assembly::feSecondPhiNeighbor<VectorValue<Real>>(FEType type) const;
3051
3052template <>
3054Assembly::fePhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3055
3056template <>
3058Assembly::feGradPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3059
3060template <>
3062Assembly::feSecondPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3063
3064template <>
3066Assembly::feCurlPhi<VectorValue<Real>>(FEType type) const;
3067
3068template <>
3070Assembly::feCurlPhiFace<VectorValue<Real>>(FEType type) const;
3071
3072template <>
3074Assembly::feCurlPhiNeighbor<VectorValue<Real>>(FEType type) const;
3075
3076template <>
3078Assembly::feCurlPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3079
3080template <>
3082Assembly::feDivPhi<VectorValue<Real>>(FEType type) const;
3083
3084template <>
3086Assembly::feDivPhiFace<VectorValue<Real>>(FEType type) const;
3087
3088template <>
3090Assembly::feDivPhiNeighbor<VectorValue<Real>>(FEType type) const;
3091
3092template <>
3094Assembly::feDivPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3095
3096template <>
3098Assembly::adGradPhi<RealVectorValue>(const MooseVariableFE<RealVectorValue> & v) const
3099{
3100 _need_ad_grad_phi = true;
3101 return _ad_vector_grad_phi_data.at(v.feType());
3102}
3103
3104template <typename Residuals, typename Indices>
3105void
3106Assembly::cacheResiduals(const Residuals & residuals,
3107 const Indices & input_row_indices,
3108 const Real scaling_factor,
3110 const std::set<TagID> & vector_tags)
3111{
3112 mooseAssert(residuals.size() == input_row_indices.size(),
3113 "The number of residuals should match the number of dof indices");
3114 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3115
3116 if (!computingResidual() || vector_tags.empty())
3117 return;
3118
3119 // A single row needs no constraining unless its dof is constrained (e.g. by a periodic boundary,
3120 // a hanging node, or a user constraint), in which case its residual must be distributed to the
3121 // constraining dofs
3122 if (residuals.size() == 1 && !_dof_map.is_constrained_dof(input_row_indices[0]))
3123 {
3124 // No constraining is required. (This is likely a finite volume computation if we only have a
3125 // single dof)
3127 residuals, input_row_indices, scaling_factor, LocalDataKey{}, vector_tags);
3128 return;
3129 }
3130
3131 // Need to make a copy because we might modify this in constrain_element_vector
3132 _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3133
3135 for (const auto i : index_range(_row_indices))
3136 _element_vector(i) = MetaPhysicL::raw_value(residuals[i]) * scaling_factor;
3137
3138 // At time of writing, this method doesn't do anything with the asymmetric_constraint_rows
3139 // argument, but we set it to false to be consistent with processLocalResidual
3141 _element_vector, _row_indices, /*asymmetric_constraint_rows=*/false);
3142
3143 for (const auto i : index_range(_row_indices))
3144 cacheResidual(_row_indices[i], _element_vector(i), vector_tags);
3145}
3146
3147template <typename Residuals, typename Indices>
3148void
3150 const Indices & row_indices,
3151 const Real scaling_factor,
3153 const std::set<TagID> & vector_tags)
3154{
3155 mooseAssert(residuals.size() == row_indices.size(),
3156 "The number of residuals should match the number of dof indices");
3157 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3158
3159 if (computingResidual() && !vector_tags.empty())
3160 for (const auto i : index_range(row_indices))
3162 row_indices[i], MetaPhysicL::raw_value(residuals[i]) * scaling_factor, vector_tags);
3163}
3164
3165template <typename Residuals, typename Indices>
3166void
3167Assembly::cacheJacobian(const Residuals & residuals,
3168 const Indices & input_row_indices,
3169 const Real scaling_factor,
3171 const std::set<TagID> & matrix_tags)
3172{
3173 if (!computingJacobian() || matrix_tags.empty())
3174 return;
3175
3176 // A single row needs no constraining unless its dof or one of its column dofs is constrained, in
3177 // which case its entries must be distributed to the constraining rows and columns
3178 const auto & single_row_dofs = residuals[0].derivatives().nude_indices();
3179 if (residuals.size() == 1 && !_dof_map.is_constrained_dof(input_row_indices[0]) &&
3180 std::none_of(single_row_dofs.begin(),
3181 single_row_dofs.end(),
3182 [this](const auto dof) { return _dof_map.is_constrained_dof(dof); }))
3183 {
3184 // No constraining is required. (This is likely a finite volume computation if we only have a
3185 // single dof)
3187 residuals, input_row_indices, scaling_factor, LocalDataKey{}, matrix_tags);
3188 return;
3189 }
3190
3191 const auto & compare_dofs = residuals[0].derivatives().nude_indices();
3192#ifndef NDEBUG
3193 auto compare_dofs_set = std::set<dof_id_type>(compare_dofs.begin(), compare_dofs.end());
3194
3195 for (const auto i : make_range(decltype(residuals.size())(1), residuals.size()))
3196 {
3197 const auto & residual = residuals[i];
3198 auto current_dofs_set = std::set<dof_id_type>(residual.derivatives().nude_indices().begin(),
3199 residual.derivatives().nude_indices().end());
3200 mooseAssert(compare_dofs_set == current_dofs_set,
3201 "We're going to see whether the dof sets are the same. IIRC the degree of freedom "
3202 "dependence (as indicated by the dof index set held by the ADReal) has to be the "
3203 "same for every residual passed to this method otherwise constrain_element_matrix "
3204 "will not work.");
3205 }
3206#endif
3207 _column_indices.assign(compare_dofs.begin(), compare_dofs.end());
3208
3209 // If there's no derivatives then there is nothing to do. Moreover, if we pass zero size column
3210 // indices to constrain_element_matrix then we will potentially get errors out of BLAS
3211 if (!_column_indices.size())
3212 return;
3213
3214 // Need to make a copy because we might modify this in constrain_element_matrix
3215 _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3216
3218 for (const auto i : index_range(_row_indices))
3219 {
3220 const auto & sparse_derivatives = residuals[i].derivatives();
3221
3222 for (const auto j : index_range(_column_indices))
3223 _element_matrix(i, j) = sparse_derivatives[_column_indices[j]] * scaling_factor;
3224 }
3225
3227
3228 for (const auto i : index_range(_row_indices))
3229 for (const auto j : index_range(_column_indices))
3230 cacheJacobian(_row_indices[i], _column_indices[j], _element_matrix(i, j), {}, matrix_tags);
3231}
3232
3233template <typename Residuals, typename Indices>
3234void
3236 const Indices & row_indices,
3237 const Real scaling_factor,
3239 const std::set<TagID> & matrix_tags)
3240{
3241 mooseAssert(residuals.size() == row_indices.size(),
3242 "The number of residuals should match the number of dof indices");
3243 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3244
3245 if (!computingJacobian() || matrix_tags.empty())
3246 return;
3247
3248 for (const auto i : index_range(row_indices))
3249 {
3250 const auto row_index = row_indices[i];
3251
3252 const auto & sparse_derivatives = residuals[i].derivatives();
3253 const auto & column_indices = sparse_derivatives.nude_indices();
3254 const auto & raw_derivatives = sparse_derivatives.nude_data();
3255
3256 for (std::size_t j = 0; j < column_indices.size(); ++j)
3258 row_index, column_indices[j], raw_derivatives[j] * scaling_factor, {}, matrix_tags);
3259 }
3260}
3261
3262inline const Real &
3268
3269inline const Real &
3275
3276inline void
3278 std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions)
3279{
3280 _disp_numbers_and_directions = std::move(disp_numbers_and_directions);
3281}
3282
3283inline void
3284Assembly::setCurrentLowerDElem(const Elem * const lower_d_elem)
3285{
3286 _current_lower_d_elem = lower_d_elem;
3287}
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:692
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:2764
VariablePhiValue _phi
Definition Assembly.h:2761
VariablePhiGradient _grad_phi
Definition Assembly.h:2762
VariablePhiSecond _second_phi
Definition Assembly.h:2763
VariablePhiDivergence _div_phi
Definition Assembly.h:2765
Key structure for APIs manipulating global vectors/matrices.
Definition Assembly.h:847
GlobalDataKey(const GlobalDataKey &)
Definition Assembly.h:856
Key structure for APIs adding/caching local element residuals/Jacobians.
Definition Assembly.h:865
LocalDataKey(const LocalDataKey &)
Definition Assembly.h:870
VectorVariablePhiValue _phi
Definition Assembly.h:2771
VectorVariablePhiGradient _grad_phi
Definition Assembly.h:2772
VectorVariablePhiSecond _second_phi
Definition Assembly.h:2773
VectorVariablePhiCurl _curl_phi
Definition Assembly.h:2774
VectorVariablePhiDivergence _div_phi
Definition Assembly.h:2775
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:1155
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kll
dlower/dlower
Definition Assembly.h:2703
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:2846
void cacheJacobianNonlocal(GlobalDataKey)
Takes the values that are currently in _sub_Keg and appends them to the cached values.
Definition Assembly.C:4176
const VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1397
SystemBase & _sys
Definition Assembly.h:2326
std::map< unsigned int, FEBase * > _holder_fe_lower_helper
helper object for transforming coordinates for lower dimensional element quadrature points
Definition Assembly.h:2574
const VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1358
std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > _cm_sf_entry
Entries in the coupling matrix for scalar variables vs field variables.
Definition Assembly.h:2349
void addJacobian(GlobalDataKey)
Adds all local Jacobian to the global Jacobian matrices.
Definition Assembly.C:3958
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:2289
const Real & neighborLowerDElemVolume() const
Definition Assembly.h:3270
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:1881
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:3485
void assignDisplacements(std::vector< std::pair< unsigned int, unsigned short > > &&disp_numbers_and_directions)
Assign the displacement numbers and directions.
Definition Assembly.h:3277
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:2787
const bool & _computing_jacobian
Whether we are currently computing the Jacobian.
Definition Assembly.h:2339
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition Assembly.h:2432
VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1473
const std::vector< Real > * _JxW_msm
A JxW for working on mortar segement elements.
Definition Assembly.h:2593
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kee
Definition Assembly.h:2693
std::set< FEType > _need_face_neighbor_div
Definition Assembly.h:2906
VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1530
void prepareLowerD()
Prepare the Jacobians and residuals for a lower dimensional element.
Definition Assembly.C:2951
void modifyWeightsDueToXFEM(const Elem *elem)
Update the integration weights for XFEM partial elements.
Definition Assembly.C:4618
VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1513
void reinitFVFace(const FaceInfo &fi)
Definition Assembly.C:1913
std::vector< VectorValue< ADReal > > _ad_elem_node_points
The positions of the nodes of the element passed to computeADElemNodePoints.
Definition Assembly.h:2886
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFace(FEType type) const
Definition Assembly.h:1670
VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1518
std::vector< std::vector< DenseVector< Number > > > _sub_Re
Definition Assembly.h:2674
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:3543
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:2925
VectorVariablePhiValue _vector_phi_face_neighbor
Definition Assembly.h:2752
const VariablePhiValue & phiFace() const
Definition Assembly.h:1338
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & nonlocalCouplingEntries()
Definition Assembly.h:1306
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:1481
MooseArray< Real > _curvatures
Definition Assembly.h:2877
std::vector< std::unique_ptr< FEBase > > _unique_fe_lower_helper
Definition Assembly.h:2387
MooseArray< Real > _coord_neighbor
The current coordinate transformation coefficients.
Definition Assembly.h:2585
const OutputTools< OutputType >::VariablePhiValue & fePhiFaceNeighbor(FEType type) const
Definition Assembly.h:1725
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1490
const bool _displaced
Definition Assembly.h:2329
void reinitFEFaceNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition Assembly.C:1629
void reinitFENeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition Assembly.C:1688
VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1555
void prepareVariableNonlocal(MooseVariableFieldBase *var)
Definition Assembly.C:2883
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhi(FEType type) const
Definition Assembly.h:1781
void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector< dof_id_type > &dof_indices)
Definition Assembly.C:3003
VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1559
std::vector< ADReal > _ad_dzetady_map
Definition Assembly.h:2871
VariablePhiGradient _grad_phi
Definition Assembly.h:2718
libMesh::QBase * _current_qrule_face
quadrature rule used on faces
Definition Assembly.h:2536
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiNeighbor(FEType type) const
Definition Assembly.h:1796
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:2843
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:2358
bool _need_ad_grad_phi_face
Whether any object needs the AD face shape function gradients.
Definition Assembly.h:2802
void cacheResidualsWithoutConstraints(const Residuals &residuals, const Indices &row_indices, Real scaling_factor, LocalDataKey, const std::set< TagID > &vector_tags)
Process the supplied residual values.
Definition Assembly.h:3149
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:2253
std::vector< Number > _ad_elem_disp_nodal_soln
Definition Assembly.h:2890
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:3322
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1773
VectorVariablePhiCurl _vector_curl_phi
Definition Assembly.h:2737
MooseArray< VectorValue< ADReal > > _ad_q_points
Definition Assembly.h:2863
std::vector< Number > _ad_elem_disp_unit_soln
Definition Assembly.h:2889
bool _current_side_volume_computed
Boolean to indicate whether current element side volumes has been computed.
Definition Assembly.h:2642
bool _need_ad_volume_map
Whether any object needs the AD element JxW, quadrature points or coordinate transformation.
Definition Assembly.h:2809
MooseArray< Real > _current_JxW_face
The current transformed jacobian weights on a face.
Definition Assembly.h:2542
const FEType _helper_type
The finite element type of the FE helper classes.
Definition Assembly.h:2372
Real _current_elem_volume
Volume of the current element.
Definition Assembly.h:2616
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:2754
const VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1392
void cacheJacobianCoupledVarPair(const MooseVariableBase &ivar, const MooseVariableBase &jvar)
Caches element matrix for ivar rows and jvar columns.
Definition Assembly.C:4160
const VariablePhiValue & phi(const MooseVariableField< Real > &) const
Definition Assembly.h:1329
bool _building_helpers
Whether we are currently building the FE classes for the helpers.
Definition Assembly.h:2390
void addJacobianScalar(GlobalDataKey)
Add Jacobians for pairs of scalar variables into the global Jacobian matrices.
Definition Assembly.C:4541
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:1330
FEBase * _current_fe_face_helper
helper object for transforming coordinates
Definition Assembly.h:2534
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:3766
FEBase * _current_fe_helper
The current helper object for transforming coordinates.
Definition Assembly.h:2422
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called....
Definition Assembly.h:2660
VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1543
void addJacobianLowerD(GlobalDataKey)
Add portions of the Jacobian of LowerLower, LowerSecondary, and SecondaryLower for boundary condition...
Definition Assembly.C:4109
libMesh::QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition Assembly.h:2424
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:2336
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:1832
MooseArray< VectorValue< ADReal > > _ad_normals
Definition Assembly.h:2875
VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1567
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:1316
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:4548
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:4659
void computeCurrentFaceVolume()
Definition Assembly.C:1829
VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1509
const VariablePhiGradient & gradPhiFace() const
Definition Assembly.h:1340
bool _need_JxW_neighbor
Flag to indicate that JxW_neighbor is needed.
Definition Assembly.h:2581
VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1505
const BoundaryID & currentBoundaryID() const
Return the current boundary ID.
Definition Assembly.h:425
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhi(FEType type) const
Definition Assembly.h:1642
VectorVariablePhiSecond _vector_second_phi
Definition Assembly.h:2736
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiLower(FEType type) const
Definition Assembly.h:2972
bool _user_added_fe_of_helper_type
Whether user code requested a FEType the same as our _helper_type.
Definition Assembly.h:2375
VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1551
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:2749
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:2795
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe
Each dimension's actual vector fe objects indexed on type.
Definition Assembly.h:2418
const MooseArray< ADPoint > & adQPointsFace() const
Definition Assembly.h:396
MooseArray< ADReal > _ad_JxW_face
Definition Assembly.h:2874
bool _calculate_xyz
Definition Assembly.h:2892
const VariablePhiValue & phi() const
Definition Assembly.h:1322
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:1380
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition Assembly.h:2612
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face
Definition Assembly.h:2788
const libMesh::CouplingMatrix & _nonlocal_cm
Definition Assembly.h:2333
VectorVariablePhiDivergence _vector_div_phi_neighbor
Definition Assembly.h:2750
Real _current_neighbor_volume
Volume of the current neighbor.
Definition Assembly.h:2634
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:2653
DenseVector< Real > getJacobianDiagonal(const DenseMatrix< Number > &ke)
Definition Assembly.h:1907
Moose::CoordinateSystemType _coord_type
The coordinate system.
Definition Assembly.h:2436
VectorVariablePhiGradient _vector_grad_phi_face_neighbor
Definition Assembly.h:2753
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:2273
std::map< FEType, FEBase * > _current_fe_neighbor
The "neighbor" fe object that matches the current elem.
Definition Assembly.h:2400
const OutputTools< OutputType >::VariablePhiValue & fePhiLower(FEType type) const
Definition Assembly.h:2956
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_lower
FE objects for lower dimensional elements.
Definition Assembly.h:2570
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
Definition Assembly.h:2675
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:2298
VariablePhiValue _phi_face_neighbor
Definition Assembly.h:2729
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:2546
const libMesh::DofMap & _dof_map
DOF map.
Definition Assembly.h:2362
const VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1345
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:2561
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1486
void prepareScalar()
Definition Assembly.C:3054
const OutputTools< OutputType >::VariablePhiValue & feDualPhiLower(FEType type) const
Definition Assembly.h:2964
std::set< FEType > _need_second_derivative_neighbor
Definition Assembly.h:2901
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Ken
jacobian contributions from the element and neighbor <Tag, ivar, jvar>
Definition Assembly.h:2697
std::vector< VectorValue< ADReal > > _ad_dxyzdxi_map
AD quantities.
Definition Assembly.h:2855
VariablePhiSecond _second_phi_face
Definition Assembly.h:2723
const MooseArray< ADReal > & adCurvatures() const
Definition Assembly.C:4892
bool _prepared_for_p_refinement
Whether helper FEs have been prepared for p-refinement.
Definition Assembly.h:2933
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_neighbor_helper
Definition Assembly.h:2385
std::vector< Point > _temp_reference_points
Temporary work data for reinitAtPhysical()
Definition Assembly.h:2852
std::vector< std::pair< MooseVariableScalar *, MooseVariableScalar * > > _cm_ss_entry
Entries in the coupling matrix for scalar variables.
Definition Assembly.h:2351
const Elem * _current_lower_d_elem
The current lower dimensional element.
Definition Assembly.h:2645
bool _need_ad_face_map
Whether any object needs the AD face JxW, normals, quadrature points, curvatures or coordinate transf...
Definition Assembly.h:2812
unsigned int _current_side
The current side of the selected element (valid only when working with sides)
Definition Assembly.h:2618
const bool & _computing_residual_and_jacobian
Whether we are currently computing the residual and Jacobian.
Definition Assembly.h:2342
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:1979
const OutputTools< OutputType >::VariablePhiGradient & feGradDualPhiLower(FEType type) const
Definition Assembly.h:2980
std::unordered_map< SubdomainID, std::vector< QRules > > _qrules
Holds quadrature rules for each dimension.
Definition Assembly.h:2473
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:1848
std::map< FEType, FEVectorBase * > _current_vector_fe
The "volume" vector fe object that matches the current elem.
Definition Assembly.h:2405
std::vector< VectorValue< ADReal > > _ad_dxyzdzeta_map
Definition Assembly.h:2857
VariablePhiValue & phiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1585
VariablePhiSecond & secondPhi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1583
VariablePhiGradient _grad_phi_neighbor
Definition Assembly.h:2726
bool computingResidualAndJacobian() const
Definition Assembly.h:1965
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:2595
std::vector< ADReal > _ad_detadx_map
Definition Assembly.h:2867
void addJacobianNonlocal(GlobalDataKey)
Adds non-local Jacobian to the global Jacobian matrices.
Definition Assembly.C:3971
const VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1354
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:3440
bool computingResidual() const
Definition Assembly.h:1955
void prepareNeighbor()
Definition Assembly.C:2913
VectorVariablePhiGradient _vector_grad_phi_neighbor
Definition Assembly.h:2747
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:2411
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:2517
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition Assembly.h:2638
std::vector< ADReal > _ad_dxidx_map
Definition Assembly.h:2864
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction)
Definition Assembly.h:2714
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:1741
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:3106
void setXFEM(std::shared_ptr< XFEMInterface > xfem)
Set the pointer to the XFEM controller object.
Definition Assembly.h:1816
VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1534
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:2630
std::vector< ADReal > _ad_dxidz_map
Definition Assembly.h:2866
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:3557
VariablePhiGradient _grad_phi_face_neighbor
Definition Assembly.h:2730
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_neighbor
Definition Assembly.h:2562
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kle
dlower/dsecondary (or dlower/delement)
Definition Assembly.h:2705
MooseArray< ADReal > _ad_JxW
Definition Assembly.h:2862
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:3525
void copyFaceShapes(MooseVariableField< T > &v)
Definition Assembly.C:3141
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:3418
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction)
Definition Assembly.h:2680
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries()
Definition Assembly.h:1296
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:3390
const VariablePhiValue & phiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1339
bool _calculate_ad_coord
Whether to calculate coord with AD.
Definition Assembly.h:2898
const libMesh::CouplingMatrix * _cm
Coupling matrices.
Definition Assembly.h:2332
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:2262
VectorVariablePhiCurl _vector_curl_phi_face
Definition Assembly.h:2743
VariablePhiGradient & gradPhi(const MooseVariableField< Real > &)
Definition Assembly.h:1469
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition Assembly.h:2540
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_neighbor
Definition Assembly.h:2789
void needADGradPhi() const
Request that element reinitialization compute the AD shape function gradients.
Definition Assembly.h:1692
void cacheJacobianNeighbor(GlobalDataKey)
Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached val...
Definition Assembly.C:4198
const libMesh::QBase *const & qRuleMortar() const
Returns a reference to the quadrature rule for the mortar segments.
Definition Assembly.h:714
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:3262
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:2389
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:4904
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knn
jacobian contributions from the neighbor <Tag, ivar, jvar>
Definition Assembly.h:2701
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:2707
VariablePhiSecond & secondPhi(const MooseVariableField< Real > &)
Definition Assembly.h:1470
libMesh::QBase * _current_qrule_neighbor
quadrature rule used on neighbors
Definition Assembly.h:2577
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:1432
VariablePhiGradient _grad_phi_face
Definition Assembly.h:2722
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:2360
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries() const
Definition Assembly.h:1301
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:2555
const OutputTools< OutputType >::VariablePhiValue & fePhiNeighbor(FEType type) const
Definition Assembly.h:1703
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:3858
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition Assembly.h:2560
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:1367
const VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1341
const OutputTools< OutputType >::VariablePhiGradient & feGradPhi(FEType type) const
Definition Assembly.h:1629
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFace(FEType type) const
Definition Assembly.h:1757
const unsigned int & side() const
Returns the current side.
Definition Assembly.h:442
std::vector< VectorValue< ADReal > > _ad_d2xyzdeta2_map
Definition Assembly.h:2860
BoundaryID _current_boundary_id
The current boundary ID.
Definition Assembly.h:2614
MooseArray< std::vector< Point > > _current_tangents
The current tangent vectors at the quadrature points.
Definition Assembly.h:2548
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_helper
Definition Assembly.h:2384
std::map< FEType, FEBase * > _current_fe
The "volume" fe object that matches the current elem.
Definition Assembly.h:2396
VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1522
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhiFace(FEType type) const
Definition Assembly.h:1677
const std::vector< Eigen::Map< RealDIMValue > > & mappedNormals() const
Definition Assembly.h:352
const VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1388
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:3028
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_lower
Definition Assembly.h:2783
VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1501
const Real & lowerDElemVolume() const
Definition Assembly.h:3263
VariablePhiSecond _second_phi
Definition Assembly.h:2719
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:3822
std::vector< VectorValue< ADReal > > _ad_d2xyzdxideta_map
Definition Assembly.h:2859
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:2509
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:2883
T * qruleFaceHelper(const Elem *elem, unsigned int side, std::function< T *(QRules &)> rule_fn)
Definition Assembly.h:2485
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face
types of vector finite elements
Definition Assembly.h:2530
VectorVariablePhiValue _vector_phi
Definition Assembly.h:2734
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:4526
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiNeighbor(FEType type) const
Definition Assembly.h:1717
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension's actual fe objects indexed on type.
Definition Assembly.h:2416
std::set< FEType > _need_curl
Definition Assembly.h:2902
const VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1371
const VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1384
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:2383
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:1923
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:2345
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:2353
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition Assembly.h:2640
VectorVariablePhiSecond _vector_second_phi_neighbor
Definition Assembly.h:2748
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > & fieldScalarCouplingEntries() const
Definition Assembly.h:1311
const VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1376
void reinitNeighborSurfaceElemRef(const Elem *neighbor_elem, const std::vector< Point > &pts)
Reinitialize FE data for a neighbor element that is itself the face, i.e.
Definition Assembly.C:2351
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:1126
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1733
void buildLowerDDualFE(FEType type) const
Definition Assembly.C:398
VariablePhiValue _phi_neighbor
Definition Assembly.h:2725
VariablePhiValue & phiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1472
void addCachedResidualDirectly(NumericVector< Number > &residual, GlobalDataKey, const VectorTag &vector_tag)
Adds the values that have been cached by calling cacheResidual(), cacheResidualNeighbor(),...
Definition Assembly.C:3616
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition Assembly.h:2528
std::vector< ADReal > _ad_jac
Definition Assembly.h:2861
void addJacobianNeighbor(GlobalDataKey)
Add ElementNeighbor, NeighborElement, and NeighborNeighbor portions of the Jacobian for compute objec...
Definition Assembly.C:3993
VectorVariablePhiCurl _vector_curl_phi_face_neighbor
Definition Assembly.h:2755
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:3891
VariablePhiGradient & gradPhi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1582
const std::vector< VectorTag > & _residual_vector_tags
The residual vector tags that Assembly could possibly contribute to.
Definition Assembly.h:2823
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition Assembly.h:2624
VectorVariablePhiDivergence _vector_div_phi_face
Definition Assembly.h:2744
bool _user_added_fe_face_neighbor_of_helper_type
Definition Assembly.h:2377
const MooseArray< ADReal > & adJxWFace() const
Definition Assembly.h:276
std::vector< ADReal > _ad_dzetadx_map
Definition Assembly.h:2870
std::vector< dof_id_type > _column_indices
Definition Assembly.h:2930
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:1350
MooseMesh & _mesh
Definition Assembly.h:2366
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:3221
std::vector< ADReal > _ad_detadz_map
Definition Assembly.h:2869
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:1144
std::vector< dof_id_type > _temp_dof_indices
Temporary work vector to keep from reallocating it.
Definition Assembly.h:2849
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition Assembly.h:2355
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:2538
VectorVariablePhiGradient _vector_grad_phi
Definition Assembly.h:2735
const VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1401
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:2316
void prepareJacobianBlock()
Sizes and zeroes the Jacobian blocks used for the current element.
Definition Assembly.C:2787
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:2307
void resizeADMappingObjects(unsigned int n_qp, unsigned int dim)
resize any objects that contribute to automatic differentiation-related mapping calculations
Definition Assembly.C:1016
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:3367
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:2856
bool computingJacobian() const
Definition Assembly.h:1960
const Node * _current_node
The current node we are working with.
Definition Assembly.h:2636
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1608
DenseVector< Number > & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
Get residual block for lower.
Definition Assembly.h:1135
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data_face
Definition Assembly.h:2798
void cacheJacobianMortar(GlobalDataKey)
Cache all portions of the Jacobian, e.g.
Definition Assembly.C:4236
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:2364
bool _calculate_face_xyz
Definition Assembly.h:2893
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kel
dsecondary/dlower (or delement/dlower)
Definition Assembly.h:2709
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_dual_lower
Definition Assembly.h:2792
MooseArray< Point > _current_normals
The current Normal vectors at the quadrature points.
Definition Assembly.h:2544
void cacheJacobian(GlobalDataKey)
Takes the values that are currently in _sub_Kee and appends them to the cached values.
Definition Assembly.C:4146
bool _calculate_curvatures
Definition Assembly.h:2894
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME)
Definition Assembly.h:2826
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:2838
ArbitraryQuadrature * _current_qrule_arbitrary
The current arbitrary quadrature rule used within the element interior.
Definition Assembly.h:2428
void computeADFace(const Elem &elem, const unsigned int side)
compute AD things on an element face
Definition Assembly.C:2176
libMesh::ElemSideBuilder _current_side_elem_builder
In place side element builder for _current_side_elem.
Definition Assembly.h:2909
const VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1409
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:1424
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_lower
Vector FE objects for lower dimensional elements.
Definition Assembly.h:2572
void setCachedJacobian(GlobalDataKey)
Sets previously-cached Jacobian values via SparseMatrix::set() calls.
Definition Assembly.C:4577
const VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1428
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:1973
void preparePRefinement()
Prepare helper FEs for p-refinement.
Definition Assembly.C:4937
std::vector< std::vector< DenseVector< Number > > > _sub_Rl
residual contributions for each variable from the lower dimensional element
Definition Assembly.h:2677
std::map< FEType, FEBase * > _current_fe_face
The "face" fe object that matches the current elem.
Definition Assembly.h:2398
VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1500
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
Definition Assembly.C:3901
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:2280
VectorVariablePhiDivergence _vector_div_phi
Definition Assembly.h:2738
const OutputTools< OutputType >::VariablePhiValue & fePhi(FEType type) const
Definition Assembly.h:1622
const VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1462
const VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1413
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
Definition Assembly.C:1875
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:1437
std::vector< dof_id_type > _neighbor_extra_elem_ids
Extra element IDs of neighbor.
Definition Assembly.h:2553
libMesh::ElemSideBuilder _compute_face_map_side_elem_builder
In place side element builder for computeFaceMap()
Definition Assembly.h:2913
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:3493
VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1539
void modifyFaceWeightsDueToXFEM(const Elem *elem, unsigned int side=0)
Update the face integration weights for XFEM partial elements.
Definition Assembly.C:4638
unsigned int _max_cached_residuals
Definition Assembly.h:2831
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:2393
std::map< unsigned int, FEBase * > _holder_fe_face_neighbor_helper
Definition Assembly.h:2567
std::set< FEType > _need_neighbor_div
Definition Assembly.h:2905
SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition Assembly.h:2626
std::vector< dof_id_type > _ad_elem_disp_dof_indices
Working vectors for computeADElemNodePoints.
Definition Assembly.h:2888
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhi(FEType type) const
Definition Assembly.h:1636
std::map< FEType, FEVectorBase * > _current_vector_fe_face
The "face" vector fe object that matches the current elem.
Definition Assembly.h:2407
VariablePhiValue _phi
Definition Assembly.h:2717
bool _custom_mortar_qrule
Flag specifying whether a custom quadrature rule has been specified for mortar segment mesh.
Definition Assembly.h:2602
libMesh::ElemSideBuilder _current_neighbor_side_elem_builder
In place side element builder for _current_neighbor_side_elem.
Definition Assembly.h:2911
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:2836
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data_face
Definition Assembly.h:2796
MooseArray< ADReal > _ad_coord
The AD version of the current coordinate transformation coefficients.
Definition Assembly.h:2440
const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase &fe)
Attaches the current face/area quadrature rule to the given fe.
Definition Assembly.h:1935
std::vector< std::unique_ptr< FEBase > > _unique_fe_neighbor_helper
Definition Assembly.h:2386
VariablePhiSecond & secondPhiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1590
std::map< FEType, FEBase * > _current_fe_face_neighbor
The "neighbor face" fe object that matches the current elem.
Definition Assembly.h:2402
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:1097
void needADGradPhiFace() const
Request that face reinitialization compute the AD shape function gradients.
Definition Assembly.h:1686
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1494
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_neighbor
Definition Assembly.h:2781
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:2271
VariablePhiValue & phi(const MooseVariableField< Real > &)
Definition Assembly.h:1468
VariablePhiValue & phiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1595
bool _need_lower_d_elem_volume
Whether we need to compute the lower dimensional element volume.
Definition Assembly.h:2649
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face_neighbor
Definition Assembly.h:2790
QRules & qrules(unsigned int dim)
Definition Assembly.h:2504
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:2368
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition Assembly.h:2632
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFace(FEType type) const
Definition Assembly.h:1788
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Keg
Definition Assembly.h:2694
SubProblem & _subproblem
Definition Assembly.h:2327
std::set< FEType > _need_face_div
Definition Assembly.h:2904
const std::vector< Real > & jxWMortar() const
Returns a reference to JxW for mortar segment elements.
Definition Assembly.h:709
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:2050
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:1324
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:3943
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:2075
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:1547
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:4384
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiNeighbor(FEType type) const
Definition Assembly.h:1710
VectorVariablePhiGradient _vector_grad_phi_face
Definition Assembly.h:2741
VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1476
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > _cm_fs_entry
Entries in the coupling matrix for field variables vs scalar variables.
Definition Assembly.h:2347
Real _current_side_volume
Volume of the current side element.
Definition Assembly.h:2622
void copyShapes(MooseVariableField< T > &v)
Definition Assembly.C:3104
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:3352
VariablePhiSecond _second_phi_neighbor
Definition Assembly.h:2727
Real _current_neighbor_lower_d_elem_volume
The current neighboring lower dimensional element volume.
Definition Assembly.h:2655
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition Assembly.h:2438
void prepare()
Definition Assembly.C:2820
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_lower
Definition Assembly.h:2791
void buildVectorFE(FEType type) const
Build Vector FEs with a type.
Definition Assembly.C:478
VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1571
const OutputTools< OutputType >::VariablePhiValue & fePhiFace(FEType type) const
Definition Assembly.h:1663
VariablePhiGradient & gradPhiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1586
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:1117
ArbitraryQuadrature * _current_qrule_arbitrary_face
The current arbitrary quadrature rule used on the element face.
Definition Assembly.h:2430
const MooseArray< Real > & JxW() const
Returns the reference to the transformed jacobian weights.
Definition Assembly.h:268
VariablePhiValue _phi_face
Definition Assembly.h:2721
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_nonlocal_used
Definition Assembly.h:2356
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:1563
void prepareResidual()
Sizes and zeroes the residual for the current element.
Definition Assembly.C:2811
void setCurrentLowerDElem(const Elem *const lower_d_elem)
Set the current lower dimensional element.
Definition Assembly.h:3284
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:2746
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:2378
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:2740
void reinitFEFace(const Elem *elem, unsigned int side)
Just an internal helper function to reinit the face FE objects.
Definition Assembly.C:1344
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:2566
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:4316
VectorVariablePhiSecond _vector_second_phi_face
Definition Assembly.h:2742
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:1856
const Elem *const & msmElem() const
Definition Assembly.h:1970
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:2482
void initNonlocalCoupling()
Create pair of variables requiring nonlocal jacobian contributions.
Definition Assembly.C:2752
MooseArray< ADReal > _ad_curvatures
Definition Assembly.h:2878
VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1526
const VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1457
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:1695
bool _need_ad_grad_phi
Whether any object needs the AD element shape function gradients.
Definition Assembly.h:2804
libMesh::QBase * _qrule_msm
A qrule object for working on mortar segement elements.
Definition Assembly.h:2600
unsigned int _max_cached_jacobians
Definition Assembly.h:2840
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition Assembly.h:2620
std::set< FEType > _need_div
Definition Assembly.h:2903
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:2829
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:2794
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1603
const VariablePhiGradient & gradPhi(const MooseVariableField< Real > &) const
Definition Assembly.h:1331
std::map< unsigned int, FEBase * > _holder_fe_helper
Each dimension's helper objects.
Definition Assembly.h:2420
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1612
MooseArray< Point > _current_q_points_face_neighbor
The current quadrature points on the neighbor face.
Definition Assembly.h:2579
std::vector< ADReal > _ad_dzetadz_map
Definition Assembly.h:2872
std::vector< ADReal > _ad_detady_map
Definition Assembly.h:2868
const Elem *const & sideElem() const
Returns the side element.
Definition Assembly.h:454
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhi(FEType type) const
Definition Assembly.h:1749
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kne
jacobian contributions from the neighbor and element <Tag, ivar, jvar>
Definition Assembly.h:2699
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition Assembly.h:2434
void zeroCachedJacobian(GlobalDataKey)
Zero out previously-cached Jacobian rows.
Definition Assembly.C:4597
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:2647
VariablePhiValue & phi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1581
libMesh::QBase * _current_qrule_lower
quadrature rule used on lower dimensional elements.
Definition Assembly.h:2606
const VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1363
void clearCachedResiduals(GlobalDataKey)
Clears all of the residuals in _cached_residual_rows and _cached_residual_values.
Definition Assembly.C:3586
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:4442
void computeCurrentElemVolume()
Definition Assembly.C:1810
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:2628
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knl
dprimary/dlower (or dneighbor/dlower)
Definition Assembly.h:2711
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:3462
MooseArray< VectorValue< ADReal > > _ad_q_points_face
Definition Assembly.h:2876
void reinitMortarElem(const Elem *elem)
reinitialize a mortar segment mesh element in order to get a proper JxW
Definition Assembly.C:2503
std::vector< VectorValue< ADReal > > _ad_d2xyzdxi2_map
Definition Assembly.h:2858
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1616
const Elem * _current_elem
The current "element" we are currently on.
Definition Assembly.h:2610
std::map< unsigned int, FEBase * > _holder_fe_face_helper
Each dimension's helper objects.
Definition Assembly.h:2532
const VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1452
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face_neighbor
Definition Assembly.h:2563
const VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1423
VectorVariablePhiDivergence _vector_div_phi_face_neighbor
Definition Assembly.h:2756
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1599
void reinitNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Reinitializes the neighbor side using reference coordinates.
Definition Assembly.C:1743
const Elem * _msm_elem
Definition Assembly.h:2915
libMesh::QBase * _current_qrule_volume
The current volumetric quadrature for the element.
Definition Assembly.h:2426
void addJacobianNeighborLowerD(GlobalDataKey)
Add all portions of the Jacobian except PrimaryPrimary, e.g.
Definition Assembly.C:4031
std::map< FEType, FEVectorBase * > _current_vector_fe_neighbor
The "neighbor" vector fe object that matches the current elem.
Definition Assembly.h:2409
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1477
MooseArray< Real > _coord_msm
The coordinate transformation coefficients evaluated on the quadrature points of the mortar segment m...
Definition Assembly.h:2588
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:2651
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:3643
const VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1447
std::vector< std::vector< Real > > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition Assembly.h:2834
bool _user_added_fe_face_of_helper_type
Definition Assembly.h:2376
void clearCachedJacobian()
Clear any currently cached jacobians.
Definition Assembly.C:4607
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:2784
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data
Shape function values, gradients, second derivatives for each FE type.
Definition Assembly.h:2779
std::vector< Point > _current_neighbor_ref_points
The current reference points on the neighbor element.
Definition Assembly.h:2936
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:3235
void copyNeighborShapes(MooseVariableField< T > &v)
Definition Assembly.C:3178
std::set< FEType > _need_second_derivative
Definition Assembly.h:2900
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiNeighbor(FEType type) const
Definition Assembly.h:1765
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:2930
std::vector< dof_id_type > _extra_elem_ids
Extra element IDs.
Definition Assembly.h:2551
void addCachedResiduals(GlobalDataKey, const std::vector< VectorTag > &tags)
Pushes all cached residuals to the global residual vectors associated with each tag.
Definition Assembly.C:3571
void computeADElemNodePoints(const Elem &elem, bool do_derivatives)
Fill _ad_elem_node_points with the positions of the nodes of elem, with derivatives with respect to t...
Definition Assembly.C:1046
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face_neighbor
Definition Assembly.h:2782
bool _user_added_fe_lower_of_helper_type
Definition Assembly.h:2379
MooseArray< Real > _current_JxW_neighbor
The current transformed jacobian weights on a neighbor's face.
Definition Assembly.h:2583
std::vector< ADReal > _ad_dxidy_map
Definition Assembly.h:2865
unsigned int _mesh_dimension
Definition Assembly.h:2368
DenseVector< Number > _element_vector
A working vector to avoid repeated heap allocations when caching residuals that must have libMesh-lev...
Definition Assembly.h:2920
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1804
const VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1418
VariablePhiSecond _second_phi_face_neighbor
Definition Assembly.h:2731
VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1575
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:3634
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face
Definition Assembly.h:2780
const VariablePhiSecond & secondPhi() const
Definition Assembly.h:1332
const VariablePhiSecond & secondPhi(const MooseVariableField< Real > &) const
Definition Assembly.h:1333
const Elem *const & neighbor() const
Return the neighbor element.
Definition Assembly.h:466
void prepareOffDiagScalar()
Definition Assembly.C:3078
void prepareNonlocal()
Definition Assembly.C:2827
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:2853
VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1474
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition Assembly.h:472
const VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1442
const VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1405
bool _need_dual
Whether dual shape functions need to be computed for mortar constraints.
Definition Assembly.h:2657
const MooseArray< ADReal > & adCoordTransformation() const
Returns the reference to the AD version of the coordinate transformation coefficients.
Definition Assembly.h:2940
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:856
const SubdomainID ANY_BLOCK_ID
Definition MooseTypes.C:19
CoordinateSystemType
Definition MooseTypes.h:869
DGJacobianType
Definition MooseTypes.h:809
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:2445
std::unique_ptr< ArbitraryQuadrature > arbitrary_vol
volume/elem (meshdim) custom points quadrature rule
Definition Assembly.h:2462
std::unique_ptr< ArbitraryQuadrature > neighbor
area/face (meshdim-1) custom points quadrature rule for DG
Definition Assembly.h:2466
std::unique_ptr< libMesh::QBase > fv_face
finite volume face/flux quadrature rule (meshdim-1)
Definition Assembly.h:2460
std::unique_ptr< libMesh::QBase > vol
volume/elem (meshdim) quadrature rule
Definition Assembly.h:2456
std::unique_ptr< ArbitraryQuadrature > arbitrary_face
area/face (meshdim-1) custom points quadrature rule
Definition Assembly.h:2464
std::unique_ptr< libMesh::QBase > face
area/face (meshdim-1) quadrature rule
Definition Assembly.h:2458