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
29// libMesh forward declarations
30namespace libMesh
31{
32class DofMap;
33class CouplingMatrix;
34class Elem;
35template <typename>
36class VectorValue;
38template <typename T>
39class FEGenericBase;
42class Node;
43template <typename T>
44class NumericVector;
45template <typename T>
46class SparseMatrix;
48}
49
50// MOOSE Forward Declares
51class FaceInfo;
52class MooseMesh;
54class SystemBase;
57template <typename>
58class MooseVariableFE;
63class XFEMInterface;
64class SubProblem;
66
67#ifdef MOOSE_KOKKOS_ENABLED
69{
70class Assembly;
71}
72#endif
73
82template <typename P, typename C>
83void coordTransformFactor(const SubProblem & s,
84 SubdomainID sub_id,
85 const P & point,
86 C & factor,
87 SubdomainID neighbor_sub_id = libMesh::Elem::invalid_subdomain_id);
88
89template <typename P, typename C>
91 SubdomainID sub_id,
92 const P & point,
93 C & factor,
94 SubdomainID neighbor_sub_id = libMesh::Elem::invalid_subdomain_id);
95
101{
102public:
103 Assembly(SystemBase & sys, THREAD_ID tid);
104 virtual ~Assembly();
105
110 template <typename T>
111 static const T * const & constify_ref(T * const & inref)
112 {
113 const T * const * ptr = &inref;
114 return *ptr;
115 }
116
123 const FEBase * const & getFE(FEType type, unsigned int dim) const
124 {
125 buildFE(type);
126 return constify_ref(_fe[dim][type]);
127 }
128
135 const FEBase * const & getFENeighbor(FEType type, unsigned int dim) const
136 {
137 buildNeighborFE(type);
138 return constify_ref(_fe_neighbor[dim][type]);
139 }
140
147 const FEBase * const & getFEFace(FEType type, unsigned int dim) const
148 {
149 buildFaceFE(type);
150 return constify_ref(_fe_face[dim][type]);
151 }
152
159 const FEBase * const & getFEFaceNeighbor(FEType type, unsigned int dim) const
160 {
162 return constify_ref(_fe_face_neighbor[dim][type]);
163 }
164
171 const FEVectorBase * const & getVectorFE(FEType type, unsigned int dim) const
172 {
173 buildVectorFE(type);
174 return constify_ref(_vector_fe[dim][type]);
175 }
176
183 const FEVectorBase * const & getVectorFENeighbor(FEType type, unsigned int dim) const
184 {
186 return constify_ref(_vector_fe_neighbor[dim][type]);
187 }
188
195 const FEVectorBase * const & getVectorFEFace(FEType type, unsigned int dim) const
196 {
197 buildVectorFaceFE(type);
198 return constify_ref(_vector_fe_face[dim][type]);
199 }
200
207 const FEVectorBase * const & getVectorFEFaceNeighbor(FEType type, unsigned int dim) const
208 {
211 }
212
213#ifdef MOOSE_KOKKOS_ENABLED
220#endif
221
226 const libMesh::QBase * const & qRule() const { return constify_ref(_current_qrule); }
227
233
234#ifdef MOOSE_KOKKOS_ENABLED
240 {
241 return qrules(dim, block).vol.get();
242 }
243#endif
244
249 const MooseArray<Point> & qPoints() const { return _current_q_points; }
250
255 const std::vector<Point> & qPointsMortar() const { return _fe_msm->get_xyz(); }
256
262
267 const MooseArray<Real> & JxW() const { return _current_JxW; }
268
269 const MooseArray<ADReal> & adJxW() const { return _ad_JxW; }
270
271 const MooseArray<ADReal> & adJxWFace() const { return _ad_JxW_face; }
272
273 const MooseArray<ADReal> & adCurvatures() const;
274
279 const MooseArray<Real> & coordTransformation() const { return _coord; }
280
286
292 {
293 // Coord values for non-cartesian coordinate systems are functions of the locations of the
294 // quadrature points in physical space. We also have no way of knowing whether this was called
295 // from a volumetric or face object so we should set both volumetric and face xyz to true
296 _calculate_xyz = true;
297 _calculate_face_xyz = true;
298
299 _calculate_ad_coord = true;
300 return _ad_coord;
301 }
302
308
313 const libMesh::QBase * const & qRuleFace() const { return constify_ref(_current_qrule_face); }
314
320
321#ifdef MOOSE_KOKKOS_ENABLED
327 {
328 return qrules(dim, block).face.get();
329 }
330#endif
331
337
342 const MooseArray<Real> & JxWFace() const { return _current_JxW_face; }
343
348 const MooseArray<Point> & normals() const { return _current_normals; }
349
350 /***
351 * Returns the array of normals for quadrature points on a current side
352 */
353 const std::vector<Eigen::Map<RealDIMValue>> & mappedNormals() const { return _mapped_normals; }
354
360
364 unsigned int numExtraElemIntegers() const { return _extra_elem_ids.size() - 1; }
365
369 const dof_id_type & extraElemID(unsigned int id) const
370 {
371 mooseAssert(id < _extra_elem_ids.size(), "An invalid extra element integer id");
372 return _extra_elem_ids[id];
373 }
374
378 const dof_id_type & extraElemIDNeighbor(unsigned int id) const
379 {
380 mooseAssert(id < _neighbor_extra_elem_ids.size(), "An invalid extra element integer id");
381 return _neighbor_extra_elem_ids[id];
382 }
383
384 const MooseArray<ADPoint> & adNormals() const { return _ad_normals; }
385
387 {
388 _calculate_xyz = true;
389 return _ad_q_points;
390 }
391
393 {
394 _calculate_face_xyz = true;
395 return _ad_q_points_face;
396 }
397
398 template <bool is_ad>
400
405 const Elem * const & elem() const { return _current_elem; }
406
411
416
421
426
431 const Real & elemVolume() const { return _current_elem_volume; }
432
437 const unsigned int & side() const { return _current_side; }
438
443 const unsigned int & neighborSide() const { return _current_neighbor_side; }
444
449 const Elem * const & sideElem() const { return _current_side_elem; }
450
455 const Real & sideElemVolume() const { return _current_side_volume; }
456
461 const Elem * const & neighbor() const { return _current_neighbor_elem; }
462
467 const Elem * const & lowerDElem() const { return _current_lower_d_elem; }
468
473 const Elem * const & neighborLowerDElem() const { return _current_neighbor_lower_d_elem; }
474
475 /*
476 * @return The current lower-dimensional element volume
477 */
478 const Real & lowerDElemVolume() const;
479
480 /*
481 * @return The current neighbor lower-dimensional element volume
482 */
483 const Real & neighborLowerDElemVolume() const;
484
489
494
499 const Real & neighborVolume()
500 {
503 }
504
509 const libMesh::QBase * const & qRuleNeighbor() const
510 {
512 }
513
519
524 const MooseArray<Real> & JxWNeighbor() const;
525
531
536 const Node * const & node() const { return _current_node; }
537
542 const Node * const & nodeNeighbor() const { return _current_neighbor_node; }
543
552 void createQRules(QuadratureType type,
553 Order order,
554 Order volume_order,
555 Order face_order,
556 SubdomainID block,
557 bool allow_negative_qweights = true);
558
565 void bumpVolumeQRuleOrder(Order volume_order, SubdomainID block);
566
574 void bumpAllQRuleOrder(Order order, SubdomainID block);
575
584 void setVolumeQRule(libMesh::QBase * qrule, unsigned int dim);
585
594 void setFaceQRule(libMesh::QBase * qrule, unsigned int dim);
595
603 void setMortarQRule(Order order);
604
608 void activateDual() { _need_dual = true; }
609
614 bool needDual() const { return _need_dual; }
615
619 void clearCachedQRules();
620
621private:
628 void setLowerQRule(libMesh::QBase * qrule, unsigned int dim);
629
630public:
639 void setNeighborQRule(libMesh::QBase * qrule, unsigned int dim);
640
646 void reinit(const Elem * elem);
647
651 void setVolumeQRule(const Elem * elem);
652
657 void reinitElemFaceRef(const Elem * elem,
658 unsigned int elem_side,
659 Real tolerance,
660 const std::vector<Point> * const pts = nullptr,
661 const std::vector<Real> * const weights = nullptr);
662
667 void reinitNeighborFaceRef(const Elem * neighbor_elem,
668 unsigned int neighbor_side,
669 Real tolerance,
670 const std::vector<Point> * const pts,
671 const std::vector<Real> * const weights = nullptr);
672
676 void reinitDual(const Elem * elem, const std::vector<Point> & pts, const std::vector<Real> & JxW);
677
681 void reinitLowerDElem(const Elem * elem,
682 const std::vector<Point> * const pts = nullptr,
683 const std::vector<Real> * const weights = nullptr);
684
688 void reinitNeighborLowerDElem(const Elem * elem);
689
693 void reinitMortarElem(const Elem * elem);
694
698 const std::vector<Real> & jxWMortar() const { return *_JxW_msm; }
699
703 const libMesh::QBase * const & qRuleMortar() const { return constify_ref(_qrule_msm); }
704
705private:
709 void computeADFace(const Elem & elem, const unsigned int side);
710
711public:
715 void reinitAtPhysical(const Elem * elem, const std::vector<Point> & physical_points);
716
720 void reinit(const Elem * elem, const std::vector<Point> & reference_points);
721
725 void setFaceQRule(const Elem * const elem, const unsigned int side);
726
730 void reinit(const Elem * elem, unsigned int side);
731
735 void reinit(const Elem * elem, unsigned int side, const std::vector<Point> & reference_points);
736
737 void reinitFVFace(const FaceInfo & fi);
738
750 void reinitElemAndNeighbor(const Elem * elem,
751 unsigned int side,
752 const Elem * neighbor,
753 unsigned int neighbor_side,
754 const std::vector<Point> * neighbor_reference_points = nullptr);
755
759 void reinitNeighborAtPhysical(const Elem * neighbor,
760 unsigned int neighbor_side,
761 const std::vector<Point> & physical_points);
762
766 void reinitNeighborAtPhysical(const Elem * neighbor, const std::vector<Point> & physical_points);
767
771 void reinitNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
772
776 void reinit(const Node * node);
777
782
785
788
790 void prepareResidual();
791
792 void prepare();
793 void prepareNonlocal();
794
802 void prepareNeighbor();
803
808 void prepareLowerD();
809
810 void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector<dof_id_type> & dof_indices);
811 void prepareBlockNonlocal(unsigned int ivar,
812 unsigned jvar,
813 const std::vector<dof_id_type> & idof_indices,
814 const std::vector<dof_id_type> & jdof_indices);
815 void prepareScalar();
817
818 template <typename T>
820 void copyShapes(unsigned int var);
821
822 template <typename T>
824 void copyFaceShapes(unsigned int var);
825
826 template <typename T>
828 void copyNeighborShapes(unsigned int var);
829
836 {
837 // Blessed classes
838 friend class Assembly;
839 friend class SubProblem;
840 friend class FEProblemBase;
841 friend class DisplacedProblem;
846 };
847
854 {
855 // Blessed classes
856 friend class Assembly;
857 friend class TaggingInterface;
860 };
861
866 void addResidual(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
871 void addResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
876 void addResidualLower(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
877
882 void addResidualScalar(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
883
888 void cacheResidual(GlobalDataKey, const std::vector<VectorTag> & tags);
889
894 void cacheResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & tags);
895
899 void cacheResidualLower(GlobalDataKey, const std::vector<VectorTag> & tags);
900
906 void addCachedResiduals(GlobalDataKey, const std::vector<VectorTag> & tags);
907
916 void clearCachedResiduals(GlobalDataKey);
917
925 void addCachedResidualDirectly(NumericVector<Number> & residual,
926 GlobalDataKey,
927 const VectorTag & vector_tag);
928
932 void setResidual(NumericVector<Number> & residual, GlobalDataKey, const VectorTag & vector_tag);
933
937 void setResidualNeighbor(NumericVector<Number> & residual,
938 GlobalDataKey,
939 const VectorTag & vector_tag);
940
944 void addJacobian(GlobalDataKey);
945
949 void addJacobianNonlocal(GlobalDataKey);
950
955 void addJacobianNeighbor(GlobalDataKey);
956
960 void addJacobianScalar(GlobalDataKey);
961
966 void addJacobianOffDiagScalar(unsigned int ivar, GlobalDataKey);
967
972 unsigned int ivar,
973 unsigned int jvar,
974 const libMesh::DofMap & dof_map,
975 std::vector<dof_id_type> & dof_indices,
977 TagID tag);
978
984 unsigned int ivar,
985 unsigned int jvar,
986 const libMesh::DofMap & dof_map,
987 std::vector<dof_id_type> & dof_indices,
989 const std::set<TagID> & tags);
990
995 unsigned int ivar,
996 unsigned int jvar,
997 const libMesh::DofMap & dof_map,
998 const std::vector<dof_id_type> & idof_indices,
999 const std::vector<dof_id_type> & jdof_indices,
1001 TagID tag);
1002
1007 unsigned int ivar,
1008 unsigned int jvar,
1009 const libMesh::DofMap & dof_map,
1010 const std::vector<dof_id_type> & idof_indices,
1011 const std::vector<dof_id_type> & jdof_indices,
1013 const std::set<TagID> & tags);
1014
1024
1031
1041
1047 unsigned int ivar,
1048 unsigned int jvar,
1049 const libMesh::DofMap & dof_map,
1050 std::vector<dof_id_type> & dof_indices,
1051 std::vector<dof_id_type> & neighbor_dof_indices,
1053 TagID tag);
1054
1060 unsigned int ivar,
1061 unsigned int jvar,
1062 const libMesh::DofMap & dof_map,
1063 std::vector<dof_id_type> & dof_indices,
1064 std::vector<dof_id_type> & neighbor_dof_indices,
1066 const std::set<TagID> & tags);
1067
1072
1077
1083
1091
1096
1101
1106 DenseVector<Number> & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
1107 {
1108 return _sub_Re[tag_id][var_num];
1109 }
1110
1115 DenseVector<Number> & residualBlockNeighbor(unsigned int var_num, LocalDataKey, TagID tag_id)
1116 {
1117 return _sub_Rn[tag_id][var_num];
1118 }
1119
1124 DenseVector<Number> & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
1125 {
1126 return _sub_Rl[tag_id][var_num];
1127 }
1128
1133 DenseMatrix<Number> & jacobianBlock(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1134 {
1135 jacobianBlockUsed(tag, ivar, jvar, true);
1136 return _sub_Kee[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1137 }
1138
1143 DenseMatrix<Number> &
1144 jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1145 {
1146 jacobianBlockNonlocalUsed(tag, ivar, jvar, true);
1147 return _sub_Keg[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1148 }
1149
1154 DenseMatrix<Number> & jacobianBlockNeighbor(
1155 Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag);
1156
1164 DenseMatrix<Number> & jacobianBlockMortar(Moose::ConstraintJacobianType type,
1165 unsigned int ivar,
1166 unsigned int jvar,
1167 LocalDataKey,
1168 TagID tag);
1169
1174 void cacheResidualNodes(const DenseVector<Number> & res,
1175 const std::vector<dof_id_type> & dof_index,
1176 LocalDataKey,
1177 TagID tag);
1178
1190 void
1191 cacheJacobian(numeric_index_type i, numeric_index_type j, Real value, LocalDataKey, TagID tag);
1192
1204 void cacheJacobian(numeric_index_type i,
1205 numeric_index_type j,
1206 Real value,
1207 LocalDataKey,
1208 const std::set<TagID> & tags);
1209
1217 void cacheJacobianBlock(const DenseMatrix<Number> & jac_block,
1218 const std::vector<dof_id_type> & idof_indices,
1219 const std::vector<dof_id_type> & jdof_indices,
1220 Real scaling_factor,
1221 LocalDataKey,
1222 const std::set<TagID> & tags);
1223
1233 template <typename Residuals, typename Indices>
1234 void cacheResiduals(const Residuals & residuals,
1235 const Indices & row_indices,
1236 Real scaling_factor,
1237 LocalDataKey,
1238 const std::set<TagID> & vector_tags);
1239
1247 template <typename Residuals, typename Indices>
1248 void cacheJacobian(const Residuals & residuals,
1249 const Indices & row_indices,
1250 Real scaling_factor,
1251 LocalDataKey,
1252 const std::set<TagID> & matrix_tags);
1253
1264 template <typename Residuals, typename Indices>
1265 void cacheResidualsWithoutConstraints(const Residuals & residuals,
1266 const Indices & row_indices,
1267 Real scaling_factor,
1268 LocalDataKey,
1269 const std::set<TagID> & vector_tags);
1270
1278 template <typename Residuals, typename Indices>
1279 void cacheJacobianWithoutConstraints(const Residuals & residuals,
1280 const Indices & row_indices,
1281 Real scaling_factor,
1282 LocalDataKey,
1283 const std::set<TagID> & matrix_tags);
1284
1285 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> & couplingEntries()
1286 {
1287 return _cm_ff_entry;
1288 }
1289 const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1291 {
1292 return _cm_ff_entry;
1293 }
1294 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1296 {
1297 return _cm_nonlocal_entry;
1298 }
1299 const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> &
1301 {
1302 return _cm_fs_entry;
1303 }
1304 const std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> &
1306 {
1307 return _cm_sf_entry;
1308 }
1309
1310 // Read-only references
1311 const VariablePhiValue & phi() const { return _phi; }
1312 template <typename T>
1314 {
1315 return _ad_grad_phi_data.at(v.feType());
1316 }
1317 const VariablePhiValue & phi(const MooseVariableField<Real> &) const { return _phi; }
1318 const VariablePhiGradient & gradPhi() const { return _grad_phi; }
1320 const VariablePhiSecond & secondPhi() const { return _second_phi; }
1322 {
1323 return _second_phi;
1324 }
1325
1326 const VariablePhiValue & phiFace() const { return _phi_face; }
1330 {
1331 return _grad_phi_face;
1332 }
1334 {
1335 return _second_phi_face;
1336 }
1337
1339 {
1340 return _phi_neighbor;
1341 }
1343 {
1344 return _grad_phi_neighbor;
1345 }
1350
1352 {
1353 return _phi_face_neighbor;
1354 }
1363
1365 {
1366 return _vector_phi;
1367 }
1384
1405
1429
1444 const VectorVariablePhiCurl &
1454
1455 // Writeable references
1459
1463
1473
1486
1487 // Writeable references with vector variable
1505
1526
1567
1568 // Writeable references with array variable
1572
1582
1595
1608
1609 template <typename OutputType>
1610 const typename OutputTools<OutputType>::VariablePhiValue & fePhi(FEType type) const
1611 {
1612 buildFE(type);
1613 return _fe_shape_data[type]->_phi;
1614 }
1615
1616 template <typename OutputType>
1618 {
1619 buildFE(type);
1620 return _fe_shape_data[type]->_grad_phi;
1621 }
1622
1623 template <typename OutputType>
1625 {
1626 return _ad_grad_phi_data[type];
1627 }
1628
1629 template <typename OutputType>
1631 {
1632 _need_second_derivative.insert(type);
1633 buildFE(type);
1634 return _fe_shape_data[type]->_second_phi;
1635 }
1636
1637 template <typename OutputType>
1638 const typename OutputTools<OutputType>::VariablePhiValue & fePhiLower(FEType type) const;
1639
1640 template <typename OutputType>
1641 const typename OutputTools<OutputType>::VariablePhiValue & feDualPhiLower(FEType type) const;
1642
1643 template <typename OutputType>
1644 const typename OutputTools<OutputType>::VariablePhiGradient & feGradPhiLower(FEType type) const;
1645
1646 template <typename OutputType>
1648 feGradDualPhiLower(FEType type) const;
1649
1650 template <typename OutputType>
1651 const typename OutputTools<OutputType>::VariablePhiValue & fePhiFace(FEType type) const
1652 {
1653 buildFaceFE(type);
1654 return _fe_shape_data_face[type]->_phi;
1655 }
1656
1657 template <typename OutputType>
1659 {
1660 buildFaceFE(type);
1661 return _fe_shape_data_face[type]->_grad_phi;
1662 }
1663
1664 template <typename OutputType>
1666 {
1667 return _ad_grad_phi_data_face[type];
1668 }
1669
1670 template <typename OutputType>
1672 {
1673 _need_second_derivative.insert(type);
1674 buildFaceFE(type);
1675 return _fe_shape_data_face[type]->_second_phi;
1676 }
1677
1678 template <typename OutputType>
1680 {
1681 buildNeighborFE(type);
1682 return _fe_shape_data_neighbor[type]->_phi;
1683 }
1684
1685 template <typename OutputType>
1687 {
1688 buildNeighborFE(type);
1689 return _fe_shape_data_neighbor[type]->_grad_phi;
1690 }
1691
1692 template <typename OutputType>
1694 {
1696 buildNeighborFE(type);
1697 return _fe_shape_data_neighbor[type]->_second_phi;
1698 }
1699
1700 template <typename OutputType>
1702 {
1703 buildFaceNeighborFE(type);
1704 return _fe_shape_data_face_neighbor[type]->_phi;
1705 }
1706
1707 template <typename OutputType>
1709 feGradPhiFaceNeighbor(FEType type) const
1710 {
1711 buildFaceNeighborFE(type);
1712 return _fe_shape_data_face_neighbor[type]->_grad_phi;
1713 }
1714
1715 template <typename OutputType>
1717 feSecondPhiFaceNeighbor(FEType type) const
1718 {
1720 buildFaceNeighborFE(type);
1721 return _fe_shape_data_face_neighbor[type]->_second_phi;
1722 }
1723
1724 template <typename OutputType>
1725 const typename OutputTools<OutputType>::VariablePhiCurl & feCurlPhi(FEType type) const
1726 {
1727 _need_curl.insert(type);
1728 buildFE(type);
1729 return _fe_shape_data[type]->_curl_phi;
1730 }
1731
1732 template <typename OutputType>
1734 {
1735 _need_curl.insert(type);
1736 buildFaceFE(type);
1737 return _fe_shape_data_face[type]->_curl_phi;
1738 }
1739
1740 template <typename OutputType>
1742 {
1743 _need_curl.insert(type);
1744 buildNeighborFE(type);
1745 return _fe_shape_data_neighbor[type]->_curl_phi;
1746 }
1747
1748 template <typename OutputType>
1750 {
1751 _need_curl.insert(type);
1752 buildFaceNeighborFE(type);
1753 return _fe_shape_data_face_neighbor[type]->_curl_phi;
1754 }
1755
1756 template <typename OutputType>
1758 {
1759 buildFE(type);
1760 return _fe_shape_data[type]->_div_phi;
1761 }
1762
1763 template <typename OutputType>
1765 {
1766 buildFaceFE(type);
1767 return _fe_shape_data_face[type]->_div_phi;
1768 }
1769
1770 template <typename OutputType>
1772 feDivPhiNeighbor(FEType type) const
1773 {
1774 buildNeighborFE(type);
1775 return _fe_shape_data_neighbor[type]->_div_phi;
1776 }
1777
1778 template <typename OutputType>
1780 feDivPhiFaceNeighbor(FEType type) const
1781 {
1782 buildFaceNeighborFE(type);
1783 return _fe_shape_data_face_neighbor[type]->_div_phi;
1784 }
1785
1787 Real elementVolume(const Elem * elem) const;
1788
1792 void setXFEM(std::shared_ptr<XFEMInterface> xfem) { _xfem = xfem; }
1793
1798 std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions);
1799
1808 void saveLocalArrayResidual(DenseVector<Number> & re,
1809 unsigned int i,
1810 unsigned int ntest,
1811 const RealEigenVector & v) const
1812 {
1813 for (unsigned int j = 0; j < v.size(); ++j, i += ntest)
1814 re(i) += v(j);
1815 }
1816
1817 void saveLocalADArray(std::vector<ADReal> & re,
1818 unsigned int i,
1819 unsigned int ntest,
1820 const ADRealEigenVector & v) const;
1821
1832 void saveDiagLocalArrayJacobian(DenseMatrix<Number> & ke,
1833 unsigned int i,
1834 unsigned int ntest,
1835 unsigned int j,
1836 unsigned int nphi,
1837 unsigned int ivar,
1838 const RealEigenVector & v) const
1839 {
1840 unsigned int pace = (_component_block_diagonal[ivar] ? 0 : nphi);
1841 for (unsigned int k = 0; k < v.size(); ++k, i += ntest, j += pace)
1842 ke(i, j) += v(k);
1843 }
1844
1857 void saveFullLocalArrayJacobian(DenseMatrix<Number> & ke,
1858 unsigned int i,
1859 unsigned int ntest,
1860 unsigned int j,
1861 unsigned int nphi,
1862 unsigned int ivar,
1863 unsigned int jvar,
1864 const RealEigenMatrix & v) const
1865 {
1866 if (ivar == jvar && _component_block_diagonal[ivar])
1867 {
1868 for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1869 ke(i, j) += v(k, k);
1870 }
1871 else
1872 {
1873 const unsigned int saved_j = j;
1874 for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1875 {
1876 j = saved_j;
1877 for (unsigned int l = 0; l < v.cols(); ++l, j += nphi)
1878 ke(i, j) += v(k, l);
1879 }
1880 }
1881 }
1882
1883 DenseVector<Real> getJacobianDiagonal(const DenseMatrix<Number> & ke)
1884 {
1885 unsigned int rows = ke.m();
1886 unsigned int cols = ke.n();
1887 DenseVector<Real> diag(rows);
1888 for (unsigned int i = 0; i < rows; i++)
1889 // % operation is needed to account for cases of no component coupling of array variables
1890 diag(i) = ke(i, i % cols);
1891 return diag;
1892 }
1893
1899 inline const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase & fe)
1900 {
1901 auto qrule = qrules(dim).vol.get();
1902 fe.attach_quadrature_rule(qrule);
1903 return qrule;
1904 }
1905
1911 inline const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase & fe)
1912 {
1913 auto qrule = qrules(dim).face.get();
1914 fe.attach_quadrature_rule(qrule);
1915 return qrule;
1916 }
1917
1922 void hasScalingVector();
1923
1932 void modifyArbitraryWeights(const std::vector<Real> & weights);
1933
1938
1943
1948
1952 const Elem * const & msmElem() const { return _msm_elem; }
1953
1958 void preparePRefinement();
1959
1963 void setCurrentLowerDElem(const Elem * const lower_d_elem);
1964
1965private:
1971 void reinitFE(const Elem * elem);
1972
1979 void reinitFEFace(const Elem * elem, unsigned int side);
1980
1981 void computeFaceMap(const Elem & elem, const unsigned int side, const std::vector<Real> & qw);
1982
1983 void reinitFEFaceNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1984
1985 void reinitFENeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1986
1987 template <typename Points, typename Coords>
1989 const Points & q_points,
1990 Coords & coord,
1991 SubdomainID sub_id);
1992
1994
1996
1998
2004 void modifyWeightsDueToXFEM(const Elem * elem);
2005
2012 void modifyFaceWeightsDueToXFEM(const Elem * elem, unsigned int side = 0);
2013
2018 template <typename OutputType>
2019 void computeGradPhiAD(const Elem * elem,
2020 unsigned int n_qp,
2023
2027 void resizeADMappingObjects(unsigned int n_qp, unsigned int dim);
2028
2033 void
2034 computeSinglePointMapAD(const Elem * elem, const std::vector<Real> & qw, unsigned p, FEBase * fe);
2035
2039 void addResidual(const VectorTag & vector_tag);
2043 void addResidualNeighbor(const VectorTag & vector_tag);
2048 void addResidualLower(const VectorTag & vector_tag);
2052 void addResidualScalar(const VectorTag & vector_tag);
2053
2057 void clearCachedResiduals(const VectorTag & vector_tag);
2058
2067 void cacheResidual(dof_id_type dof, Real value, TagID tag_id);
2068
2077 void cacheResidual(dof_id_type dof, Real value, const std::set<TagID> & tags);
2078
2083 void processLocalResidual(DenseVector<Number> & res_block,
2084 std::vector<dof_id_type> & dof_indices,
2085 const std::vector<Real> & scaling_factor);
2086
2090 void addResidualBlock(NumericVector<Number> & residual,
2091 DenseVector<Number> & res_block,
2092 const std::vector<dof_id_type> & dof_indices,
2093 const std::vector<Real> & scaling_factor);
2094
2098 void cacheResidualBlock(std::vector<Real> & cached_residual_values,
2099 std::vector<dof_id_type> & cached_residual_rows,
2100 DenseVector<Number> & res_block,
2101 const std::vector<dof_id_type> & dof_indices,
2102 const std::vector<Real> & scaling_factor);
2103
2107 void setResidualBlock(NumericVector<Number> & residual,
2108 DenseVector<Number> & res_block,
2109 const std::vector<dof_id_type> & dof_indices,
2110 const std::vector<Real> & scaling_factor);
2111
2116 DenseMatrix<Number> & jac_block,
2117 const MooseVariableBase & ivar,
2118 const MooseVariableBase & jvar,
2119 const std::vector<dof_id_type> & idof_indices,
2120 const std::vector<dof_id_type> & jdof_indices);
2121
2125 void cacheJacobianBlock(const DenseMatrix<Number> & jac_block,
2126 const MooseVariableBase & ivar,
2127 const MooseVariableBase & jvar,
2128 const std::vector<dof_id_type> & idof_indices,
2129 const std::vector<dof_id_type> & jdof_indices,
2130 TagID tag);
2131
2135 void cacheJacobianBlockNonzero(const DenseMatrix<Number> & jac_block,
2136 const MooseVariableBase & ivar,
2137 const MooseVariableBase & jvar,
2138 const std::vector<dof_id_type> & idof_indices,
2139 const std::vector<dof_id_type> & jdof_indices,
2140 TagID tag);
2141
2145 void addJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2146
2150 void cacheJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2151
2157 void clearCachedJacobian();
2158
2163 void buildFE(FEType type) const;
2164
2169 void buildFaceFE(FEType type) const;
2170
2175 void buildNeighborFE(FEType type) const;
2176
2181 void buildFaceNeighborFE(FEType type) const;
2182
2187 void buildLowerDFE(FEType type) const;
2188
2189 void buildLowerDDualFE(FEType type) const;
2190
2195 void buildVectorFE(FEType type) const;
2196
2201 void buildVectorFaceFE(FEType type) const;
2202
2207 void buildVectorNeighborFE(FEType type) const;
2208
2213 void buildVectorFaceNeighborFE(FEType type) const;
2214
2219 void buildVectorLowerDFE(FEType type) const;
2220 void buildVectorDualLowerDFE(FEType type) const;
2221
2226 void jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2227 {
2228 _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2229 }
2230
2235 char jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2236 {
2237 return _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2238 }
2239
2244 void jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2245 {
2246 _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2247 }
2248
2253 char jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2254 {
2255 return _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2256 }
2257
2262 void jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2263 {
2264 _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2265 }
2266
2271 char jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2272 {
2273 return _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2274 }
2275
2280 void jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2281 {
2282 _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2283 }
2284
2289 char jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2290 {
2291 return _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2292 }
2293
2297 void helpersRequestData();
2298
2301
2302 const bool _displaced;
2303
2307
2310
2313
2316
2318 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_ff_entry;
2320 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> _cm_fs_entry;
2322 std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> _cm_sf_entry;
2324 std::vector<std::pair<MooseVariableScalar *, MooseVariableScalar *>> _cm_ss_entry;
2326 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_nonlocal_entry;
2328 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_used;
2329 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_nonlocal_used;
2331 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_neighbor_used;
2333 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_lower_used;
2338
2340
2341 unsigned int _mesh_dimension;
2342
2345 const FEType _helper_type;
2346
2353
2356 std::vector<std::unique_ptr<FEBase>> _unique_fe_helper;
2357 std::vector<std::unique_ptr<FEBase>> _unique_fe_face_helper;
2358 std::vector<std::unique_ptr<FEBase>> _unique_fe_face_neighbor_helper;
2359 std::vector<std::unique_ptr<FEBase>> _unique_fe_neighbor_helper;
2360 std::vector<std::unique_ptr<FEBase>> _unique_fe_lower_helper;
2361
2364
2366 std::shared_ptr<XFEMInterface> _xfem;
2367
2369 std::map<FEType, FEBase *> _current_fe;
2371 std::map<FEType, FEBase *> _current_fe_face;
2373 std::map<FEType, FEBase *> _current_fe_neighbor;
2375 std::map<FEType, FEBase *> _current_fe_face_neighbor;
2376
2378 std::map<FEType, FEVectorBase *> _current_vector_fe;
2380 std::map<FEType, FEVectorBase *> _current_vector_fe_face;
2382 std::map<FEType, FEVectorBase *> _current_vector_fe_neighbor;
2384 std::map<FEType, FEVectorBase *> _current_vector_fe_face_neighbor;
2385
2386 /**** Volume Stuff ****/
2387
2389 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe;
2391 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe;
2393 std::map<unsigned int, FEBase *> _holder_fe_helper;
2414
2417 struct QRules
2418 {
2420 : vol(nullptr),
2421 face(nullptr),
2422 arbitrary_vol(nullptr),
2423 arbitrary_face(nullptr),
2424 neighbor(nullptr)
2425 {
2426 }
2427
2429 std::unique_ptr<libMesh::QBase> vol;
2431 std::unique_ptr<libMesh::QBase> face;
2433 std::unique_ptr<libMesh::QBase> fv_face;
2435 std::unique_ptr<ArbitraryQuadrature> arbitrary_vol;
2437 std::unique_ptr<ArbitraryQuadrature> arbitrary_face;
2439 std::unique_ptr<ArbitraryQuadrature> neighbor;
2440 };
2441
2446 std::unordered_map<SubdomainID, std::vector<QRules>> _qrules;
2447
2454 libMesh::QBase * qruleFace(const Elem * elem, unsigned int side);
2455 ArbitraryQuadrature * qruleArbitraryFace(const Elem * elem, unsigned int side);
2456
2457 template <typename T>
2458 T * qruleFaceHelper(const Elem * elem, unsigned int side, std::function<T *(QRules &)> rule_fn)
2459 {
2460 auto dim = elem->dim();
2461 auto neighbor = elem->neighbor_ptr(side);
2462 auto q = rule_fn(qrules(dim, elem->subdomain_id()));
2463 if (!neighbor)
2464 return q;
2465
2466 // find the maximum face quadrature order for all blocks the face is in
2467 auto neighbor_block = neighbor->subdomain_id();
2468 if (neighbor_block == elem->subdomain_id())
2469 return q;
2470
2471 auto q_neighbor = rule_fn(qrules(dim, neighbor_block));
2472 if (q->get_order() > q_neighbor->get_order())
2473 return q;
2474 return q_neighbor;
2475 }
2476
2477 inline QRules & qrules(unsigned int dim) { return qrules(dim, _current_subdomain_id); }
2478
2482 inline QRules & qrules(unsigned int dim, SubdomainID block)
2483 {
2484 if (_qrules.find(block) == _qrules.end())
2485 {
2486 mooseAssert(_qrules.find(Moose::ANY_BLOCK_ID) != _qrules.end(),
2487 "missing quadrature rules for specified block");
2488 mooseAssert(_qrules[Moose::ANY_BLOCK_ID].size() > dim,
2489 "quadrature rules not sized property for dimension");
2491 }
2492 mooseAssert(_qrules.find(block) != _qrules.end(),
2493 "missing quadrature rules for specified block");
2494 mooseAssert(_qrules[block].size() > dim, "quadrature rules not sized property for dimension");
2495 return _qrules[block][dim];
2496 }
2497
2498 /**** Face Stuff ****/
2499
2501 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face;
2503 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face;
2505 std::map<unsigned int, FEBase *> _holder_fe_face_helper;
2519 std::vector<Eigen::Map<RealDIMValue>> _mapped_normals;
2522
2524 std::vector<dof_id_type> _extra_elem_ids;
2526 std::vector<dof_id_type> _neighbor_extra_elem_ids;
2528 std::map<unsigned int, const std::vector<Point> *> _holder_normals;
2529
2530 /**** Neighbor Stuff ****/
2531
2533 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_neighbor;
2534 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face_neighbor;
2535 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_neighbor;
2536 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face_neighbor;
2537
2539 std::map<unsigned int, FEBase *> _holder_fe_neighbor_helper;
2540 std::map<unsigned int, FEBase *> _holder_fe_face_neighbor_helper;
2541
2543 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_lower;
2545 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_lower;
2547 std::map<unsigned int, FEBase *> _holder_fe_lower_helper;
2548
2562
2563 /********** mortar stuff *************/
2564
2566 const std::vector<Real> * _JxW_msm;
2568 std::unique_ptr<FEBase> _fe_msm;
2576
2580
2581protected:
2583 const Elem * _current_elem;
2591 unsigned int _current_side;
2609 const Node * _current_node;
2616
2631
2634
2635 /*
2636 * Residual contributions <tag_index, ivar>
2637 *
2638 * tag_index is the index into _residual_vector_tags, that is, _sub_Re[0] corresponds to the tag
2639 * with TagID _residual_vector_tags[0]._id
2640 *
2641 * When ivar corresponds to an array variable, the dense vector is in size of ndof * count,
2642 * where count is the number of components of the array variable. The local residual is ordered
2643 * as (r_i,j, i = 1,...,ndof; j = 1,...,count).
2644 *
2645 * Dense vectors for variables (ivar+i, i = 1,...,count) are empty.
2646 */
2647 std::vector<std::vector<DenseVector<Number>>> _sub_Re;
2648 std::vector<std::vector<DenseVector<Number>>> _sub_Rn;
2650 std::vector<std::vector<DenseVector<Number>>> _sub_Rl;
2651
2653 DenseVector<Number> _tmp_Re;
2654
2655 /*
2656 * Jacobian contributions <Tag, ivar, jvar>
2657 * When ivar corresponds to an array variable, the number of rows of the dense matrix is in size
2658 * of indof * icount, where icount is the number of components of ivar. When jvar corresponds to
2659 * an array variable, the number of columns of the dense matrix is in size of jndof * jcount,
2660 * where jcount is the number of components of jvar. The local residual is ordered as
2661 * (K_(i,j,k,l), k=1,...,jndof; l = 1,...,jcout; i = 1,...,indof; j = 1,...,icount).
2662 *
2663 * Dense matrices for variables (ivar+i, i = 1,...,icount) or (jvar+j, j = 1,...,jcount) are
2664 * empty.
2665 */
2666 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kee;
2667 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Keg;
2668
2670 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Ken;
2672 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kne;
2674 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knn;
2676 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kll;
2678 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kle;
2680 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kln;
2682 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kel;
2684 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knl;
2685
2687 DenseMatrix<Number> _tmp_Ke;
2688
2689 // Shape function values, gradients. second derivatives
2693
2697
2701
2705
2706 // Shape function values, gradients, second derivatives
2712
2718
2724
2730
2740
2750
2752 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data;
2753 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face;
2754 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_neighbor;
2755 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face_neighbor;
2756 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_lower;
2757 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_dual_lower;
2758
2760 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data;
2761 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face;
2762 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_neighbor;
2763 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face_neighbor;
2764 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_lower;
2765 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_dual_lower;
2766
2767 mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data;
2768 mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>> _ad_vector_grad_phi_data;
2769 mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data_face;
2770 mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>>
2772
2782 const std::vector<VectorTag> & _residual_vector_tags;
2783
2785 std::vector<std::vector<Real>> _cached_residual_values;
2786
2788 std::vector<std::vector<dof_id_type>> _cached_residual_rows;
2789
2791
2793 std::vector<std::vector<Real>> _cached_jacobian_values;
2795 std::vector<std::vector<dof_id_type>> _cached_jacobian_rows;
2797 std::vector<std::vector<dof_id_type>> _cached_jacobian_cols;
2798
2800
2805 std::vector<bool> _component_block_diagonal;
2806
2808 std::vector<dof_id_type> _temp_dof_indices;
2809
2811 std::vector<Point> _temp_reference_points;
2812
2814 std::vector<VectorValue<ADReal>> _ad_dxyzdxi_map;
2815 std::vector<VectorValue<ADReal>> _ad_dxyzdeta_map;
2816 std::vector<VectorValue<ADReal>> _ad_dxyzdzeta_map;
2817 std::vector<VectorValue<ADReal>> _ad_d2xyzdxi2_map;
2818 std::vector<VectorValue<ADReal>> _ad_d2xyzdxideta_map;
2819 std::vector<VectorValue<ADReal>> _ad_d2xyzdeta2_map;
2820 std::vector<ADReal> _ad_jac;
2823 std::vector<ADReal> _ad_dxidx_map;
2824 std::vector<ADReal> _ad_dxidy_map;
2825 std::vector<ADReal> _ad_dxidz_map;
2826 std::vector<ADReal> _ad_detadx_map;
2827 std::vector<ADReal> _ad_detady_map;
2828 std::vector<ADReal> _ad_detadz_map;
2829 std::vector<ADReal> _ad_dzetadx_map;
2830 std::vector<ADReal> _ad_dzetady_map;
2831 std::vector<ADReal> _ad_dzetadz_map;
2832
2838
2842 std::vector<std::pair<unsigned int, unsigned short>> _disp_numbers_and_directions;
2843
2844 mutable bool _calculate_xyz;
2847
2851
2852 mutable std::set<FEType> _need_second_derivative;
2853 mutable std::set<FEType> _need_second_derivative_neighbor;
2854 mutable std::set<FEType> _need_curl;
2855 mutable std::set<FEType> _need_div;
2856 mutable std::set<FEType> _need_face_div;
2857 mutable std::set<FEType> _need_neighbor_div;
2858 mutable std::set<FEType> _need_face_neighbor_div;
2859
2861 const NumericVector<Real> * _scaling_vector = nullptr;
2862
2869
2870 const Elem * _msm_elem = nullptr;
2871
2875 DenseVector<Number> _element_vector;
2876
2880 DenseMatrix<Number> _element_matrix;
2881
2885 std::vector<dof_id_type> _row_indices, _column_indices;
2886
2889
2892};
2893
2894template <typename OutputType>
2896Assembly::fePhiLower(FEType type) const
2897{
2898 buildLowerDFE(type);
2899 return _fe_shape_data_lower[type]->_phi;
2900}
2901
2902template <typename OutputType>
2905{
2906 buildLowerDDualFE(type);
2907 return _fe_shape_data_dual_lower[type]->_phi;
2908}
2909
2910template <typename OutputType>
2913{
2914 buildLowerDFE(type);
2915 return _fe_shape_data_lower[type]->_grad_phi;
2916}
2917
2918template <typename OutputType>
2921{
2922 buildLowerDDualFE(type);
2923 return _fe_shape_data_dual_lower[type]->_grad_phi;
2924}
2925
2926template <>
2928Assembly::feADGradPhi<RealVectorValue>(FEType type) const
2929{
2930 return _ad_vector_grad_phi_data[type];
2931}
2932
2933template <>
2935Assembly::feADGradPhiFace<RealVectorValue>(FEType type) const
2936{
2937 return _ad_vector_grad_phi_data_face[type];
2938}
2939
2940template <>
2942Assembly::fePhi<VectorValue<Real>>(FEType type) const;
2943
2944template <>
2946Assembly::feGradPhi<VectorValue<Real>>(FEType type) const;
2947
2948template <>
2950Assembly::feSecondPhi<VectorValue<Real>>(FEType type) const;
2951
2952template <>
2954Assembly::fePhiLower<VectorValue<Real>>(FEType type) const;
2955
2956template <>
2958Assembly::feDualPhiLower<VectorValue<Real>>(FEType type) const;
2959
2960template <>
2962Assembly::feGradPhiLower<VectorValue<Real>>(FEType type) const;
2963
2964template <>
2966Assembly::feGradDualPhiLower<VectorValue<Real>>(FEType type) const;
2967
2968template <>
2970Assembly::fePhiFace<VectorValue<Real>>(FEType type) const;
2971
2972template <>
2974Assembly::feGradPhiFace<VectorValue<Real>>(FEType type) const;
2975
2976template <>
2978Assembly::feSecondPhiFace<VectorValue<Real>>(FEType type) const;
2979
2980template <>
2982Assembly::fePhiNeighbor<VectorValue<Real>>(FEType type) const;
2983
2984template <>
2986Assembly::feGradPhiNeighbor<VectorValue<Real>>(FEType type) const;
2987
2988template <>
2990Assembly::feSecondPhiNeighbor<VectorValue<Real>>(FEType type) const;
2991
2992template <>
2994Assembly::fePhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
2995
2996template <>
2998Assembly::feGradPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
2999
3000template <>
3002Assembly::feSecondPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3003
3004template <>
3006Assembly::feCurlPhi<VectorValue<Real>>(FEType type) const;
3007
3008template <>
3010Assembly::feCurlPhiFace<VectorValue<Real>>(FEType type) const;
3011
3012template <>
3014Assembly::feCurlPhiNeighbor<VectorValue<Real>>(FEType type) const;
3015
3016template <>
3018Assembly::feCurlPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3019
3020template <>
3022Assembly::feDivPhi<VectorValue<Real>>(FEType type) const;
3023
3024template <>
3026Assembly::feDivPhiFace<VectorValue<Real>>(FEType type) const;
3027
3028template <>
3030Assembly::feDivPhiNeighbor<VectorValue<Real>>(FEType type) const;
3031
3032template <>
3034Assembly::feDivPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3035
3036template <>
3038Assembly::adGradPhi<RealVectorValue>(const MooseVariableFE<RealVectorValue> & v) const
3039{
3040 return _ad_vector_grad_phi_data.at(v.feType());
3041}
3042
3043template <typename Residuals, typename Indices>
3044void
3045Assembly::cacheResiduals(const Residuals & residuals,
3046 const Indices & input_row_indices,
3047 const Real scaling_factor,
3049 const std::set<TagID> & vector_tags)
3050{
3051 mooseAssert(residuals.size() == input_row_indices.size(),
3052 "The number of residuals should match the number of dof indices");
3053 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3054
3055 if (!computingResidual() || vector_tags.empty())
3056 return;
3057
3058 if (residuals.size() == 1)
3059 {
3060 // No constraining is required. (This is likely a finite volume computation if we only have a
3061 // single dof)
3063 residuals, input_row_indices, scaling_factor, LocalDataKey{}, vector_tags);
3064 return;
3065 }
3066
3067 // Need to make a copy because we might modify this in constrain_element_vector
3068 _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3069
3071 for (const auto i : index_range(_row_indices))
3072 _element_vector(i) = MetaPhysicL::raw_value(residuals[i]) * scaling_factor;
3073
3074 // At time of writing, this method doesn't do anything with the asymmetric_constraint_rows
3075 // argument, but we set it to false to be consistent with processLocalResidual
3077 _element_vector, _row_indices, /*asymmetric_constraint_rows=*/false);
3078
3079 for (const auto i : index_range(_row_indices))
3080 cacheResidual(_row_indices[i], _element_vector(i), vector_tags);
3081}
3082
3083template <typename Residuals, typename Indices>
3084void
3086 const Indices & row_indices,
3087 const Real scaling_factor,
3089 const std::set<TagID> & vector_tags)
3090{
3091 mooseAssert(residuals.size() == row_indices.size(),
3092 "The number of residuals should match the number of dof indices");
3093 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3094
3095 if (computingResidual() && !vector_tags.empty())
3096 for (const auto i : index_range(row_indices))
3098 row_indices[i], MetaPhysicL::raw_value(residuals[i]) * scaling_factor, vector_tags);
3099}
3100
3101template <typename Residuals, typename Indices>
3102void
3103Assembly::cacheJacobian(const Residuals & residuals,
3104 const Indices & input_row_indices,
3105 const Real scaling_factor,
3107 const std::set<TagID> & matrix_tags)
3108{
3109 if (!computingJacobian() || matrix_tags.empty())
3110 return;
3111
3112 if (residuals.size() == 1)
3113 {
3114 // No constraining is required. (This is likely a finite volume computation if we only have a
3115 // single dof)
3117 residuals, input_row_indices, scaling_factor, LocalDataKey{}, matrix_tags);
3118 return;
3119 }
3120
3121 const auto & compare_dofs = residuals[0].derivatives().nude_indices();
3122#ifndef NDEBUG
3123 auto compare_dofs_set = std::set<dof_id_type>(compare_dofs.begin(), compare_dofs.end());
3124
3125 for (const auto i : make_range(decltype(residuals.size())(1), residuals.size()))
3126 {
3127 const auto & residual = residuals[i];
3128 auto current_dofs_set = std::set<dof_id_type>(residual.derivatives().nude_indices().begin(),
3129 residual.derivatives().nude_indices().end());
3130 mooseAssert(compare_dofs_set == current_dofs_set,
3131 "We're going to see whether the dof sets are the same. IIRC the degree of freedom "
3132 "dependence (as indicated by the dof index set held by the ADReal) has to be the "
3133 "same for every residual passed to this method otherwise constrain_element_matrix "
3134 "will not work.");
3135 }
3136#endif
3137 _column_indices.assign(compare_dofs.begin(), compare_dofs.end());
3138
3139 // If there's no derivatives then there is nothing to do. Moreover, if we pass zero size column
3140 // indices to constrain_element_matrix then we will potentially get errors out of BLAS
3141 if (!_column_indices.size())
3142 return;
3143
3144 // Need to make a copy because we might modify this in constrain_element_matrix
3145 _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3146
3148 for (const auto i : index_range(_row_indices))
3149 {
3150 const auto & sparse_derivatives = residuals[i].derivatives();
3151
3152 for (const auto j : index_range(_column_indices))
3153 _element_matrix(i, j) = sparse_derivatives[_column_indices[j]] * scaling_factor;
3154 }
3155
3157
3158 for (const auto i : index_range(_row_indices))
3159 for (const auto j : index_range(_column_indices))
3160 cacheJacobian(_row_indices[i], _column_indices[j], _element_matrix(i, j), {}, matrix_tags);
3161}
3162
3163template <typename Residuals, typename Indices>
3164void
3166 const Indices & row_indices,
3167 const Real scaling_factor,
3169 const std::set<TagID> & matrix_tags)
3170{
3171 mooseAssert(residuals.size() == row_indices.size(),
3172 "The number of residuals should match the number of dof indices");
3173 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3174
3175 if (!computingJacobian() || matrix_tags.empty())
3176 return;
3177
3178 for (const auto i : index_range(row_indices))
3179 {
3180 const auto row_index = row_indices[i];
3181
3182 const auto & sparse_derivatives = residuals[i].derivatives();
3183 const auto & column_indices = sparse_derivatives.nude_indices();
3184 const auto & raw_derivatives = sparse_derivatives.nude_data();
3185
3186 for (std::size_t j = 0; j < column_indices.size(); ++j)
3188 row_index, column_indices[j], raw_derivatives[j] * scaling_factor, {}, matrix_tags);
3189 }
3190}
3191
3192inline const Real &
3198
3199inline const Real &
3205
3206inline void
3208 std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions)
3209{
3210 _disp_numbers_and_directions = std::move(disp_numbers_and_directions);
3211}
3212
3213inline void
3214Assembly::setCurrentLowerDElem(const Elem * const lower_d_elem)
3215{
3216 _current_lower_d_elem = lower_d_elem;
3217}
MooseVariableFE< Real > MooseVariable
Definition Assembly.h:60
MooseVariableFE< RealEigenVector > ArrayMooseVariable
Definition Assembly.h:62
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:61
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:687
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:2737
VariablePhiValue _phi
Definition Assembly.h:2734
VariablePhiGradient _grad_phi
Definition Assembly.h:2735
VariablePhiSecond _second_phi
Definition Assembly.h:2736
VariablePhiDivergence _div_phi
Definition Assembly.h:2738
Key structure for APIs manipulating global vectors/matrices.
Definition Assembly.h:836
GlobalDataKey(const GlobalDataKey &)
Definition Assembly.h:845
Key structure for APIs adding/caching local element residuals/Jacobians.
Definition Assembly.h:854
LocalDataKey(const LocalDataKey &)
Definition Assembly.h:859
VectorVariablePhiValue _phi
Definition Assembly.h:2744
VectorVariablePhiGradient _grad_phi
Definition Assembly.h:2745
VectorVariablePhiSecond _second_phi
Definition Assembly.h:2746
VectorVariablePhiCurl _curl_phi
Definition Assembly.h:2747
VectorVariablePhiDivergence _div_phi
Definition Assembly.h:2748
Keeps track of stuff related to assembling.
Definition Assembly.h:101
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:1144
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kll
dlower/dlower
Definition Assembly.h:2676
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:2805
void cacheJacobianNonlocal(GlobalDataKey)
Takes the values that are currently in _sub_Keg and appends them to the cached values.
Definition Assembly.C:4110
const VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1385
SystemBase & _sys
Definition Assembly.h:2299
std::map< unsigned int, FEBase * > _holder_fe_lower_helper
helper object for transforming coordinates for lower dimensional element quadrature points
Definition Assembly.h:2547
const VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1346
std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > _cm_sf_entry
Entries in the coupling matrix for scalar variables vs field variables.
Definition Assembly.h:2322
void addJacobian(GlobalDataKey)
Adds all local Jacobian to the global Jacobian matrices.
Definition Assembly.C:3892
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:2262
const Real & neighborLowerDElemVolume() const
Definition Assembly.h:3200
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:1857
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:3419
void assignDisplacements(std::vector< std::pair< unsigned int, unsigned short > > &&disp_numbers_and_directions)
Assign the displacement numbers and directions.
Definition Assembly.h:3207
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:135
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:2760
const bool & _computing_jacobian
Whether we are currently computing the Jacobian.
Definition Assembly.h:2312
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition Assembly.h:2405
VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1461
const std::vector< Real > * _JxW_msm
A JxW for working on mortar segement elements.
Definition Assembly.h:2566
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kee
Definition Assembly.h:2666
std::set< FEType > _need_face_neighbor_div
Definition Assembly.h:2858
VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1518
void prepareLowerD()
Prepare the Jacobians and residuals for a lower dimensional element.
Definition Assembly.C:2885
void modifyWeightsDueToXFEM(const Elem *elem)
Update the integration weights for XFEM partial elements.
Definition Assembly.C:4552
VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1501
void reinitFVFace(const FaceInfo &fi)
Definition Assembly.C:1894
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFace(FEType type) const
Definition Assembly.h:1658
VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1506
std::vector< std::vector< DenseVector< Number > > > _sub_Re
Definition Assembly.h:2647
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:3477
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:2880
VectorVariablePhiValue _vector_phi_face_neighbor
Definition Assembly.h:2725
const VariablePhiValue & phiFace() const
Definition Assembly.h:1326
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & nonlocalCouplingEntries()
Definition Assembly.h:1295
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:1469
MooseArray< Real > _curvatures
Definition Assembly.h:2836
std::vector< std::unique_ptr< FEBase > > _unique_fe_lower_helper
Definition Assembly.h:2360
MooseArray< Real > _coord_neighbor
The current coordinate transformation coefficients.
Definition Assembly.h:2558
const OutputTools< OutputType >::VariablePhiValue & fePhiFaceNeighbor(FEType type) const
Definition Assembly.h:1701
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1478
const bool _displaced
Definition Assembly.h:2302
void reinitFEFaceNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition Assembly.C:1610
void reinitFENeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition Assembly.C:1669
VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1543
void prepareVariableNonlocal(MooseVariableFieldBase *var)
Definition Assembly.C:2817
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhi(FEType type) const
Definition Assembly.h:1757
void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector< dof_id_type > &dof_indices)
Definition Assembly.C:2937
VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1547
std::vector< ADReal > _ad_dzetady_map
Definition Assembly.h:2830
VariablePhiGradient _grad_phi
Definition Assembly.h:2691
libMesh::QBase * _current_qrule_face
quadrature rule used on faces
Definition Assembly.h:2509
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiNeighbor(FEType type) const
Definition Assembly.h:1772
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:2802
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:2331
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:3085
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:2226
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:3256
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1749
VectorVariablePhiCurl _vector_curl_phi
Definition Assembly.h:2710
MooseArray< VectorValue< ADReal > > _ad_q_points
Definition Assembly.h:2822
bool _current_side_volume_computed
Boolean to indicate whether current element side volumes has been computed.
Definition Assembly.h:2615
MooseArray< Real > _current_JxW_face
The current transformed jacobian weights on a face.
Definition Assembly.h:2515
const FEType _helper_type
The finite element type of the FE helper classes.
Definition Assembly.h:2345
Real _current_elem_volume
Volume of the current element.
Definition Assembly.h:2589
const MooseArray< Point > & normals() const
Returns the array of normals for quadrature points on a current side.
Definition Assembly.h:348
VectorVariablePhiSecond _vector_second_phi_face_neighbor
Definition Assembly.h:2727
const VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1380
void cacheJacobianCoupledVarPair(const MooseVariableBase &ivar, const MooseVariableBase &jvar)
Caches element matrix for ivar rows and jvar columns.
Definition Assembly.C:4094
const VariablePhiValue & phi(const MooseVariableField< Real > &) const
Definition Assembly.h:1317
bool _building_helpers
Whether we are currently building the FE classes for the helpers.
Definition Assembly.h:2363
void addJacobianScalar(GlobalDataKey)
Add Jacobians for pairs of scalar variables into the global Jacobian matrices.
Definition Assembly.C:4475
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:1318
FEBase * _current_fe_face_helper
helper object for transforming coordinates
Definition Assembly.h:2507
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:3700
FEBase * _current_fe_helper
The current helper object for transforming coordinates.
Definition Assembly.h:2395
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called....
Definition Assembly.h:2633
VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1531
void addJacobianLowerD(GlobalDataKey)
Add portions of the Jacobian of LowerLower, LowerSecondary, and SecondaryLower for boundary condition...
Definition Assembly.C:4043
libMesh::QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition Assembly.h:2397
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:326
const MooseArray< Point > & qPoints() const
Returns the reference to the quadrature points.
Definition Assembly.h:249
const bool & _computing_residual
Whether we are currently computing the residual.
Definition Assembly.h:2309
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:1808
MooseArray< VectorValue< ADReal > > _ad_normals
Definition Assembly.h:2834
VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1555
libMesh::QBase * writeableQRule(unsigned int dim, SubdomainID block, InternalDataKey)
Returns the pointer to the quadrature of specified block and dimension.
Definition Assembly.h:239
const std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > & scalarFieldCouplingEntries() const
Definition Assembly.h:1305
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:4482
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:4599
void computeCurrentFaceVolume()
Definition Assembly.C:1810
VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1497
const VariablePhiGradient & gradPhiFace() const
Definition Assembly.h:1328
bool _need_JxW_neighbor
Flag to indicate that JxW_neighbor is needed.
Definition Assembly.h:2554
VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1493
const BoundaryID & currentBoundaryID() const
Return the current boundary ID.
Definition Assembly.h:420
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhi(FEType type) const
Definition Assembly.h:1630
VectorVariablePhiSecond _vector_second_phi
Definition Assembly.h:2709
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiLower(FEType type) const
Definition Assembly.h:2912
bool _user_added_fe_of_helper_type
Whether user code requested a FEType the same as our _helper_type.
Definition Assembly.h:2348
VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1539
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:183
VectorVariablePhiCurl _vector_curl_phi_neighbor
Definition Assembly.h:2722
void setCurrentNeighborSubdomainID(SubdomainID i)
set the current subdomain ID
Definition Assembly.h:493
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data
Definition Assembly.h:2768
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe
Each dimension's actual vector fe objects indexed on type.
Definition Assembly.h:2391
const MooseArray< ADPoint > & adQPointsFace() const
Definition Assembly.h:392
MooseArray< ADReal > _ad_JxW_face
Definition Assembly.h:2833
bool _calculate_xyz
Definition Assembly.h:2844
const VariablePhiValue & phi() const
Definition Assembly.h:1311
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:1368
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition Assembly.h:2585
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face
Definition Assembly.h:2761
const libMesh::CouplingMatrix & _nonlocal_cm
Definition Assembly.h:2306
VectorVariablePhiDivergence _vector_div_phi_neighbor
Definition Assembly.h:2723
Real _current_neighbor_volume
Volume of the current neighbor.
Definition Assembly.h:2607
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:171
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:2626
DenseVector< Real > getJacobianDiagonal(const DenseMatrix< Number > &ke)
Definition Assembly.h:1883
Moose::CoordinateSystemType _coord_type
The coordinate system.
Definition Assembly.h:2409
VectorVariablePhiGradient _vector_grad_phi_face_neighbor
Definition Assembly.h:2726
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:2231
std::map< FEType, FEBase * > _current_fe_neighbor
The "neighbor" fe object that matches the current elem.
Definition Assembly.h:2373
const OutputTools< OutputType >::VariablePhiValue & fePhiLower(FEType type) const
Definition Assembly.h:2896
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_lower
FE objects for lower dimensional elements.
Definition Assembly.h:2543
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
Definition Assembly.h:2648
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:2271
VariablePhiValue _phi_face_neighbor
Definition Assembly.h:2702
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:369
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:2519
const libMesh::DofMap & _dof_map
DOF map.
Definition Assembly.h:2335
const VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1333
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:2534
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1474
void prepareScalar()
Definition Assembly.C:2988
const OutputTools< OutputType >::VariablePhiValue & feDualPhiLower(FEType type) const
Definition Assembly.h:2904
std::set< FEType > _need_second_derivative_neighbor
Definition Assembly.h:2853
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Ken
jacobian contributions from the element and neighbor <Tag, ivar, jvar>
Definition Assembly.h:2670
std::vector< VectorValue< ADReal > > _ad_dxyzdxi_map
AD quantities.
Definition Assembly.h:2814
VariablePhiSecond _second_phi_face
Definition Assembly.h:2696
const MooseArray< ADReal > & adCurvatures() const
Definition Assembly.C:4832
bool _prepared_for_p_refinement
Whether helper FEs have been prepared for p-refinement.
Definition Assembly.h:2888
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_neighbor_helper
Definition Assembly.h:2358
std::vector< Point > _temp_reference_points
Temporary work data for reinitAtPhysical()
Definition Assembly.h:2811
std::vector< std::pair< MooseVariableScalar *, MooseVariableScalar * > > _cm_ss_entry
Entries in the coupling matrix for scalar variables.
Definition Assembly.h:2324
const Elem * _current_lower_d_elem
The current lower dimensional element.
Definition Assembly.h:2618
unsigned int _current_side
The current side of the selected element (valid only when working with sides)
Definition Assembly.h:2591
const bool & _computing_residual_and_jacobian
Whether we are currently computing the residual and Jacobian.
Definition Assembly.h:2315
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:1960
const OutputTools< OutputType >::VariablePhiGradient & feGradDualPhiLower(FEType type) const
Definition Assembly.h:2920
std::unordered_map< SubdomainID, std::vector< QRules > > _qrules
Holds quadrature rules for each dimension.
Definition Assembly.h:2446
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:1829
std::map< FEType, FEVectorBase * > _current_vector_fe
The "volume" vector fe object that matches the current elem.
Definition Assembly.h:2378
std::vector< VectorValue< ADReal > > _ad_dxyzdzeta_map
Definition Assembly.h:2816
VariablePhiValue & phiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1573
VariablePhiSecond & secondPhi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1571
VariablePhiGradient _grad_phi_neighbor
Definition Assembly.h:2699
bool computingResidualAndJacobian() const
Definition Assembly.h:1947
libMesh::QBase *const & writeableQRuleNeighbor()
Returns the reference to the current quadrature being used on a current neighbor.
Definition Assembly.h:518
std::unique_ptr< FEBase > _fe_msm
A FE object for working on mortar segement elements.
Definition Assembly.h:2568
std::vector< ADReal > _ad_detadx_map
Definition Assembly.h:2826
void addJacobianNonlocal(GlobalDataKey)
Adds non-local Jacobian to the global Jacobian matrices.
Definition Assembly.C:3905
const VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1342
const unsigned int & neighborSide() const
Returns the current neighboring side.
Definition Assembly.h:443
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:3374
bool computingResidual() const
Definition Assembly.h:1937
void prepareNeighbor()
Definition Assembly.C:2847
VectorVariablePhiGradient _vector_grad_phi_neighbor
Definition Assembly.h:2720
const MooseArray< Point > & physicalPoints() const
The current points in physical space where we have reinited through reinitAtPhysical()
Definition Assembly.h:261
const Elem *const & elem() const
Return the current element.
Definition Assembly.h:405
std::map< FEType, FEVectorBase * > _current_vector_fe_face_neighbor
The "neighbor face" vector fe object that matches the current elem.
Definition Assembly.h:2384
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:2455
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition Assembly.h:2611
std::vector< ADReal > _ad_dxidx_map
Definition Assembly.h:2823
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction)
Definition Assembly.h:2687
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:1717
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:3045
void setXFEM(std::shared_ptr< XFEMInterface > xfem)
Set the pointer to the XFEM controller object.
Definition Assembly.h:1792
VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1522
const Elem *const & neighborLowerDElem() const
Return the neighboring lower dimensional element.
Definition Assembly.h:473
const Elem * _current_neighbor_side_elem
The current side element of the ncurrent neighbor element.
Definition Assembly.h:2603
std::vector< ADReal > _ad_dxidz_map
Definition Assembly.h:2825
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:3491
VariablePhiGradient _grad_phi_face_neighbor
Definition Assembly.h:2703
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_neighbor
Definition Assembly.h:2535
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kle
dlower/dsecondary (or dlower/delement)
Definition Assembly.h:2678
MooseArray< ADReal > _ad_JxW
Definition Assembly.h:2821
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:3459
void copyFaceShapes(MooseVariableField< T > &v)
Definition Assembly.C:3075
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:3352
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction)
Definition Assembly.h:2653
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries()
Definition Assembly.h:1285
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:3324
const VariablePhiValue & phiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1327
bool _calculate_ad_coord
Whether to calculate coord with AD.
Definition Assembly.h:2850
const libMesh::CouplingMatrix * _cm
Coupling matrices.
Definition Assembly.h:2305
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:2235
VectorVariablePhiCurl _vector_curl_phi_face
Definition Assembly.h:2716
VariablePhiGradient & gradPhi(const MooseVariableField< Real > &)
Definition Assembly.h:1457
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition Assembly.h:2513
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_neighbor
Definition Assembly.h:2762
void cacheJacobianNeighbor(GlobalDataKey)
Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached val...
Definition Assembly.C:4132
const libMesh::QBase *const & qRuleMortar() const
Returns a reference to the quadrature rule for the mortar segments.
Definition Assembly.h:703
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:3196
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:2327
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:4843
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knn
jacobian contributions from the neighbor <Tag, ivar, jvar>
Definition Assembly.h:2674
const MooseArray< ADPoint > & adQPoints() const
Definition Assembly.h:386
libMesh::QBase *const & writeableQRule()
Returns the reference to the current quadrature being used.
Definition Assembly.h:232
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:2680
VariablePhiSecond & secondPhi(const MooseVariableField< Real > &)
Definition Assembly.h:1458
libMesh::QBase * _current_qrule_neighbor
quadrature rule used on neighbors
Definition Assembly.h:2550
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:1420
VariablePhiGradient _grad_phi_face
Definition Assembly.h:2695
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:2333
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries() const
Definition Assembly.h:1290
const std::vector< Point > & qPointsMortar() const
Returns the reference to the mortar segment element quadrature points.
Definition Assembly.h:255
std::map< unsigned int, const std::vector< Point > * > _holder_normals
Holds pointers to the dimension's normal vectors.
Definition Assembly.h:2528
const OutputTools< OutputType >::VariablePhiValue & fePhiNeighbor(FEType type) const
Definition Assembly.h:1679
libMesh::QBase *const & writeableQRuleFace()
Returns the reference to the current quadrature being used on a current face.
Definition Assembly.h:319
void setCurrentSubdomainID(SubdomainID i)
set the current subdomain ID
Definition Assembly.h:415
Real elementVolume(const Elem *elem) const
On-demand computation of volume element accounting for RZ/RSpherical.
Definition Assembly.C:3792
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition Assembly.h:2533
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:1355
const VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1329
const OutputTools< OutputType >::VariablePhiGradient & feGradPhi(FEType type) const
Definition Assembly.h:1617
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFace(FEType type) const
Definition Assembly.h:1733
const unsigned int & side() const
Returns the current side.
Definition Assembly.h:437
std::vector< VectorValue< ADReal > > _ad_d2xyzdeta2_map
Definition Assembly.h:2819
BoundaryID _current_boundary_id
The current boundary ID.
Definition Assembly.h:2587
MooseArray< std::vector< Point > > _current_tangents
The current tangent vectors at the quadrature points.
Definition Assembly.h:2521
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_helper
Definition Assembly.h:2357
std::map< FEType, FEBase * > _current_fe
The "volume" fe object that matches the current elem.
Definition Assembly.h:2369
VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1510
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhiFace(FEType type) const
Definition Assembly.h:1665
const std::vector< Eigen::Map< RealDIMValue > > & mappedNormals() const
Definition Assembly.h:353
const VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1376
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:2962
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_lower
Definition Assembly.h:2756
VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1489
const Real & lowerDElemVolume() const
Definition Assembly.h:3193
VariablePhiSecond _second_phi
Definition Assembly.h:2692
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:3756
std::vector< VectorValue< ADReal > > _ad_d2xyzdxideta_map
Definition Assembly.h:2818
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:2482
const MooseArray< ADPoint > & adNormals() const
Definition Assembly.h:384
std::vector< std::pair< unsigned int, unsigned short > > _disp_numbers_and_directions
Container of displacement numbers and directions.
Definition Assembly.h:2842
T * qruleFaceHelper(const Elem *elem, unsigned int side, std::function< T *(QRules &)> rule_fn)
Definition Assembly.h:2458
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face
types of vector finite elements
Definition Assembly.h:2503
VectorVariablePhiValue _vector_phi
Definition Assembly.h:2707
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:4460
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiNeighbor(FEType type) const
Definition Assembly.h:1693
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension's actual fe objects indexed on type.
Definition Assembly.h:2389
std::set< FEType > _need_curl
Definition Assembly.h:2854
const VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1359
const VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1372
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:2356
unsigned int numExtraElemIntegers() const
Number of extra element integers Assembly tracked.
Definition Assembly.h:364
const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase &fe)
Attaches the current elem/volume quadrature rule to the given fe.
Definition Assembly.h:1899
void activateDual()
Indicates that dual shape functions are used for mortar constraint.
Definition Assembly.h:608
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_ff_entry
Entries in the coupling matrix for field variables.
Definition Assembly.h:2318
const Moose::CoordinateSystemType & coordSystem() const
Get the coordinate system type.
Definition Assembly.h:307
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_nonlocal_entry
Entries in the coupling matrix for field variables for nonlocal calculations.
Definition Assembly.h:2326
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition Assembly.h:2613
VectorVariablePhiSecond _vector_second_phi_neighbor
Definition Assembly.h:2721
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > & fieldScalarCouplingEntries() const
Definition Assembly.h:1300
const VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1364
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:1115
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1709
void buildLowerDDualFE(FEType type) const
Definition Assembly.C:398
VariablePhiValue _phi_neighbor
Definition Assembly.h:2698
VariablePhiValue & phiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1460
void addCachedResidualDirectly(NumericVector< Number > &residual, GlobalDataKey, const VectorTag &vector_tag)
Adds the values that have been cached by calling cacheResidual(), cacheResidualNeighbor(),...
Definition Assembly.C:3550
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition Assembly.h:2501
std::vector< ADReal > _ad_jac
Definition Assembly.h:2820
void addJacobianNeighbor(GlobalDataKey)
Add ElementNeighbor, NeighborElement, and NeighborNeighbor portions of the Jacobian for compute objec...
Definition Assembly.C:3927
VectorVariablePhiCurl _vector_curl_phi_face_neighbor
Definition Assembly.h:2728
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:3825
VariablePhiGradient & gradPhi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1570
const std::vector< VectorTag > & _residual_vector_tags
The residual vector tags that Assembly could possibly contribute to.
Definition Assembly.h:2782
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition Assembly.h:2597
VectorVariablePhiDivergence _vector_div_phi_face
Definition Assembly.h:2717
bool _user_added_fe_face_neighbor_of_helper_type
Definition Assembly.h:2350
const MooseArray< ADReal > & adJxWFace() const
Definition Assembly.h:271
std::vector< ADReal > _ad_dzetadx_map
Definition Assembly.h:2829
std::vector< dof_id_type > _column_indices
Definition Assembly.h:2885
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:123
const VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1338
MooseMesh & _mesh
Definition Assembly.h:2339
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:3155
std::vector< ADReal > _ad_detadz_map
Definition Assembly.h:2828
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:1133
std::vector< dof_id_type > _temp_dof_indices
Temporary work vector to keep from reallocating it.
Definition Assembly.h:2808
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition Assembly.h:2328
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:2511
VectorVariablePhiGradient _vector_grad_phi
Definition Assembly.h:2708
const VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1389
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:2289
void prepareJacobianBlock()
Sizes and zeroes the Jacobian blocks used for the current element.
Definition Assembly.C:2721
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:2280
void resizeADMappingObjects(unsigned int n_qp, unsigned int dim)
resize any objects that contribute to automatic differentiation-related mapping calculations
Definition Assembly.C:1008
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:3301
const libMesh::QBase *const & qRuleNeighbor() const
Returns the reference to the current quadrature being used on a current neighbor.
Definition Assembly.h:509
std::vector< VectorValue< ADReal > > _ad_dxyzdeta_map
Definition Assembly.h:2815
bool computingJacobian() const
Definition Assembly.h:1942
const Node * _current_node
The current node we are working with.
Definition Assembly.h:2609
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1596
DenseVector< Number > & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
Get residual block for lower.
Definition Assembly.h:1124
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data_face
Definition Assembly.h:2771
void cacheJacobianMortar(GlobalDataKey)
Cache all portions of the Jacobian, e.g.
Definition Assembly.C:4170
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:2337
bool _calculate_face_xyz
Definition Assembly.h:2845
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kel
dsecondary/dlower (or delement/dlower)
Definition Assembly.h:2682
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_dual_lower
Definition Assembly.h:2765
MooseArray< Point > _current_normals
The current Normal vectors at the quadrature points.
Definition Assembly.h:2517
void cacheJacobian(GlobalDataKey)
Takes the values that are currently in _sub_Kee and appends them to the cached values.
Definition Assembly.C:4080
bool _calculate_curvatures
Definition Assembly.h:2846
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME)
Definition Assembly.h:2785
const Node *const & node() const
Returns the reference to the node.
Definition Assembly.h:536
std::vector< std::vector< dof_id_type > > _cached_jacobian_cols
Column where the corresponding cached value should go.
Definition Assembly.h:2797
ArbitraryQuadrature * _current_qrule_arbitrary
The current arbitrary quadrature rule used within the element interior.
Definition Assembly.h:2401
void computeADFace(const Elem &elem, const unsigned int side)
compute AD things on an element face
Definition Assembly.C:2148
libMesh::ElemSideBuilder _current_side_elem_builder
In place side element builder for _current_side_elem.
Definition Assembly.h:2864
const VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1397
void setCurrentBoundaryID(BoundaryID i)
set the current boundary ID
Definition Assembly.h:425
void computeFaceMap(const Elem &elem, const unsigned int side, const std::vector< Real > &qw)
Definition Assembly.C:1385
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_lower
Vector FE objects for lower dimensional elements.
Definition Assembly.h:2545
void setCachedJacobian(GlobalDataKey)
Sets previously-cached Jacobian values via SparseMatrix::set() calls.
Definition Assembly.C:4511
const VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1416
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:1954
void preparePRefinement()
Prepare helper FEs for p-refinement.
Definition Assembly.C:4876
std::vector< std::vector< DenseVector< Number > > > _sub_Rl
residual contributions for each variable from the lower dimensional element
Definition Assembly.h:2650
std::map< FEType, FEBase * > _current_fe_face
The "face" fe object that matches the current elem.
Definition Assembly.h:2371
VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1488
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
Definition Assembly.C:3835
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:2253
VectorVariablePhiDivergence _vector_div_phi
Definition Assembly.h:2711
const OutputTools< OutputType >::VariablePhiValue & fePhi(FEType type) const
Definition Assembly.h:1610
const VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1450
const VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1401
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
Definition Assembly.C:1856
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:378
const VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1425
std::vector< dof_id_type > _neighbor_extra_elem_ids
Extra element IDs of neighbor.
Definition Assembly.h:2526
libMesh::ElemSideBuilder _compute_face_map_side_elem_builder
In place side element builder for computeFaceMap()
Definition Assembly.h:2868
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:3427
VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1527
void modifyFaceWeightsDueToXFEM(const Elem *elem, unsigned int side=0)
Update the face integration weights for XFEM partial elements.
Definition Assembly.C:4572
unsigned int _max_cached_residuals
Definition Assembly.h:2790
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:455
std::shared_ptr< XFEMInterface > _xfem
The XFEM controller.
Definition Assembly.h:2366
std::map< unsigned int, FEBase * > _holder_fe_face_neighbor_helper
Definition Assembly.h:2540
std::set< FEType > _need_neighbor_div
Definition Assembly.h:2857
SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition Assembly.h:2599
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhi(FEType type) const
Definition Assembly.h:1624
std::map< FEType, FEVectorBase * > _current_vector_fe_face
The "face" vector fe object that matches the current elem.
Definition Assembly.h:2380
VariablePhiValue _phi
Definition Assembly.h:2690
bool _custom_mortar_qrule
Flag specifying whether a custom quadrature rule has been specified for mortar segment mesh.
Definition Assembly.h:2575
libMesh::ElemSideBuilder _current_neighbor_side_elem_builder
In place side element builder for _current_neighbor_side_elem.
Definition Assembly.h:2866
const SubdomainID & currentNeighborSubdomainID() const
Return the current subdomain ID.
Definition Assembly.h:488
std::vector< std::vector< dof_id_type > > _cached_jacobian_rows
Row where the corresponding cached value should go.
Definition Assembly.h:2795
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data_face
Definition Assembly.h:2769
MooseArray< ADReal > _ad_coord
The AD version of the current coordinate transformation coefficients.
Definition Assembly.h:2413
const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase &fe)
Attaches the current face/area quadrature rule to the given fe.
Definition Assembly.h:1911
std::vector< std::unique_ptr< FEBase > > _unique_fe_neighbor_helper
Definition Assembly.h:2359
VariablePhiSecond & secondPhiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1578
std::map< FEType, FEBase * > _current_fe_face_neighbor
The "neighbor face" fe object that matches the current elem.
Definition Assembly.h:2375
void computeSinglePointMapAD(const Elem *elem, const std::vector< Real > &qw, unsigned p, FEBase *fe)
compute the finite element reference-physical mapping quantities (such as JxW) with possible dependen...
Definition Assembly.C:1038
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1482
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_neighbor
Definition Assembly.h:2754
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:2244
VariablePhiValue & phi(const MooseVariableField< Real > &)
Definition Assembly.h:1456
VariablePhiValue & phiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1583
bool _need_lower_d_elem_volume
Whether we need to compute the lower dimensional element volume.
Definition Assembly.h:2622
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face_neighbor
Definition Assembly.h:2763
QRules & qrules(unsigned int dim)
Definition Assembly.h:2477
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:2309
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition Assembly.h:2605
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFace(FEType type) const
Definition Assembly.h:1764
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Keg
Definition Assembly.h:2667
SubProblem & _subproblem
Definition Assembly.h:2300
std::set< FEType > _need_face_div
Definition Assembly.h:2856
const std::vector< Real > & jxWMortar() const
Returns a reference to JxW for mortar segment elements.
Definition Assembly.h:698
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:2031
const MooseArray< std::vector< Point > > & tangents() const
Returns the array of tangents for quadrature points on a current side.
Definition Assembly.h:359
const ADTemplateVariablePhiGradient< T > & adGradPhi(const MooseVariableFE< T > &v) const
Definition Assembly.h:1313
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:3877
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:2056
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:431
VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1535
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:4318
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiNeighbor(FEType type) const
Definition Assembly.h:1686
VectorVariablePhiGradient _vector_grad_phi_face
Definition Assembly.h:2714
VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1464
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > _cm_fs_entry
Entries in the coupling matrix for field variables vs scalar variables.
Definition Assembly.h:2320
Real _current_side_volume
Volume of the current side element.
Definition Assembly.h:2595
void copyShapes(MooseVariableField< T > &v)
Definition Assembly.C:3038
const MooseArray< Real > & coordTransformation() const
Returns the reference to the coordinate transformation coefficients.
Definition Assembly.h:279
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:3286
VariablePhiSecond _second_phi_neighbor
Definition Assembly.h:2700
Real _current_neighbor_lower_d_elem_volume
The current neighboring lower dimensional element volume.
Definition Assembly.h:2628
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition Assembly.h:2411
void prepare()
Definition Assembly.C:2754
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_lower
Definition Assembly.h:2764
void buildVectorFE(FEType type) const
Build Vector FEs with a type.
Definition Assembly.C:478
VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1559
const OutputTools< OutputType >::VariablePhiValue & fePhiFace(FEType type) const
Definition Assembly.h:1651
VariablePhiGradient & gradPhiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1574
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:111
DenseVector< Number > & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
Get local residual block for a variable and a tag.
Definition Assembly.h:1106
ArbitraryQuadrature * _current_qrule_arbitrary_face
The current arbitrary quadrature rule used on the element face.
Definition Assembly.h:2403
const MooseArray< Real > & JxW() const
Returns the reference to the transformed jacobian weights.
Definition Assembly.h:267
VariablePhiValue _phi_face
Definition Assembly.h:2694
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_nonlocal_used
Definition Assembly.h:2329
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:159
VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1551
void prepareResidual()
Sizes and zeroes the residual for the current element.
Definition Assembly.C:2745
void setCurrentLowerDElem(const Elem *const lower_d_elem)
Set the current lower dimensional element.
Definition Assembly.h:3214
bool needDual() const
Indicates whether dual shape functions are used (computation is now repeated on each element so expen...
Definition Assembly.h:614
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:2719
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:2351
const MooseArray< Point > & qPointsFace() const
Returns the reference to the current quadrature being used.
Definition Assembly.h:336
VectorVariablePhiValue _vector_phi_face
Definition Assembly.h:2713
void reinitFEFace(const Elem *elem, unsigned int side)
Just an internal helper function to reinit the face FE objects.
Definition Assembly.C:1305
const MooseArray< ADReal > & adJxW() const
Definition Assembly.h:269
const MooseArray< Point > & qPointsFaceNeighbor() const
Returns the reference to the current quadrature points being used on the neighbor face.
Definition Assembly.h:530
std::map< unsigned int, FEBase * > _holder_fe_neighbor_helper
Each dimension's helper objects.
Definition Assembly.h:2539
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:4250
VectorVariablePhiSecond _vector_second_phi_face
Definition Assembly.h:2715
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:1832
const Elem *const & msmElem() const
Definition Assembly.h:1952
const libMesh::QBase *const & qRuleFace() const
Returns the reference to the current quadrature being used on a current face.
Definition Assembly.h:313
void reinitNeighborLowerDElem(const Elem *elem)
reinitialize a neighboring lower dimensional element
Definition Assembly.C:2420
void initNonlocalCoupling()
Create pair of variables requiring nonlocal jacobian contributions.
Definition Assembly.C:2686
MooseArray< ADReal > _ad_curvatures
Definition Assembly.h:2837
VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1514
const VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1445
const Real & neighborVolume()
Returns the reference to the current neighbor volume.
Definition Assembly.h:499
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFace(FEType type) const
Definition Assembly.h:1671
libMesh::QBase * _qrule_msm
A qrule object for working on mortar segement elements.
Definition Assembly.h:2573
unsigned int _max_cached_jacobians
Definition Assembly.h:2799
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition Assembly.h:2593
std::set< FEType > _need_div
Definition Assembly.h:2855
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:147
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:2788
const MooseArray< Real > & JxWFace() const
Returns the reference to the transformed jacobian weights on a current face.
Definition Assembly.h:342
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data
Definition Assembly.h:2767
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1591
const VariablePhiGradient & gradPhi(const MooseVariableField< Real > &) const
Definition Assembly.h:1319
std::map< unsigned int, FEBase * > _holder_fe_helper
Each dimension's helper objects.
Definition Assembly.h:2393
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1600
MooseArray< Point > _current_q_points_face_neighbor
The current quadrature points on the neighbor face.
Definition Assembly.h:2552
std::vector< ADReal > _ad_dzetadz_map
Definition Assembly.h:2831
std::vector< ADReal > _ad_detady_map
Definition Assembly.h:2827
const Elem *const & sideElem() const
Returns the side element.
Definition Assembly.h:449
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhi(FEType type) const
Definition Assembly.h:1725
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kne
jacobian contributions from the neighbor and element <Tag, ivar, jvar>
Definition Assembly.h:2672
const NumericVector< Real > * _scaling_vector
The map from global index to variable scaling factor.
Definition Assembly.h:2861
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition Assembly.h:2407
void zeroCachedJacobian(GlobalDataKey)
Zero out previously-cached Jacobian rows.
Definition Assembly.C:4531
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:226
const Elem * _current_neighbor_lower_d_elem
The current neighboring lower dimensional element.
Definition Assembly.h:2620
VariablePhiValue & phi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1569
libMesh::QBase * _current_qrule_lower
quadrature rule used on lower dimensional elements.
Definition Assembly.h:2579
const VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1351
void clearCachedResiduals(GlobalDataKey)
Clears all of the residuals in _cached_residual_rows and _cached_residual_values.
Definition Assembly.C:3520
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:4376
void computeCurrentElemVolume()
Definition Assembly.C:1791
const MooseArray< Real > & mortarCoordTransformation() const
Returns the reference to the coordinate transformation coefficients on the mortar segment mesh.
Definition Assembly.h:285
unsigned int _current_neighbor_side
The current side of the selected neighboring element (valid only when working with sides)
Definition Assembly.h:2601
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knl
dprimary/dlower (or dneighbor/dlower)
Definition Assembly.h:2684
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:3396
MooseArray< VectorValue< ADReal > > _ad_q_points_face
Definition Assembly.h:2835
void reinitMortarElem(const Elem *elem)
reinitialize a mortar segment mesh element in order to get a proper JxW
Definition Assembly.C:2441
std::vector< VectorValue< ADReal > > _ad_d2xyzdxi2_map
Definition Assembly.h:2817
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1604
const Elem * _current_elem
The current "element" we are currently on.
Definition Assembly.h:2583
std::map< unsigned int, FEBase * > _holder_fe_face_helper
Each dimension's helper objects.
Definition Assembly.h:2505
const VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1440
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face_neighbor
Definition Assembly.h:2536
const VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1411
VectorVariablePhiDivergence _vector_div_phi_face_neighbor
Definition Assembly.h:2729
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1587
void reinitNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Reinitializes the neighbor side using reference coordinates.
Definition Assembly.C:1724
const Elem * _msm_elem
Definition Assembly.h:2870
libMesh::QBase * _current_qrule_volume
The current volumetric quadrature for the element.
Definition Assembly.h:2399
void addJacobianNeighborLowerD(GlobalDataKey)
Add all portions of the Jacobian except PrimaryPrimary, e.g.
Definition Assembly.C:3965
std::map< FEType, FEVectorBase * > _current_vector_fe_neighbor
The "neighbor" vector fe object that matches the current elem.
Definition Assembly.h:2382
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1465
MooseArray< Real > _coord_msm
The coordinate transformation coefficients evaluated on the quadrature points of the mortar segment m...
Definition Assembly.h:2561
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:207
Real _current_lower_d_elem_volume
The current lower dimensional element volume.
Definition Assembly.h:2624
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:3577
const VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1435
std::vector< std::vector< Real > > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition Assembly.h:2793
bool _user_added_fe_face_of_helper_type
Definition Assembly.h:2349
void clearCachedJacobian()
Clear any currently cached jacobians.
Definition Assembly.C:4541
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:542
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_dual_lower
Definition Assembly.h:2757
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data
Shape function values, gradients, second derivatives for each FE type.
Definition Assembly.h:2752
std::vector< Point > _current_neighbor_ref_points
The current reference points on the neighbor element.
Definition Assembly.h:2891
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:3165
void copyNeighborShapes(MooseVariableField< T > &v)
Definition Assembly.C:3112
std::set< FEType > _need_second_derivative
Definition Assembly.h:2852
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiNeighbor(FEType type) const
Definition Assembly.h:1741
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:2885
std::vector< dof_id_type > _extra_elem_ids
Extra element IDs.
Definition Assembly.h:2524
void hasScalingVector()
signals this object that a vector containing variable scaling factors should be used when doing resid...
Definition Assembly.C:4593
void addCachedResiduals(GlobalDataKey, const std::vector< VectorTag > &tags)
Pushes all cached residuals to the global residual vectors associated with each tag.
Definition Assembly.C:3505
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face_neighbor
Definition Assembly.h:2755
bool _user_added_fe_lower_of_helper_type
Definition Assembly.h:2352
MooseArray< Real > _current_JxW_neighbor
The current transformed jacobian weights on a neighbor's face.
Definition Assembly.h:2556
std::vector< ADReal > _ad_dxidy_map
Definition Assembly.h:2824
unsigned int _mesh_dimension
Definition Assembly.h:2341
DenseVector< Number > _element_vector
A working vector to avoid repeated heap allocations when caching residuals that must have libMesh-lev...
Definition Assembly.h:2875
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1780
const VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1406
VariablePhiSecond _second_phi_face_neighbor
Definition Assembly.h:2704
VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1563
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:3568
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face
Definition Assembly.h:2753
const VariablePhiSecond & secondPhi() const
Definition Assembly.h:1320
const VariablePhiSecond & secondPhi(const MooseVariableField< Real > &) const
Definition Assembly.h:1321
const Elem *const & neighbor() const
Return the neighbor element.
Definition Assembly.h:461
void prepareOffDiagScalar()
Definition Assembly.C:3012
void prepareNonlocal()
Definition Assembly.C:2761
const SubdomainID & currentSubdomainID() const
Return the current subdomain ID.
Definition Assembly.h:410
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:195
void prepareVariable(MooseVariableFieldBase *var)
Used for preparing the dense residual and jacobian blocks for one particular variable.
Definition Assembly.C:2787
VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1462
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition Assembly.h:467
const VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1430
const VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1393
bool _need_dual
Whether dual shape functions need to be computed for mortar constraints.
Definition Assembly.h:2630
const MooseArray< ADReal > & adCoordTransformation() const
Returns the reference to the AD version of the coordinate transformation coefficients.
Definition Assembly.h:291
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
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:851
const SubdomainID ANY_BLOCK_ID
Definition MooseTypes.C:19
CoordinateSystemType
Definition MooseTypes.h:864
DGJacobianType
Definition MooseTypes.h:804
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:2418
std::unique_ptr< ArbitraryQuadrature > arbitrary_vol
volume/elem (meshdim) custom points quadrature rule
Definition Assembly.h:2435
std::unique_ptr< ArbitraryQuadrature > neighbor
area/face (meshdim-1) custom points quadrature rule for DG
Definition Assembly.h:2439
std::unique_ptr< libMesh::QBase > fv_face
finite volume face/flux quadrature rule (meshdim-1)
Definition Assembly.h:2433
std::unique_ptr< libMesh::QBase > vol
volume/elem (meshdim) quadrature rule
Definition Assembly.h:2429
std::unique_ptr< ArbitraryQuadrature > arbitrary_face
area/face (meshdim-1) custom points quadrature rule
Definition Assembly.h:2437
std::unique_ptr< libMesh::QBase > face
area/face (meshdim-1) quadrature rule
Definition Assembly.h:2431