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
74// Assembly.h does not import Moose.h nor libMeshReducedNamespace.h
75using libMesh::FEBase;
77using libMesh::FEType;
80using libMesh::Order;
82
91template <typename P, typename C>
92void coordTransformFactor(const SubProblem & s,
93 SubdomainID sub_id,
94 const P & point,
95 C & factor,
96 SubdomainID neighbor_sub_id = libMesh::Elem::invalid_subdomain_id);
97
98template <typename P, typename C>
100 SubdomainID sub_id,
101 const P & point,
102 C & factor,
103 SubdomainID neighbor_sub_id = libMesh::Elem::invalid_subdomain_id);
104
110{
111public:
112 Assembly(SystemBase & sys, THREAD_ID tid);
113 virtual ~Assembly();
114
119 template <typename T>
120 static const T * const & constify_ref(T * const & inref)
121 {
122 const T * const * ptr = &inref;
123 return *ptr;
124 }
125
132 const FEBase * const & getFE(FEType type, unsigned int dim) const
133 {
134 buildFE(type);
135 return constify_ref(_fe[dim][type]);
136 }
137
144 const FEBase * const & getFENeighbor(FEType type, unsigned int dim) const
145 {
146 buildNeighborFE(type);
147 return constify_ref(_fe_neighbor[dim][type]);
148 }
149
156 const FEBase * const & getFEFace(FEType type, unsigned int dim) const
157 {
158 buildFaceFE(type);
159 return constify_ref(_fe_face[dim][type]);
160 }
161
168 const FEBase * const & getFEFaceNeighbor(FEType type, unsigned int dim) const
169 {
171 return constify_ref(_fe_face_neighbor[dim][type]);
172 }
173
180 const FEVectorBase * const & getVectorFE(FEType type, unsigned int dim) const
181 {
182 buildVectorFE(type);
183 return constify_ref(_vector_fe[dim][type]);
184 }
185
192 const FEVectorBase * const & getVectorFENeighbor(FEType type, unsigned int dim) const
193 {
195 return constify_ref(_vector_fe_neighbor[dim][type]);
196 }
197
204 const FEVectorBase * const & getVectorFEFace(FEType type, unsigned int dim) const
205 {
206 buildVectorFaceFE(type);
207 return constify_ref(_vector_fe_face[dim][type]);
208 }
209
216 const FEVectorBase * const & getVectorFEFaceNeighbor(FEType type, unsigned int dim) const
217 {
220 }
221
222#ifdef MOOSE_KOKKOS_ENABLED
229#endif
230
235 const libMesh::QBase * const & qRule() const { return constify_ref(_current_qrule); }
236
242
243#ifdef MOOSE_KOKKOS_ENABLED
249 {
250 return qrules(dim, block).vol.get();
251 }
252#endif
253
258 const MooseArray<Point> & qPoints() const { return _current_q_points; }
259
264 const std::vector<Point> & qPointsMortar() const { return _fe_msm->get_xyz(); }
265
271
276 const MooseArray<Real> & JxW() const { return _current_JxW; }
277
278 const MooseArray<ADReal> & adJxW() const { return _ad_JxW; }
279
280 const MooseArray<ADReal> & adJxWFace() const { return _ad_JxW_face; }
281
282 const MooseArray<ADReal> & adCurvatures() const;
283
288 const MooseArray<Real> & coordTransformation() const { return _coord; }
289
295
301 {
302 // Coord values for non-cartesian coordinate systems are functions of the locations of the
303 // quadrature points in physical space. We also have no way of knowing whether this was called
304 // from a volumetric or face object so we should set both volumetric and face xyz to true
305 _calculate_xyz = true;
306 _calculate_face_xyz = true;
307
308 _calculate_ad_coord = true;
309 return _ad_coord;
310 }
311
317
322 const libMesh::QBase * const & qRuleFace() const { return constify_ref(_current_qrule_face); }
323
329
330#ifdef MOOSE_KOKKOS_ENABLED
336 {
337 return qrules(dim, block).face.get();
338 }
339#endif
340
346
351 const MooseArray<Real> & JxWFace() const { return _current_JxW_face; }
352
357 const MooseArray<Point> & normals() const { return _current_normals; }
358
359 /***
360 * Returns the array of normals for quadrature points on a current side
361 */
362 const std::vector<Eigen::Map<RealDIMValue>> & mappedNormals() const { return _mapped_normals; }
363
369
373 unsigned int numExtraElemIntegers() const { return _extra_elem_ids.size() - 1; }
374
378 const dof_id_type & extraElemID(unsigned int id) const
379 {
380 mooseAssert(id < _extra_elem_ids.size(), "An invalid extra element integer id");
381 return _extra_elem_ids[id];
382 }
383
387 const dof_id_type & extraElemIDNeighbor(unsigned int id) const
388 {
389 mooseAssert(id < _neighbor_extra_elem_ids.size(), "An invalid extra element integer id");
390 return _neighbor_extra_elem_ids[id];
391 }
392
393 const MooseArray<ADPoint> & adNormals() const { return _ad_normals; }
394
396 {
397 _calculate_xyz = true;
398 return _ad_q_points;
399 }
400
402 {
403 _calculate_face_xyz = true;
404 return _ad_q_points_face;
405 }
406
407 template <bool is_ad>
409
414 const Elem * const & elem() const { return _current_elem; }
415
420
425
430
435
440 const Real & elemVolume() const { return _current_elem_volume; }
441
446 const unsigned int & side() const { return _current_side; }
447
452 const unsigned int & neighborSide() const { return _current_neighbor_side; }
453
458 const Elem * const & sideElem() const { return _current_side_elem; }
459
464 const Real & sideElemVolume() const { return _current_side_volume; }
465
470 const Elem * const & neighbor() const { return _current_neighbor_elem; }
471
476 const Elem * const & lowerDElem() const { return _current_lower_d_elem; }
477
482 const Elem * const & neighborLowerDElem() const { return _current_neighbor_lower_d_elem; }
483
484 /*
485 * @return The current lower-dimensional element volume
486 */
487 const Real & lowerDElemVolume() const;
488
489 /*
490 * @return The current neighbor lower-dimensional element volume
491 */
492 const Real & neighborLowerDElemVolume() const;
493
498
503
508 const Real & neighborVolume()
509 {
512 }
513
518 const libMesh::QBase * const & qRuleNeighbor() const
519 {
521 }
522
528
533 const MooseArray<Real> & JxWNeighbor() const;
534
540
545 const Node * const & node() const { return _current_node; }
546
551 const Node * const & nodeNeighbor() const { return _current_neighbor_node; }
552
561 void createQRules(QuadratureType type,
562 Order order,
563 Order volume_order,
564 Order face_order,
565 SubdomainID block,
566 bool allow_negative_qweights = true);
567
574 void bumpVolumeQRuleOrder(Order volume_order, SubdomainID block);
575
583 void bumpAllQRuleOrder(Order order, SubdomainID block);
584
593 void setVolumeQRule(libMesh::QBase * qrule, unsigned int dim);
594
603 void setFaceQRule(libMesh::QBase * qrule, unsigned int dim);
604
612 void setMortarQRule(Order order);
613
617 void activateDual() { _need_dual = true; }
618
623 bool needDual() const { return _need_dual; }
624
628 void clearCachedQRules();
629
630private:
637 void setLowerQRule(libMesh::QBase * qrule, unsigned int dim);
638
639public:
648 void setNeighborQRule(libMesh::QBase * qrule, unsigned int dim);
649
655 void reinit(const Elem * elem);
656
660 void setVolumeQRule(const Elem * elem);
661
666 void reinitElemFaceRef(const Elem * elem,
667 unsigned int elem_side,
668 Real tolerance,
669 const std::vector<Point> * const pts = nullptr,
670 const std::vector<Real> * const weights = nullptr);
671
676 void reinitNeighborFaceRef(const Elem * neighbor_elem,
677 unsigned int neighbor_side,
678 Real tolerance,
679 const std::vector<Point> * const pts,
680 const std::vector<Real> * const weights = nullptr);
681
685 void reinitDual(const Elem * elem, const std::vector<Point> & pts, const std::vector<Real> & JxW);
686
690 void reinitLowerDElem(const Elem * elem,
691 const std::vector<Point> * const pts = nullptr,
692 const std::vector<Real> * const weights = nullptr);
693
697 void reinitNeighborLowerDElem(const Elem * elem);
698
702 void reinitMortarElem(const Elem * elem);
703
707 const std::vector<Real> & jxWMortar() const { return *_JxW_msm; }
708
712 const libMesh::QBase * const & qRuleMortar() const { return constify_ref(_qrule_msm); }
713
714private:
718 void computeADFace(const Elem & elem, const unsigned int side);
719
720public:
724 void reinitAtPhysical(const Elem * elem, const std::vector<Point> & physical_points);
725
729 void reinit(const Elem * elem, const std::vector<Point> & reference_points);
730
734 void setFaceQRule(const Elem * const elem, const unsigned int side);
735
739 void reinit(const Elem * elem, unsigned int side);
740
744 void reinit(const Elem * elem, unsigned int side, const std::vector<Point> & reference_points);
745
746 void reinitFVFace(const FaceInfo & fi);
747
759 void reinitElemAndNeighbor(const Elem * elem,
760 unsigned int side,
761 const Elem * neighbor,
762 unsigned int neighbor_side,
763 const std::vector<Point> * neighbor_reference_points = nullptr);
764
768 void reinitNeighborAtPhysical(const Elem * neighbor,
769 unsigned int neighbor_side,
770 const std::vector<Point> & physical_points);
771
775 void reinitNeighborAtPhysical(const Elem * neighbor, const std::vector<Point> & physical_points);
776
780 void reinitNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
781
785 void reinit(const Node * node);
786
790 void init(const libMesh::CouplingMatrix * cm);
791
794
797
799 void prepareResidual();
800
801 void prepare();
802 void prepareNonlocal();
803
811 void prepareNeighbor();
812
817 void prepareLowerD();
818
819 void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector<dof_id_type> & dof_indices);
820 void prepareBlockNonlocal(unsigned int ivar,
821 unsigned jvar,
822 const std::vector<dof_id_type> & idof_indices,
823 const std::vector<dof_id_type> & jdof_indices);
824 void prepareScalar();
826
827 template <typename T>
829 void copyShapes(unsigned int var);
830
831 template <typename T>
833 void copyFaceShapes(unsigned int var);
834
835 template <typename T>
837 void copyNeighborShapes(unsigned int var);
838
845 {
846 // Blessed classes
847 friend class Assembly;
848 friend class SubProblem;
849 friend class FEProblemBase;
850 friend class DisplacedProblem;
855 };
856
863 {
864 // Blessed classes
865 friend class Assembly;
866 friend class TaggingInterface;
869 };
870
875 void addResidual(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
880 void addResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
885 void addResidualLower(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
886
891 void addResidualScalar(GlobalDataKey, const std::vector<VectorTag> & vector_tags);
892
897 void cacheResidual(GlobalDataKey, const std::vector<VectorTag> & tags);
898
903 void cacheResidualNeighbor(GlobalDataKey, const std::vector<VectorTag> & tags);
904
908 void cacheResidualLower(GlobalDataKey, const std::vector<VectorTag> & tags);
909
915 void addCachedResiduals(GlobalDataKey, const std::vector<VectorTag> & tags);
916
925 void clearCachedResiduals(GlobalDataKey);
926
934 void addCachedResidualDirectly(NumericVector<Number> & residual,
935 GlobalDataKey,
936 const VectorTag & vector_tag);
937
941 void setResidual(NumericVector<Number> & residual, GlobalDataKey, const VectorTag & vector_tag);
942
946 void setResidualNeighbor(NumericVector<Number> & residual,
947 GlobalDataKey,
948 const VectorTag & vector_tag);
949
953 void addJacobian(GlobalDataKey);
954
958 void addJacobianNonlocal(GlobalDataKey);
959
964 void addJacobianNeighbor(GlobalDataKey);
965
969 void addJacobianScalar(GlobalDataKey);
970
975 void addJacobianOffDiagScalar(unsigned int ivar, GlobalDataKey);
976
981 unsigned int ivar,
982 unsigned int jvar,
983 const libMesh::DofMap & dof_map,
984 std::vector<dof_id_type> & dof_indices,
986 TagID tag);
987
993 unsigned int ivar,
994 unsigned int jvar,
995 const libMesh::DofMap & dof_map,
996 std::vector<dof_id_type> & dof_indices,
998 const std::set<TagID> & tags);
999
1004 unsigned int ivar,
1005 unsigned int jvar,
1006 const libMesh::DofMap & dof_map,
1007 const std::vector<dof_id_type> & idof_indices,
1008 const std::vector<dof_id_type> & jdof_indices,
1010 TagID tag);
1011
1016 unsigned int ivar,
1017 unsigned int jvar,
1018 const libMesh::DofMap & dof_map,
1019 const std::vector<dof_id_type> & idof_indices,
1020 const std::vector<dof_id_type> & jdof_indices,
1022 const std::set<TagID> & tags);
1023
1033
1040
1050
1056 unsigned int ivar,
1057 unsigned int jvar,
1058 const libMesh::DofMap & dof_map,
1059 std::vector<dof_id_type> & dof_indices,
1060 std::vector<dof_id_type> & neighbor_dof_indices,
1062 TagID tag);
1063
1069 unsigned int ivar,
1070 unsigned int jvar,
1071 const libMesh::DofMap & dof_map,
1072 std::vector<dof_id_type> & dof_indices,
1073 std::vector<dof_id_type> & neighbor_dof_indices,
1075 const std::set<TagID> & tags);
1076
1081
1086
1092
1100
1105
1110
1115 DenseVector<Number> & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
1116 {
1117 return _sub_Re[tag_id][var_num];
1118 }
1119
1124 DenseVector<Number> & residualBlockNeighbor(unsigned int var_num, LocalDataKey, TagID tag_id)
1125 {
1126 return _sub_Rn[tag_id][var_num];
1127 }
1128
1133 DenseVector<Number> & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
1134 {
1135 return _sub_Rl[tag_id][var_num];
1136 }
1137
1142 DenseMatrix<Number> & jacobianBlock(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1143 {
1144 jacobianBlockUsed(tag, ivar, jvar, true);
1145 return _sub_Kee[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1146 }
1147
1152 DenseMatrix<Number> &
1153 jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
1154 {
1155 jacobianBlockNonlocalUsed(tag, ivar, jvar, true);
1156 return _sub_Keg[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
1157 }
1158
1163 DenseMatrix<Number> & jacobianBlockNeighbor(
1164 Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag);
1165
1173 DenseMatrix<Number> & jacobianBlockMortar(Moose::ConstraintJacobianType type,
1174 unsigned int ivar,
1175 unsigned int jvar,
1176 LocalDataKey,
1177 TagID tag);
1178
1183 void cacheResidualNodes(const DenseVector<Number> & res,
1184 const std::vector<dof_id_type> & dof_index,
1185 LocalDataKey,
1186 TagID tag);
1187
1199 void
1200 cacheJacobian(numeric_index_type i, numeric_index_type j, Real value, LocalDataKey, TagID tag);
1201
1213 void cacheJacobian(numeric_index_type i,
1214 numeric_index_type j,
1215 Real value,
1216 LocalDataKey,
1217 const std::set<TagID> & tags);
1218
1226 void cacheJacobianBlock(const DenseMatrix<Number> & jac_block,
1227 const std::vector<dof_id_type> & idof_indices,
1228 const std::vector<dof_id_type> & jdof_indices,
1229 Real scaling_factor,
1230 LocalDataKey,
1231 const std::set<TagID> & tags);
1232
1242 template <typename Residuals, typename Indices>
1243 void cacheResiduals(const Residuals & residuals,
1244 const Indices & row_indices,
1245 Real scaling_factor,
1246 LocalDataKey,
1247 const std::set<TagID> & vector_tags);
1248
1256 template <typename Residuals, typename Indices>
1257 void cacheJacobian(const Residuals & residuals,
1258 const Indices & row_indices,
1259 Real scaling_factor,
1260 LocalDataKey,
1261 const std::set<TagID> & matrix_tags);
1262
1273 template <typename Residuals, typename Indices>
1274 void cacheResidualsWithoutConstraints(const Residuals & residuals,
1275 const Indices & row_indices,
1276 Real scaling_factor,
1277 LocalDataKey,
1278 const std::set<TagID> & vector_tags);
1279
1287 template <typename Residuals, typename Indices>
1288 void cacheJacobianWithoutConstraints(const Residuals & residuals,
1289 const Indices & row_indices,
1290 Real scaling_factor,
1291 LocalDataKey,
1292 const std::set<TagID> & matrix_tags);
1293
1294 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> & couplingEntries()
1295 {
1296 return _cm_ff_entry;
1297 }
1298 const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1300 {
1301 return _cm_ff_entry;
1302 }
1303 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
1305 {
1306 return _cm_nonlocal_entry;
1307 }
1308 const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> &
1310 {
1311 return _cm_fs_entry;
1312 }
1313 const std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> &
1315 {
1316 return _cm_sf_entry;
1317 }
1318
1319 // Read-only references
1320 const VariablePhiValue & phi() const { return _phi; }
1321 template <typename T>
1323 {
1324 return _ad_grad_phi_data.at(v.feType());
1325 }
1326 const VariablePhiValue & phi(const MooseVariableField<Real> &) const { return _phi; }
1327 const VariablePhiGradient & gradPhi() const { return _grad_phi; }
1329 const VariablePhiSecond & secondPhi() const { return _second_phi; }
1331 {
1332 return _second_phi;
1333 }
1334
1335 const VariablePhiValue & phiFace() const { return _phi_face; }
1339 {
1340 return _grad_phi_face;
1341 }
1343 {
1344 return _second_phi_face;
1345 }
1346
1348 {
1349 return _phi_neighbor;
1350 }
1352 {
1353 return _grad_phi_neighbor;
1354 }
1359
1361 {
1362 return _phi_face_neighbor;
1363 }
1372
1374 {
1375 return _vector_phi;
1376 }
1393
1414
1438
1453 const VectorVariablePhiCurl &
1463
1464 // Writeable references
1468
1472
1482
1495
1496 // Writeable references with vector variable
1514
1535
1576
1577 // Writeable references with array variable
1581
1591
1604
1617
1618 template <typename OutputType>
1620 {
1621 buildFE(type);
1622 return _fe_shape_data[type]->_phi;
1623 }
1624
1625 template <typename OutputType>
1627 {
1628 buildFE(type);
1629 return _fe_shape_data[type]->_grad_phi;
1630 }
1631
1632 template <typename OutputType>
1634 {
1635 return _ad_grad_phi_data[type];
1636 }
1637
1638 template <typename OutputType>
1640 {
1641 _need_second_derivative.insert(type);
1642 buildFE(type);
1643 return _fe_shape_data[type]->_second_phi;
1644 }
1645
1646 template <typename OutputType>
1647 const typename OutputTools<OutputType>::VariablePhiValue & fePhiLower(FEType type) const;
1648
1649 template <typename OutputType>
1651
1652 template <typename OutputType>
1654
1655 template <typename OutputType>
1657 feGradDualPhiLower(FEType type) const;
1658
1659 template <typename OutputType>
1661 {
1662 buildFaceFE(type);
1663 return _fe_shape_data_face[type]->_phi;
1664 }
1665
1666 template <typename OutputType>
1668 {
1669 buildFaceFE(type);
1670 return _fe_shape_data_face[type]->_grad_phi;
1671 }
1672
1673 template <typename OutputType>
1678
1679 template <typename OutputType>
1681 {
1682 _need_second_derivative.insert(type);
1683 buildFaceFE(type);
1684 return _fe_shape_data_face[type]->_second_phi;
1685 }
1686
1687 template <typename OutputType>
1689 {
1690 buildNeighborFE(type);
1691 return _fe_shape_data_neighbor[type]->_phi;
1692 }
1693
1694 template <typename OutputType>
1696 {
1697 buildNeighborFE(type);
1698 return _fe_shape_data_neighbor[type]->_grad_phi;
1699 }
1700
1701 template <typename OutputType>
1703 {
1705 buildNeighborFE(type);
1706 return _fe_shape_data_neighbor[type]->_second_phi;
1707 }
1708
1709 template <typename OutputType>
1711 {
1712 buildFaceNeighborFE(type);
1713 return _fe_shape_data_face_neighbor[type]->_phi;
1714 }
1715
1716 template <typename OutputType>
1719 {
1720 buildFaceNeighborFE(type);
1721 return _fe_shape_data_face_neighbor[type]->_grad_phi;
1722 }
1723
1724 template <typename OutputType>
1727 {
1729 buildFaceNeighborFE(type);
1730 return _fe_shape_data_face_neighbor[type]->_second_phi;
1731 }
1732
1733 template <typename OutputType>
1735 {
1736 _need_curl.insert(type);
1737 buildFE(type);
1738 return _fe_shape_data[type]->_curl_phi;
1739 }
1740
1741 template <typename OutputType>
1743 {
1744 _need_curl.insert(type);
1745 buildFaceFE(type);
1746 return _fe_shape_data_face[type]->_curl_phi;
1747 }
1748
1749 template <typename OutputType>
1751 {
1752 _need_curl.insert(type);
1753 buildNeighborFE(type);
1754 return _fe_shape_data_neighbor[type]->_curl_phi;
1755 }
1756
1757 template <typename OutputType>
1759 {
1760 _need_curl.insert(type);
1761 buildFaceNeighborFE(type);
1762 return _fe_shape_data_face_neighbor[type]->_curl_phi;
1763 }
1764
1765 template <typename OutputType>
1767 {
1768 buildFE(type);
1769 return _fe_shape_data[type]->_div_phi;
1770 }
1771
1772 template <typename OutputType>
1774 {
1775 buildFaceFE(type);
1776 return _fe_shape_data_face[type]->_div_phi;
1777 }
1778
1779 template <typename OutputType>
1782 {
1783 buildNeighborFE(type);
1784 return _fe_shape_data_neighbor[type]->_div_phi;
1785 }
1786
1787 template <typename OutputType>
1790 {
1791 buildFaceNeighborFE(type);
1792 return _fe_shape_data_face_neighbor[type]->_div_phi;
1793 }
1794
1796 Real elementVolume(const Elem * elem) const;
1797
1801 void setXFEM(std::shared_ptr<XFEMInterface> xfem) { _xfem = xfem; }
1802
1807 std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions);
1808
1817 void saveLocalArrayResidual(DenseVector<Number> & re,
1818 unsigned int i,
1819 unsigned int ntest,
1820 const RealEigenVector & v) const
1821 {
1822 for (unsigned int j = 0; j < v.size(); ++j, i += ntest)
1823 re(i) += v(j);
1824 }
1825
1826 void saveLocalADArray(std::vector<ADReal> & re,
1827 unsigned int i,
1828 unsigned int ntest,
1829 const ADRealEigenVector & v) const;
1830
1841 void saveDiagLocalArrayJacobian(DenseMatrix<Number> & ke,
1842 unsigned int i,
1843 unsigned int ntest,
1844 unsigned int j,
1845 unsigned int nphi,
1846 unsigned int ivar,
1847 const RealEigenVector & v) const
1848 {
1849 unsigned int pace = (_component_block_diagonal[ivar] ? 0 : nphi);
1850 for (unsigned int k = 0; k < v.size(); ++k, i += ntest, j += pace)
1851 ke(i, j) += v(k);
1852 }
1853
1866 void saveFullLocalArrayJacobian(DenseMatrix<Number> & ke,
1867 unsigned int i,
1868 unsigned int ntest,
1869 unsigned int j,
1870 unsigned int nphi,
1871 unsigned int ivar,
1872 unsigned int jvar,
1873 const RealEigenMatrix & v) const
1874 {
1875 if (ivar == jvar && _component_block_diagonal[ivar])
1876 {
1877 for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1878 ke(i, j) += v(k, k);
1879 }
1880 else
1881 {
1882 const unsigned int saved_j = j;
1883 for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
1884 {
1885 j = saved_j;
1886 for (unsigned int l = 0; l < v.cols(); ++l, j += nphi)
1887 ke(i, j) += v(k, l);
1888 }
1889 }
1890 }
1891
1892 DenseVector<Real> getJacobianDiagonal(const DenseMatrix<Number> & ke)
1893 {
1894 unsigned int rows = ke.m();
1895 unsigned int cols = ke.n();
1896 DenseVector<Real> diag(rows);
1897 for (unsigned int i = 0; i < rows; i++)
1898 // % operation is needed to account for cases of no component coupling of array variables
1899 diag(i) = ke(i, i % cols);
1900 return diag;
1901 }
1902
1908 inline const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase & fe)
1909 {
1910 auto qrule = qrules(dim).vol.get();
1911 fe.attach_quadrature_rule(qrule);
1912 return qrule;
1913 }
1914
1920 inline const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase & fe)
1921 {
1922 auto qrule = qrules(dim).face.get();
1923 fe.attach_quadrature_rule(qrule);
1924 return qrule;
1925 }
1926
1931 void hasScalingVector();
1932
1941 void modifyArbitraryWeights(const std::vector<Real> & weights);
1942
1947
1952
1957
1961 const Elem * const & msmElem() const { return _msm_elem; }
1962
1972 void havePRefinement(const std::unordered_set<FEFamily> & disable_p_refinement_for_families);
1973
1977 void setCurrentLowerDElem(const Elem * const lower_d_elem);
1978
1979private:
1985 void reinitFE(const Elem * elem);
1986
1993 void reinitFEFace(const Elem * elem, unsigned int side);
1994
1995 void computeFaceMap(const Elem & elem, const unsigned int side, const std::vector<Real> & qw);
1996
1997 void reinitFEFaceNeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
1998
1999 void reinitFENeighbor(const Elem * neighbor, const std::vector<Point> & reference_points);
2000
2001 template <typename Points, typename Coords>
2003 const Points & q_points,
2004 Coords & coord,
2005 SubdomainID sub_id);
2006
2008
2010
2012
2018 void modifyWeightsDueToXFEM(const Elem * elem);
2019
2026 void modifyFaceWeightsDueToXFEM(const Elem * elem, unsigned int side = 0);
2027
2032 template <typename OutputType>
2033 void computeGradPhiAD(const Elem * elem,
2034 unsigned int n_qp,
2037
2041 void resizeADMappingObjects(unsigned int n_qp, unsigned int dim);
2042
2047 void
2048 computeSinglePointMapAD(const Elem * elem, const std::vector<Real> & qw, unsigned p, FEBase * fe);
2049
2053 void addResidual(const VectorTag & vector_tag);
2057 void addResidualNeighbor(const VectorTag & vector_tag);
2062 void addResidualLower(const VectorTag & vector_tag);
2066 void addResidualScalar(const VectorTag & vector_tag);
2067
2071 void clearCachedResiduals(const VectorTag & vector_tag);
2072
2081 void cacheResidual(dof_id_type dof, Real value, TagID tag_id);
2082
2091 void cacheResidual(dof_id_type dof, Real value, const std::set<TagID> & tags);
2092
2097 void processLocalResidual(DenseVector<Number> & res_block,
2098 std::vector<dof_id_type> & dof_indices,
2099 const std::vector<Real> & scaling_factor);
2100
2104 void addResidualBlock(NumericVector<Number> & residual,
2105 DenseVector<Number> & res_block,
2106 const std::vector<dof_id_type> & dof_indices,
2107 const std::vector<Real> & scaling_factor);
2108
2112 void cacheResidualBlock(std::vector<Real> & cached_residual_values,
2113 std::vector<dof_id_type> & cached_residual_rows,
2114 DenseVector<Number> & res_block,
2115 const std::vector<dof_id_type> & dof_indices,
2116 const std::vector<Real> & scaling_factor);
2117
2121 void setResidualBlock(NumericVector<Number> & residual,
2122 DenseVector<Number> & res_block,
2123 const std::vector<dof_id_type> & dof_indices,
2124 const std::vector<Real> & scaling_factor);
2125
2130 DenseMatrix<Number> & jac_block,
2131 const MooseVariableBase & ivar,
2132 const MooseVariableBase & jvar,
2133 const std::vector<dof_id_type> & idof_indices,
2134 const std::vector<dof_id_type> & jdof_indices);
2135
2139 void cacheJacobianBlock(const DenseMatrix<Number> & jac_block,
2140 const MooseVariableBase & ivar,
2141 const MooseVariableBase & jvar,
2142 const std::vector<dof_id_type> & idof_indices,
2143 const std::vector<dof_id_type> & jdof_indices,
2144 TagID tag);
2145
2149 void cacheJacobianBlockNonzero(const DenseMatrix<Number> & jac_block,
2150 const MooseVariableBase & ivar,
2151 const MooseVariableBase & jvar,
2152 const std::vector<dof_id_type> & idof_indices,
2153 const std::vector<dof_id_type> & jdof_indices,
2154 TagID tag);
2155
2159 void addJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2160
2164 void cacheJacobianCoupledVarPair(const MooseVariableBase & ivar, const MooseVariableBase & jvar);
2165
2171 void clearCachedJacobian();
2172
2177 void buildFE(FEType type) const;
2178
2183 void buildFaceFE(FEType type) const;
2184
2189 void buildNeighborFE(FEType type) const;
2190
2195 void buildFaceNeighborFE(FEType type) const;
2196
2201 void buildLowerDFE(FEType type) const;
2202
2203 void buildLowerDDualFE(FEType type) const;
2204
2209 void buildVectorFE(FEType type) const;
2210
2215 void buildVectorFaceFE(FEType type) const;
2216
2221 void buildVectorNeighborFE(FEType type) const;
2222
2227 void buildVectorFaceNeighborFE(FEType type) const;
2228
2233 void buildVectorLowerDFE(FEType type) const;
2234 void buildVectorDualLowerDFE(FEType type) const;
2235
2240 void jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2241 {
2242 _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2243 }
2244
2249 char jacobianBlockUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2250 {
2251 return _jacobian_block_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2252 }
2253
2258 void jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2259 {
2260 _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2261 }
2262
2267 char jacobianBlockNeighborUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2268 {
2269 return _jacobian_block_neighbor_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2270 }
2271
2276 void jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2277 {
2278 _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2279 }
2280
2285 char jacobianBlockLowerUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2286 {
2287 return _jacobian_block_lower_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2288 }
2289
2294 void jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar, bool used)
2295 {
2296 _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar] = used;
2297 }
2298
2303 char jacobianBlockNonlocalUsed(TagID tag, unsigned int ivar, unsigned int jvar) const
2304 {
2305 return _jacobian_block_nonlocal_used[tag][ivar][_block_diagonal_matrix ? 0 : jvar];
2306 }
2307
2311 void helpersRequestData();
2312
2315
2316 const bool _displaced;
2317
2321
2324
2327
2330
2332 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_ff_entry;
2334 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> _cm_fs_entry;
2336 std::vector<std::pair<MooseVariableScalar *, MooseVariableFieldBase *>> _cm_sf_entry;
2338 std::vector<std::pair<MooseVariableScalar *, MooseVariableScalar *>> _cm_ss_entry;
2340 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> _cm_nonlocal_entry;
2342 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_used;
2343 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_nonlocal_used;
2345 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_neighbor_used;
2347 std::vector<std::vector<std::vector<unsigned char>>> _jacobian_block_lower_used;
2352
2354
2355 unsigned int _mesh_dimension;
2356
2360
2367
2370 std::vector<std::unique_ptr<FEBase>> _unique_fe_helper;
2371 std::vector<std::unique_ptr<FEBase>> _unique_fe_face_helper;
2372 std::vector<std::unique_ptr<FEBase>> _unique_fe_face_neighbor_helper;
2373 std::vector<std::unique_ptr<FEBase>> _unique_fe_neighbor_helper;
2374 std::vector<std::unique_ptr<FEBase>> _unique_fe_lower_helper;
2375
2378
2380 std::shared_ptr<XFEMInterface> _xfem;
2381
2383 std::map<FEType, FEBase *> _current_fe;
2385 std::map<FEType, FEBase *> _current_fe_face;
2387 std::map<FEType, FEBase *> _current_fe_neighbor;
2389 std::map<FEType, FEBase *> _current_fe_face_neighbor;
2390
2392 std::map<FEType, FEVectorBase *> _current_vector_fe;
2394 std::map<FEType, FEVectorBase *> _current_vector_fe_face;
2396 std::map<FEType, FEVectorBase *> _current_vector_fe_neighbor;
2398 std::map<FEType, FEVectorBase *> _current_vector_fe_face_neighbor;
2399
2400 /**** Volume Stuff ****/
2401
2403 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe;
2405 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe;
2407 std::map<unsigned int, FEBase *> _holder_fe_helper;
2428
2431 struct QRules
2432 {
2434 : vol(nullptr),
2435 face(nullptr),
2436 arbitrary_vol(nullptr),
2437 arbitrary_face(nullptr),
2438 neighbor(nullptr)
2439 {
2440 }
2441
2443 std::unique_ptr<libMesh::QBase> vol;
2445 std::unique_ptr<libMesh::QBase> face;
2447 std::unique_ptr<libMesh::QBase> fv_face;
2449 std::unique_ptr<ArbitraryQuadrature> arbitrary_vol;
2451 std::unique_ptr<ArbitraryQuadrature> arbitrary_face;
2453 std::unique_ptr<ArbitraryQuadrature> neighbor;
2454 };
2455
2460 std::unordered_map<SubdomainID, std::vector<QRules>> _qrules;
2461
2468 libMesh::QBase * qruleFace(const Elem * elem, unsigned int side);
2469 ArbitraryQuadrature * qruleArbitraryFace(const Elem * elem, unsigned int side);
2470
2471 template <typename T>
2472 T * qruleFaceHelper(const Elem * elem, unsigned int side, std::function<T *(QRules &)> rule_fn)
2473 {
2474 auto dim = elem->dim();
2475 auto neighbor = elem->neighbor_ptr(side);
2476 auto q = rule_fn(qrules(dim, elem->subdomain_id()));
2477 if (!neighbor)
2478 return q;
2479
2480 // find the maximum face quadrature order for all blocks the face is in
2481 auto neighbor_block = neighbor->subdomain_id();
2482 if (neighbor_block == elem->subdomain_id())
2483 return q;
2484
2485 auto q_neighbor = rule_fn(qrules(dim, neighbor_block));
2486 if (q->get_order() > q_neighbor->get_order())
2487 return q;
2488 return q_neighbor;
2489 }
2490
2491 inline QRules & qrules(unsigned int dim) { return qrules(dim, _current_subdomain_id); }
2492
2496 inline QRules & qrules(unsigned int dim, SubdomainID block)
2497 {
2498 if (_qrules.find(block) == _qrules.end())
2499 {
2500 mooseAssert(_qrules.find(Moose::ANY_BLOCK_ID) != _qrules.end(),
2501 "missing quadrature rules for specified block");
2502 mooseAssert(_qrules[Moose::ANY_BLOCK_ID].size() > dim,
2503 "quadrature rules not sized property for dimension");
2505 }
2506 mooseAssert(_qrules.find(block) != _qrules.end(),
2507 "missing quadrature rules for specified block");
2508 mooseAssert(_qrules[block].size() > dim, "quadrature rules not sized property for dimension");
2509 return _qrules[block][dim];
2510 }
2511
2512 /**** Face Stuff ****/
2513
2515 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face;
2517 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face;
2519 std::map<unsigned int, FEBase *> _holder_fe_face_helper;
2533 std::vector<Eigen::Map<RealDIMValue>> _mapped_normals;
2536
2538 std::vector<dof_id_type> _extra_elem_ids;
2540 std::vector<dof_id_type> _neighbor_extra_elem_ids;
2542 std::map<unsigned int, const std::vector<Point> *> _holder_normals;
2543
2544 /**** Neighbor Stuff ****/
2545
2547 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_neighbor;
2548 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_face_neighbor;
2549 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_neighbor;
2550 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_face_neighbor;
2551
2553 std::map<unsigned int, FEBase *> _holder_fe_neighbor_helper;
2554 std::map<unsigned int, FEBase *> _holder_fe_face_neighbor_helper;
2555
2557 mutable std::map<unsigned int, std::map<FEType, FEBase *>> _fe_lower;
2559 mutable std::map<unsigned int, std::map<FEType, FEVectorBase *>> _vector_fe_lower;
2561 std::map<unsigned int, FEBase *> _holder_fe_lower_helper;
2562
2576
2577 /********** mortar stuff *************/
2578
2580 const std::vector<Real> * _JxW_msm;
2582 std::unique_ptr<FEBase> _fe_msm;
2590
2594
2595protected:
2597 const Elem * _current_elem;
2605 unsigned int _current_side;
2623 const Node * _current_node;
2630
2645
2648
2649 /*
2650 * Residual contributions <tag_index, ivar>
2651 *
2652 * tag_index is the index into _residual_vector_tags, that is, _sub_Re[0] corresponds to the tag
2653 * with TagID _residual_vector_tags[0]._id
2654 *
2655 * When ivar corresponds to an array variable, the dense vector is in size of ndof * count,
2656 * where count is the number of components of the array variable. The local residual is ordered
2657 * as (r_i,j, i = 1,...,ndof; j = 1,...,count).
2658 *
2659 * Dense vectors for variables (ivar+i, i = 1,...,count) are empty.
2660 */
2661 std::vector<std::vector<DenseVector<Number>>> _sub_Re;
2662 std::vector<std::vector<DenseVector<Number>>> _sub_Rn;
2664 std::vector<std::vector<DenseVector<Number>>> _sub_Rl;
2665
2667 DenseVector<Number> _tmp_Re;
2668
2669 /*
2670 * Jacobian contributions <Tag, ivar, jvar>
2671 * When ivar corresponds to an array variable, the number of rows of the dense matrix is in size
2672 * of indof * icount, where icount is the number of components of ivar. When jvar corresponds to
2673 * an array variable, the number of columns of the dense matrix is in size of jndof * jcount,
2674 * where jcount is the number of components of jvar. The local residual is ordered as
2675 * (K_(i,j,k,l), k=1,...,jndof; l = 1,...,jcout; i = 1,...,indof; j = 1,...,icount).
2676 *
2677 * Dense matrices for variables (ivar+i, i = 1,...,icount) or (jvar+j, j = 1,...,jcount) are
2678 * empty.
2679 */
2680 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kee;
2681 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Keg;
2682
2684 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Ken;
2686 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kne;
2688 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knn;
2690 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kll;
2692 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kle;
2694 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kln;
2696 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Kel;
2698 std::vector<std::vector<std::vector<DenseMatrix<Number>>>> _sub_Knl;
2699
2701 DenseMatrix<Number> _tmp_Ke;
2702
2703 // Shape function values, gradients. second derivatives
2707
2711
2715
2719
2720 // Shape function values, gradients, second derivatives
2726
2732
2738
2744
2754
2764
2766 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data;
2767 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face;
2768 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_neighbor;
2769 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_face_neighbor;
2770 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_lower;
2771 mutable std::map<FEType, std::unique_ptr<FEShapeData>> _fe_shape_data_dual_lower;
2772
2774 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data;
2775 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face;
2776 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_neighbor;
2777 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_face_neighbor;
2778 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_lower;
2779 mutable std::map<FEType, std::unique_ptr<VectorFEShapeData>> _vector_fe_shape_data_dual_lower;
2780
2781 mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data;
2782 mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>> _ad_vector_grad_phi_data;
2783 mutable std::map<FEType, ADTemplateVariablePhiGradient<Real>> _ad_grad_phi_data_face;
2784 mutable std::map<FEType, ADTemplateVariablePhiGradient<RealVectorValue>>
2786
2796 const std::vector<VectorTag> & _residual_vector_tags;
2797
2799 std::vector<std::vector<Real>> _cached_residual_values;
2800
2802 std::vector<std::vector<dof_id_type>> _cached_residual_rows;
2803
2805
2807 std::vector<std::vector<Real>> _cached_jacobian_values;
2809 std::vector<std::vector<dof_id_type>> _cached_jacobian_rows;
2811 std::vector<std::vector<dof_id_type>> _cached_jacobian_cols;
2812
2814
2819 std::vector<bool> _component_block_diagonal;
2820
2822 std::vector<dof_id_type> _temp_dof_indices;
2823
2825 std::vector<Point> _temp_reference_points;
2826
2828 std::vector<VectorValue<ADReal>> _ad_dxyzdxi_map;
2829 std::vector<VectorValue<ADReal>> _ad_dxyzdeta_map;
2830 std::vector<VectorValue<ADReal>> _ad_dxyzdzeta_map;
2831 std::vector<VectorValue<ADReal>> _ad_d2xyzdxi2_map;
2832 std::vector<VectorValue<ADReal>> _ad_d2xyzdxideta_map;
2833 std::vector<VectorValue<ADReal>> _ad_d2xyzdeta2_map;
2834 std::vector<ADReal> _ad_jac;
2837 std::vector<ADReal> _ad_dxidx_map;
2838 std::vector<ADReal> _ad_dxidy_map;
2839 std::vector<ADReal> _ad_dxidz_map;
2840 std::vector<ADReal> _ad_detadx_map;
2841 std::vector<ADReal> _ad_detady_map;
2842 std::vector<ADReal> _ad_detadz_map;
2843 std::vector<ADReal> _ad_dzetadx_map;
2844 std::vector<ADReal> _ad_dzetady_map;
2845 std::vector<ADReal> _ad_dzetadz_map;
2846
2852
2856 std::vector<std::pair<unsigned int, unsigned short>> _disp_numbers_and_directions;
2857
2858 mutable bool _calculate_xyz;
2861
2865
2866 mutable std::set<FEType> _need_second_derivative;
2867 mutable std::set<FEType> _need_second_derivative_neighbor;
2868 mutable std::set<FEType> _need_curl;
2869 mutable std::set<FEType> _need_div;
2870 mutable std::set<FEType> _need_face_div;
2871 mutable std::set<FEType> _need_neighbor_div;
2872 mutable std::set<FEType> _need_face_neighbor_div;
2873
2875 const NumericVector<Real> * _scaling_vector = nullptr;
2876
2883
2884 const Elem * _msm_elem = nullptr;
2885
2889 DenseVector<Number> _element_vector;
2890
2894 DenseMatrix<Number> _element_matrix;
2895
2899 std::vector<dof_id_type> _row_indices, _column_indices;
2900
2903
2906};
2907
2908template <typename OutputType>
2911{
2912 buildLowerDFE(type);
2913 return _fe_shape_data_lower[type]->_phi;
2914}
2915
2916template <typename OutputType>
2919{
2920 buildLowerDDualFE(type);
2921 return _fe_shape_data_dual_lower[type]->_phi;
2922}
2923
2924template <typename OutputType>
2927{
2928 buildLowerDFE(type);
2929 return _fe_shape_data_lower[type]->_grad_phi;
2930}
2931
2932template <typename OutputType>
2935{
2936 buildLowerDDualFE(type);
2937 return _fe_shape_data_dual_lower[type]->_grad_phi;
2938}
2939
2940template <>
2942Assembly::feADGradPhi<RealVectorValue>(FEType type) const
2943{
2944 return _ad_vector_grad_phi_data[type];
2945}
2946
2947template <>
2949Assembly::feADGradPhiFace<RealVectorValue>(FEType type) const
2950{
2951 return _ad_vector_grad_phi_data_face[type];
2952}
2953
2954template <>
2956Assembly::fePhi<VectorValue<Real>>(FEType type) const;
2957
2958template <>
2960Assembly::feGradPhi<VectorValue<Real>>(FEType type) const;
2961
2962template <>
2964Assembly::feSecondPhi<VectorValue<Real>>(FEType type) const;
2965
2966template <>
2968Assembly::fePhiLower<VectorValue<Real>>(FEType type) const;
2969
2970template <>
2972Assembly::feDualPhiLower<VectorValue<Real>>(FEType type) const;
2973
2974template <>
2976Assembly::feGradPhiLower<VectorValue<Real>>(FEType type) const;
2977
2978template <>
2980Assembly::feGradDualPhiLower<VectorValue<Real>>(FEType type) const;
2981
2982template <>
2984Assembly::fePhiFace<VectorValue<Real>>(FEType type) const;
2985
2986template <>
2988Assembly::feGradPhiFace<VectorValue<Real>>(FEType type) const;
2989
2990template <>
2992Assembly::feSecondPhiFace<VectorValue<Real>>(FEType type) const;
2993
2994template <>
2996Assembly::fePhiNeighbor<VectorValue<Real>>(FEType type) const;
2997
2998template <>
3000Assembly::feGradPhiNeighbor<VectorValue<Real>>(FEType type) const;
3001
3002template <>
3004Assembly::feSecondPhiNeighbor<VectorValue<Real>>(FEType type) const;
3005
3006template <>
3008Assembly::fePhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3009
3010template <>
3012Assembly::feGradPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3013
3014template <>
3016Assembly::feSecondPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3017
3018template <>
3020Assembly::feCurlPhi<VectorValue<Real>>(FEType type) const;
3021
3022template <>
3024Assembly::feCurlPhiFace<VectorValue<Real>>(FEType type) const;
3025
3026template <>
3028Assembly::feCurlPhiNeighbor<VectorValue<Real>>(FEType type) const;
3029
3030template <>
3032Assembly::feCurlPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3033
3034template <>
3036Assembly::feDivPhi<VectorValue<Real>>(FEType type) const;
3037
3038template <>
3040Assembly::feDivPhiFace<VectorValue<Real>>(FEType type) const;
3041
3042template <>
3044Assembly::feDivPhiNeighbor<VectorValue<Real>>(FEType type) const;
3045
3046template <>
3048Assembly::feDivPhiFaceNeighbor<VectorValue<Real>>(FEType type) const;
3049
3050template <>
3052Assembly::adGradPhi<RealVectorValue>(const MooseVariableFE<RealVectorValue> & v) const
3053{
3054 return _ad_vector_grad_phi_data.at(v.feType());
3055}
3056
3057template <typename Residuals, typename Indices>
3058void
3059Assembly::cacheResiduals(const Residuals & residuals,
3060 const Indices & input_row_indices,
3061 const Real scaling_factor,
3063 const std::set<TagID> & vector_tags)
3064{
3065 mooseAssert(residuals.size() == input_row_indices.size(),
3066 "The number of residuals should match the number of dof indices");
3067 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3068
3069 if (!computingResidual() || vector_tags.empty())
3070 return;
3071
3072 if (residuals.size() == 1)
3073 {
3074 // No constraining is required. (This is likely a finite volume computation if we only have a
3075 // single dof)
3077 residuals, input_row_indices, scaling_factor, LocalDataKey{}, vector_tags);
3078 return;
3079 }
3080
3081 // Need to make a copy because we might modify this in constrain_element_vector
3082 _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3083
3085 for (const auto i : index_range(_row_indices))
3086 _element_vector(i) = MetaPhysicL::raw_value(residuals[i]) * scaling_factor;
3087
3088 // At time of writing, this method doesn't do anything with the asymmetric_constraint_rows
3089 // argument, but we set it to false to be consistent with processLocalResidual
3091 _element_vector, _row_indices, /*asymmetric_constraint_rows=*/false);
3092
3093 for (const auto i : index_range(_row_indices))
3094 cacheResidual(_row_indices[i], _element_vector(i), vector_tags);
3095}
3096
3097template <typename Residuals, typename Indices>
3098void
3100 const Indices & row_indices,
3101 const Real scaling_factor,
3103 const std::set<TagID> & vector_tags)
3104{
3105 mooseAssert(residuals.size() == row_indices.size(),
3106 "The number of residuals should match the number of dof indices");
3107 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3108
3109 if (computingResidual() && !vector_tags.empty())
3110 for (const auto i : index_range(row_indices))
3112 row_indices[i], MetaPhysicL::raw_value(residuals[i]) * scaling_factor, vector_tags);
3113}
3114
3115template <typename Residuals, typename Indices>
3116void
3117Assembly::cacheJacobian(const Residuals & residuals,
3118 const Indices & input_row_indices,
3119 const Real scaling_factor,
3121 const std::set<TagID> & matrix_tags)
3122{
3123 if (!computingJacobian() || matrix_tags.empty())
3124 return;
3125
3126 if (residuals.size() == 1)
3127 {
3128 // No constraining is required. (This is likely a finite volume computation if we only have a
3129 // single dof)
3131 residuals, input_row_indices, scaling_factor, LocalDataKey{}, matrix_tags);
3132 return;
3133 }
3134
3135 const auto & compare_dofs = residuals[0].derivatives().nude_indices();
3136#ifndef NDEBUG
3137 auto compare_dofs_set = std::set<dof_id_type>(compare_dofs.begin(), compare_dofs.end());
3138
3139 for (const auto i : make_range(decltype(residuals.size())(1), residuals.size()))
3140 {
3141 const auto & residual = residuals[i];
3142 auto current_dofs_set = std::set<dof_id_type>(residual.derivatives().nude_indices().begin(),
3143 residual.derivatives().nude_indices().end());
3144 mooseAssert(compare_dofs_set == current_dofs_set,
3145 "We're going to see whether the dof sets are the same. IIRC the degree of freedom "
3146 "dependence (as indicated by the dof index set held by the ADReal) has to be the "
3147 "same for every residual passed to this method otherwise constrain_element_matrix "
3148 "will not work.");
3149 }
3150#endif
3151 _column_indices.assign(compare_dofs.begin(), compare_dofs.end());
3152
3153 // If there's no derivatives then there is nothing to do. Moreover, if we pass zero size column
3154 // indices to constrain_element_matrix then we will potentially get errors out of BLAS
3155 if (!_column_indices.size())
3156 return;
3157
3158 // Need to make a copy because we might modify this in constrain_element_matrix
3159 _row_indices.assign(input_row_indices.begin(), input_row_indices.end());
3160
3162 for (const auto i : index_range(_row_indices))
3163 {
3164 const auto & sparse_derivatives = residuals[i].derivatives();
3165
3166 for (const auto j : index_range(_column_indices))
3167 _element_matrix(i, j) = sparse_derivatives[_column_indices[j]] * scaling_factor;
3168 }
3169
3171
3172 for (const auto i : index_range(_row_indices))
3173 for (const auto j : index_range(_column_indices))
3174 cacheJacobian(_row_indices[i], _column_indices[j], _element_matrix(i, j), {}, matrix_tags);
3175}
3176
3177template <typename Residuals, typename Indices>
3178void
3180 const Indices & row_indices,
3181 const Real scaling_factor,
3183 const std::set<TagID> & matrix_tags)
3184{
3185 mooseAssert(residuals.size() == row_indices.size(),
3186 "The number of residuals should match the number of dof indices");
3187 mooseAssert(residuals.size() >= 1, "Why you calling me with no residuals?");
3188
3189 if (!computingJacobian() || matrix_tags.empty())
3190 return;
3191
3192 for (const auto i : index_range(row_indices))
3193 {
3194 const auto row_index = row_indices[i];
3195
3196 const auto & sparse_derivatives = residuals[i].derivatives();
3197 const auto & column_indices = sparse_derivatives.nude_indices();
3198 const auto & raw_derivatives = sparse_derivatives.nude_data();
3199
3200 for (std::size_t j = 0; j < column_indices.size(); ++j)
3202 row_index, column_indices[j], raw_derivatives[j] * scaling_factor, {}, matrix_tags);
3203 }
3204}
3205
3206inline const Real &
3212
3213inline const Real &
3219
3220inline void
3222 std::vector<std::pair<unsigned int, unsigned short>> && disp_numbers_and_directions)
3223{
3224 _disp_numbers_and_directions = std::move(disp_numbers_and_directions);
3225}
3226
3227inline void
3228Assembly::setCurrentLowerDElem(const Elem * const lower_d_elem)
3229{
3230 _current_lower_d_elem = lower_d_elem;
3231}
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:43
MooseVariableFE< RealVectorValue > VectorMooseVariable
Definition Assembly.h:61
boundary_id_type BoundaryID
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:2751
VariablePhiValue _phi
Definition Assembly.h:2748
VariablePhiGradient _grad_phi
Definition Assembly.h:2749
VariablePhiSecond _second_phi
Definition Assembly.h:2750
VariablePhiDivergence _div_phi
Definition Assembly.h:2752
Key structure for APIs manipulating global vectors/matrices.
Definition Assembly.h:845
GlobalDataKey(const GlobalDataKey &)
Definition Assembly.h:854
Key structure for APIs adding/caching local element residuals/Jacobians.
Definition Assembly.h:863
LocalDataKey(const LocalDataKey &)
Definition Assembly.h:868
VectorVariablePhiValue _phi
Definition Assembly.h:2758
VectorVariablePhiGradient _grad_phi
Definition Assembly.h:2759
VectorVariablePhiSecond _second_phi
Definition Assembly.h:2760
VectorVariablePhiCurl _curl_phi
Definition Assembly.h:2761
VectorVariablePhiDivergence _div_phi
Definition Assembly.h:2762
Keeps track of stuff related to assembling.
Definition Assembly.h:110
DenseMatrix< Number > & jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
Get local Jacobian block from non-local contribution for a pair of variables and a tag.
Definition Assembly.h:1153
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kll
dlower/dlower
Definition Assembly.h:2690
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:2819
void cacheJacobianNonlocal(GlobalDataKey)
Takes the values that are currently in _sub_Keg and appends them to the cached values.
Definition Assembly.C:4075
const VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1394
SystemBase & _sys
Definition Assembly.h:2313
std::map< unsigned int, FEBase * > _holder_fe_lower_helper
helper object for transforming coordinates for lower dimensional element quadrature points
Definition Assembly.h:2561
const VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1355
std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > _cm_sf_entry
Entries in the coupling matrix for scalar variables vs field variables.
Definition Assembly.h:2336
void addJacobian(GlobalDataKey)
Adds all local Jacobian to the global Jacobian matrices.
Definition Assembly.C:3857
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:2276
const Real & neighborLowerDElemVolume() const
Definition Assembly.h:3214
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:1866
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:3384
void assignDisplacements(std::vector< std::pair< unsigned int, unsigned short > > &&disp_numbers_and_directions)
Assign the displacement numbers and directions.
Definition Assembly.h:3221
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:144
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:2774
const bool & _computing_jacobian
Whether we are currently computing the Jacobian.
Definition Assembly.h:2326
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition Assembly.h:2419
VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1470
const std::vector< Real > * _JxW_msm
A JxW for working on mortar segement elements.
Definition Assembly.h:2580
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kee
Definition Assembly.h:2680
std::set< FEType > _need_face_neighbor_div
Definition Assembly.h:2872
VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1527
void prepareLowerD()
Prepare the Jacobians and residuals for a lower dimensional element.
Definition Assembly.C:2850
void modifyWeightsDueToXFEM(const Elem *elem)
Update the integration weights for XFEM partial elements.
Definition Assembly.C:4518
VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1510
void reinitFVFace(const FaceInfo &fi)
Definition Assembly.C:1859
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFace(FEType type) const
Definition Assembly.h:1667
VectorVariablePhiValue & phiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1515
std::vector< std::vector< DenseVector< Number > > > _sub_Re
Definition Assembly.h:2661
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:3442
void reinitFE(const Elem *elem)
Just an internal helper function to reinit the volume FE objects.
Definition Assembly.C:762
DenseMatrix< Number > _element_matrix
A working matrix to avoid repeated heap allocations when caching Jacobians that must have libMesh-lev...
Definition Assembly.h:2894
VectorVariablePhiValue _vector_phi_face_neighbor
Definition Assembly.h:2739
const VariablePhiValue & phiFace() const
Definition Assembly.h:1335
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & nonlocalCouplingEntries()
Definition Assembly.h:1304
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:619
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1478
MooseArray< Real > _curvatures
Definition Assembly.h:2850
std::vector< std::unique_ptr< FEBase > > _unique_fe_lower_helper
Definition Assembly.h:2374
MooseArray< Real > _coord_neighbor
The current coordinate transformation coefficients.
Definition Assembly.h:2572
const OutputTools< OutputType >::VariablePhiValue & fePhiFaceNeighbor(FEType type) const
Definition Assembly.h:1710
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1487
const bool _displaced
Definition Assembly.h:2316
void reinitFEFaceNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition Assembly.C:1575
void reinitFENeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition Assembly.C:1634
VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1552
void prepareVariableNonlocal(MooseVariableFieldBase *var)
Definition Assembly.C:2782
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhi(FEType type) const
Definition Assembly.h:1766
void prepareBlock(unsigned int ivar, unsigned jvar, const std::vector< dof_id_type > &dof_indices)
Definition Assembly.C:2902
VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1556
std::vector< ADReal > _ad_dzetady_map
Definition Assembly.h:2844
VariablePhiGradient _grad_phi
Definition Assembly.h:2705
libMesh::QBase * _current_qrule_face
quadrature rule used on faces
Definition Assembly.h:2523
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiNeighbor(FEType type) const
Definition Assembly.h:1781
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:2816
virtual ~Assembly()
Definition Assembly.C:188
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:2345
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:3099
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:2240
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:3221
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1758
VectorVariablePhiCurl _vector_curl_phi
Definition Assembly.h:2724
MooseArray< VectorValue< ADReal > > _ad_q_points
Definition Assembly.h:2836
bool _current_side_volume_computed
Boolean to indicate whether current element side volumes has been computed.
Definition Assembly.h:2629
MooseArray< Real > _current_JxW_face
The current transformed jacobian weights on a face.
Definition Assembly.h:2529
const FEType _helper_type
The finite element type of the FE helper classes.
Definition Assembly.h:2359
Real _current_elem_volume
Volume of the current element.
Definition Assembly.h:2603
const MooseArray< Point > & normals() const
Returns the array of normals for quadrature points on a current side.
Definition Assembly.h:357
VectorVariablePhiSecond _vector_second_phi_face_neighbor
Definition Assembly.h:2741
const VectorVariablePhiDivergence & divPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1389
void cacheJacobianCoupledVarPair(const MooseVariableBase &ivar, const MooseVariableBase &jvar)
Caches element matrix for ivar rows and jvar columns.
Definition Assembly.C:4059
const VariablePhiValue & phi(const MooseVariableField< Real > &) const
Definition Assembly.h:1326
bool _building_helpers
Whether we are currently building the FE classes for the helpers.
Definition Assembly.h:2377
void addJacobianScalar(GlobalDataKey)
Add Jacobians for pairs of scalar variables into the global Jacobian matrices.
Definition Assembly.C:4440
void setVolumeQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for volume integration.
Definition Assembly.C:657
void computeCurrentNeighborVolume()
const VariablePhiGradient & gradPhi() const
Definition Assembly.h:1327
FEBase * _current_fe_face_helper
helper object for transforming coordinates
Definition Assembly.h:2521
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:3665
FEBase * _current_fe_helper
The current helper object for transforming coordinates.
Definition Assembly.h:2409
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called....
Definition Assembly.h:2647
VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1540
void addJacobianLowerD(GlobalDataKey)
Add portions of the Jacobian of LowerLower, LowerSecondary, and SecondaryLower for boundary condition...
Definition Assembly.C:4008
libMesh::QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition Assembly.h:2411
libMesh::QBase * writeableQRuleFace(unsigned int dim, SubdomainID block, InternalDataKey)
Returns the pointer to the quadrature used on a face of specified block and dimension.
Definition Assembly.h:335
const MooseArray< Point > & qPoints() const
Returns the reference to the quadrature points.
Definition Assembly.h:258
const bool & _computing_residual
Whether we are currently computing the residual.
Definition Assembly.h:2323
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:1817
MooseArray< VectorValue< ADReal > > _ad_normals
Definition Assembly.h:2848
VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1564
libMesh::QBase * writeableQRule(unsigned int dim, SubdomainID block, InternalDataKey)
Returns the pointer to the quadrature of specified block and dimension.
Definition Assembly.h:248
const std::vector< std::pair< MooseVariableScalar *, MooseVariableFieldBase * > > & scalarFieldCouplingEntries() const
Definition Assembly.h:1314
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:4447
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:4565
void computeCurrentFaceVolume()
Definition Assembly.C:1775
VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1506
const VariablePhiGradient & gradPhiFace() const
Definition Assembly.h:1337
bool _need_JxW_neighbor
Flag to indicate that JxW_neighbor is needed.
Definition Assembly.h:2568
VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1502
const BoundaryID & currentBoundaryID() const
Return the current boundary ID.
Definition Assembly.h:429
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhi(FEType type) const
Definition Assembly.h:1639
VectorVariablePhiSecond _vector_second_phi
Definition Assembly.h:2723
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiLower(FEType type) const
Definition Assembly.h:2926
bool _user_added_fe_of_helper_type
Whether user code requested a FEType the same as our _helper_type.
Definition Assembly.h:2362
VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1548
void setVolumeQRule(const Elem *elem)
Set the volumetric quadrature rule based on the provided element.
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:192
VectorVariablePhiCurl _vector_curl_phi_neighbor
Definition Assembly.h:2736
void setCurrentNeighborSubdomainID(SubdomainID i)
set the current subdomain ID
Definition Assembly.h:502
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data
Definition Assembly.h:2782
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe
Each dimension's actual vector fe objects indexed on type.
Definition Assembly.h:2405
const MooseArray< ADPoint > & adQPointsFace() const
Definition Assembly.h:401
MooseArray< ADReal > _ad_JxW_face
Definition Assembly.h:2847
bool _calculate_xyz
Definition Assembly.h:2858
const VariablePhiValue & phi() const
Definition Assembly.h:1320
void buildFaceNeighborFE(FEType type) const
Build FEs for a neighbor face with a type.
Definition Assembly.C:338
const VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1377
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition Assembly.h:2599
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face
Definition Assembly.h:2775
const libMesh::CouplingMatrix & _nonlocal_cm
Definition Assembly.h:2320
VectorVariablePhiDivergence _vector_div_phi_neighbor
Definition Assembly.h:2737
Real _current_neighbor_volume
Volume of the current neighbor.
Definition Assembly.h:2621
const FEVectorBase *const & getVectorFE(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current volume FEVector.
Definition Assembly.h:180
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:2640
DenseVector< Real > getJacobianDiagonal(const DenseMatrix< Number > &ke)
Definition Assembly.h:1892
Moose::CoordinateSystemType _coord_type
The coordinate system.
Definition Assembly.h:2423
VectorVariablePhiGradient _vector_grad_phi_face_neighbor
Definition Assembly.h:2740
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:2196
std::map< FEType, FEBase * > _current_fe_neighbor
The "neighbor" fe object that matches the current elem.
Definition Assembly.h:2387
const OutputTools< OutputType >::VariablePhiValue & fePhiLower(FEType type) const
Definition Assembly.h:2910
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_lower
FE objects for lower dimensional elements.
Definition Assembly.h:2557
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
Definition Assembly.h:2662
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:2285
VariablePhiValue _phi_face_neighbor
Definition Assembly.h:2716
const dof_id_type & extraElemID(unsigned int id) const
Returns an integer ID of the current element given the index associated with the integer.
Definition Assembly.h:378
void buildVectorNeighborFE(FEType type) const
Build Vector FEs for a neighbor with a type.
Definition Assembly.C:516
std::vector< Eigen::Map< RealDIMValue > > _mapped_normals
Mapped normals.
Definition Assembly.h:2533
const libMesh::DofMap & _dof_map
DOF map.
Definition Assembly.h:2349
const VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1342
void setFaceQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for face integration.
Definition Assembly.C:676
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
Definition Assembly.h:2548
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1483
void prepareScalar()
Definition Assembly.C:2953
const OutputTools< OutputType >::VariablePhiValue & feDualPhiLower(FEType type) const
Definition Assembly.h:2918
std::set< FEType > _need_second_derivative_neighbor
Definition Assembly.h:2867
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Ken
jacobian contributions from the element and neighbor <Tag, ivar, jvar>
Definition Assembly.h:2684
std::vector< VectorValue< ADReal > > _ad_dxyzdxi_map
AD quantities.
Definition Assembly.h:2828
VariablePhiSecond _second_phi_face
Definition Assembly.h:2710
const MooseArray< ADReal > & adCurvatures() const
Definition Assembly.C:4798
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_neighbor_helper
Definition Assembly.h:2372
std::vector< Point > _temp_reference_points
Temporary work data for reinitAtPhysical()
Definition Assembly.h:2825
std::vector< std::pair< MooseVariableScalar *, MooseVariableScalar * > > _cm_ss_entry
Entries in the coupling matrix for scalar variables.
Definition Assembly.h:2338
const Elem * _current_lower_d_elem
The current lower dimensional element.
Definition Assembly.h:2632
unsigned int _current_side
The current side of the selected element (valid only when working with sides)
Definition Assembly.h:2605
const bool & _computing_residual_and_jacobian
Whether we are currently computing the residual and Jacobian.
Definition Assembly.h:2329
void buildNeighborFE(FEType type) const
Build FEs for a neighbor with a type.
Definition Assembly.C:316
ArbitraryQuadrature * qruleArbitraryFace(const Elem *elem, unsigned int side)
Definition Assembly.C:1925
const OutputTools< OutputType >::VariablePhiGradient & feGradDualPhiLower(FEType type) const
Definition Assembly.h:2934
std::unordered_map< SubdomainID, std::vector< QRules > > _qrules
Holds quadrature rules for each dimension.
Definition Assembly.h:2460
void setCoordinateTransformation(const libMesh::QBase *qrule, const Points &q_points, Coords &coord, SubdomainID sub_id)
Definition Assembly.C:1733
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:1794
std::map< FEType, FEVectorBase * > _current_vector_fe
The "volume" vector fe object that matches the current elem.
Definition Assembly.h:2392
std::vector< VectorValue< ADReal > > _ad_dxyzdzeta_map
Definition Assembly.h:2830
VariablePhiValue & phiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1582
VariablePhiSecond & secondPhi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1580
VariablePhiGradient _grad_phi_neighbor
Definition Assembly.h:2713
bool computingResidualAndJacobian() const
Definition Assembly.h:1956
libMesh::QBase *const & writeableQRuleNeighbor()
Returns the reference to the current quadrature being used on a current neighbor.
Definition Assembly.h:527
std::unique_ptr< FEBase > _fe_msm
A FE object for working on mortar segement elements.
Definition Assembly.h:2582
std::vector< ADReal > _ad_detadx_map
Definition Assembly.h:2840
void addJacobianNonlocal(GlobalDataKey)
Adds non-local Jacobian to the global Jacobian matrices.
Definition Assembly.C:3870
const VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1351
const unsigned int & neighborSide() const
Returns the current neighboring side.
Definition Assembly.h:452
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:3339
bool computingResidual() const
Definition Assembly.h:1946
void prepareNeighbor()
Definition Assembly.C:2812
VectorVariablePhiGradient _vector_grad_phi_neighbor
Definition Assembly.h:2734
const MooseArray< Point > & physicalPoints() const
The current points in physical space where we have reinited through reinitAtPhysical()
Definition Assembly.h:270
const Elem *const & elem() const
Return the current element.
Definition Assembly.h:414
std::map< FEType, FEVectorBase * > _current_vector_fe_face_neighbor
The "neighbor face" vector fe object that matches the current elem.
Definition Assembly.h:2398
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:2420
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition Assembly.h:2625
std::vector< ADReal > _ad_dxidx_map
Definition Assembly.h:2837
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction)
Definition Assembly.h:2701
void buildFE(FEType type) const
Build FEs with a type.
Definition Assembly.C:268
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1726
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:3059
void setXFEM(std::shared_ptr< XFEMInterface > xfem)
Set the pointer to the XFEM controller object.
Definition Assembly.h:1801
VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1531
const Elem *const & neighborLowerDElem() const
Return the neighboring lower dimensional element.
Definition Assembly.h:482
const Elem * _current_neighbor_side_elem
The current side element of the ncurrent neighbor element.
Definition Assembly.h:2617
std::vector< ADReal > _ad_dxidz_map
Definition Assembly.h:2839
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:3456
VariablePhiGradient _grad_phi_face_neighbor
Definition Assembly.h:2717
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_neighbor
Definition Assembly.h:2549
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kle
dlower/dsecondary (or dlower/delement)
Definition Assembly.h:2692
MooseArray< ADReal > _ad_JxW
Definition Assembly.h:2835
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:3424
void copyFaceShapes(MooseVariableField< T > &v)
Definition Assembly.C:3040
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:3317
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction)
Definition Assembly.h:2667
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries()
Definition Assembly.h:1294
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:3289
const VariablePhiValue & phiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1336
bool _calculate_ad_coord
Whether to calculate coord with AD.
Definition Assembly.h:2864
const libMesh::CouplingMatrix * _cm
Coupling matrices.
Definition Assembly.h:2319
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:2249
VectorVariablePhiCurl _vector_curl_phi_face
Definition Assembly.h:2730
VariablePhiGradient & gradPhi(const MooseVariableField< Real > &)
Definition Assembly.h:1466
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition Assembly.h:2527
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_neighbor
Definition Assembly.h:2776
void cacheJacobianNeighbor(GlobalDataKey)
Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached val...
Definition Assembly.C:4097
const libMesh::QBase *const & qRuleMortar() const
Returns a reference to the quadrature rule for the mortar segments.
Definition Assembly.h:712
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:3161
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:2292
void setNeighborQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for neighbor integration.
Definition Assembly.C:711
void helpersRequestData()
request phi, dphi, xyz, JxW, etc.
Definition Assembly.C:4811
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knn
jacobian contributions from the neighbor <Tag, ivar, jvar>
Definition Assembly.h:2688
const MooseArray< ADPoint > & adQPoints() const
Definition Assembly.h:395
libMesh::QBase *const & writeableQRule()
Returns the reference to the current quadrature being used.
Definition Assembly.h:241
void clearCachedQRules()
Set the cached quadrature rules to nullptr.
Definition Assembly.C:728
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kln
dlower/dprimary (or dlower/dneighbor)
Definition Assembly.h:2694
VariablePhiSecond & secondPhi(const MooseVariableField< Real > &)
Definition Assembly.h:1467
libMesh::QBase * _current_qrule_neighbor
quadrature rule used on neighbors
Definition Assembly.h:2564
void setLowerQRule(libMesh::QBase *qrule, unsigned int dim)
Set the qrule to be used for lower dimensional integration.
Definition Assembly.C:692
void buildLowerDFE(FEType type) const
Build FEs for a lower dimensional element with a type.
Definition Assembly.C:360
const VectorVariablePhiCurl & curlPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1429
VariablePhiGradient _grad_phi_face
Definition Assembly.h:2709
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:2347
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries() const
Definition Assembly.h:1299
const std::vector< Point > & qPointsMortar() const
Returns the reference to the mortar segment element quadrature points.
Definition Assembly.h:264
std::map< unsigned int, const std::vector< Point > * > _holder_normals
Holds pointers to the dimension's normal vectors.
Definition Assembly.h:2542
const OutputTools< OutputType >::VariablePhiValue & fePhiNeighbor(FEType type) const
Definition Assembly.h:1688
libMesh::QBase *const & writeableQRuleFace()
Returns the reference to the current quadrature being used on a current face.
Definition Assembly.h:328
void setCurrentSubdomainID(SubdomainID i)
set the current subdomain ID
Definition Assembly.h:424
Real elementVolume(const Elem *elem) const
On-demand computation of volume element accounting for RZ/RSpherical.
Definition Assembly.C:3757
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition Assembly.h:2547
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:1364
const VariablePhiGradient & gradPhiFace(const MooseVariableField< Real > &) const
Definition Assembly.h:1338
const OutputTools< OutputType >::VariablePhiGradient & feGradPhi(FEType type) const
Definition Assembly.h:1626
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiFace(FEType type) const
Definition Assembly.h:1742
const unsigned int & side() const
Returns the current side.
Definition Assembly.h:446
std::vector< VectorValue< ADReal > > _ad_d2xyzdeta2_map
Definition Assembly.h:2833
BoundaryID _current_boundary_id
The current boundary ID.
Definition Assembly.h:2601
MooseArray< std::vector< Point > > _current_tangents
The current tangent vectors at the quadrature points.
Definition Assembly.h:2535
std::vector< std::unique_ptr< FEBase > > _unique_fe_face_helper
Definition Assembly.h:2371
std::map< FEType, FEBase * > _current_fe
The "volume" fe object that matches the current elem.
Definition Assembly.h:2383
VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1519
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhiFace(FEType type) const
Definition Assembly.h:1674
const std::vector< Eigen::Map< RealDIMValue > > & mappedNormals() const
Definition Assembly.h:362
const VectorVariablePhiCurl & curlPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1385
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:2927
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_lower
Definition Assembly.h:2770
VectorVariablePhiGradient & gradPhi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1498
const Real & lowerDElemVolume() const
Definition Assembly.h:3207
VariablePhiSecond _second_phi
Definition Assembly.h:2706
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:3721
std::vector< VectorValue< ADReal > > _ad_d2xyzdxideta_map
Definition Assembly.h:2832
void reinit(const Elem *elem, unsigned int side)
Reinitialize the assembly data on an side of an element.
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:2496
const MooseArray< ADPoint > & adNormals() const
Definition Assembly.h:393
std::vector< std::pair< unsigned int, unsigned short > > _disp_numbers_and_directions
Container of displacement numbers and directions.
Definition Assembly.h:2856
T * qruleFaceHelper(const Elem *elem, unsigned int side, std::function< T *(QRules &)> rule_fn)
Definition Assembly.h:2472
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face
types of vector finite elements
Definition Assembly.h:2517
VectorVariablePhiValue _vector_phi
Definition Assembly.h:2721
void buildVectorLowerDFE(FEType type) const
Build Vector FEs for a lower dimensional element with a type.
Definition Assembly.C:405
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:4425
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiNeighbor(FEType type) const
Definition Assembly.h:1702
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension's actual fe objects indexed on type.
Definition Assembly.h:2403
std::set< FEType > _need_curl
Definition Assembly.h:2868
const VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1368
const VectorVariablePhiSecond & secondPhi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1381
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:2370
unsigned int numExtraElemIntegers() const
Number of extra element integers Assembly tracked.
Definition Assembly.h:373
const libMesh::QBase * attachQRuleElem(unsigned int dim, FEBase &fe)
Attaches the current elem/volume quadrature rule to the given fe.
Definition Assembly.h:1908
void activateDual()
Indicates that dual shape functions are used for mortar constraint.
Definition Assembly.h:617
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_ff_entry
Entries in the coupling matrix for field variables.
Definition Assembly.h:2332
const Moose::CoordinateSystemType & coordSystem() const
Get the coordinate system type.
Definition Assembly.h:316
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > _cm_nonlocal_entry
Entries in the coupling matrix for field variables for nonlocal calculations.
Definition Assembly.h:2340
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition Assembly.h:2627
VectorVariablePhiSecond _vector_second_phi_neighbor
Definition Assembly.h:2735
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > & fieldScalarCouplingEntries() const
Definition Assembly.h:1309
const VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1373
DenseVector< Number > & residualBlockNeighbor(unsigned int var_num, LocalDataKey, TagID tag_id)
Get local neighbor residual block for a variable and a tag.
Definition Assembly.h:1124
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1718
void buildLowerDDualFE(FEType type) const
Definition Assembly.C:384
VariablePhiValue _phi_neighbor
Definition Assembly.h:2712
VariablePhiValue & phiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1469
void addCachedResidualDirectly(NumericVector< Number > &residual, GlobalDataKey, const VectorTag &vector_tag)
Adds the values that have been cached by calling cacheResidual(), cacheResidualNeighbor(),...
Definition Assembly.C:3515
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition Assembly.h:2515
std::vector< ADReal > _ad_jac
Definition Assembly.h:2834
void addJacobianNeighbor(GlobalDataKey)
Add ElementNeighbor, NeighborElement, and NeighborNeighbor portions of the Jacobian for compute objec...
Definition Assembly.C:3892
VectorVariablePhiCurl _vector_curl_phi_face_neighbor
Definition Assembly.h:2742
void setMortarQRule(Order order)
Specifies a custom qrule for integration on mortar segment mesh.
Definition Assembly.C:737
void saveLocalADArray(std::vector< ADReal > &re, unsigned int i, unsigned int ntest, const ADRealEigenVector &v) const
Definition Assembly.C:3790
VariablePhiGradient & gradPhi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1579
const std::vector< VectorTag > & _residual_vector_tags
The residual vector tags that Assembly could possibly contribute to.
Definition Assembly.h:2796
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition Assembly.h:2611
VectorVariablePhiDivergence _vector_div_phi_face
Definition Assembly.h:2731
bool _user_added_fe_face_neighbor_of_helper_type
Definition Assembly.h:2364
const MooseArray< ADReal > & adJxWFace() const
Definition Assembly.h:280
std::vector< ADReal > _ad_dzetadx_map
Definition Assembly.h:2843
std::vector< dof_id_type > _column_indices
Definition Assembly.h:2899
const FEBase *const & getFE(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current volume FE.
Definition Assembly.h:132
const VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1347
MooseMesh & _mesh
Definition Assembly.h:2353
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:3120
std::vector< ADReal > _ad_detadz_map
Definition Assembly.h:2842
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar, LocalDataKey, TagID tag)
Get local Jacobian block for a pair of variables and a tag.
Definition Assembly.h:1142
std::vector< dof_id_type > _temp_dof_indices
Temporary work vector to keep from reallocating it.
Definition Assembly.h:2822
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition Assembly.h:2342
void buildVectorFaceNeighborFE(FEType type) const
Build Vector FEs for a neighbor face with a type.
Definition Assembly.C:546
ArbitraryQuadrature * _current_qface_arbitrary
The current arbitrary quadrature rule used on element faces.
Definition Assembly.h:2525
VectorVariablePhiGradient _vector_grad_phi
Definition Assembly.h:2722
const VectorVariablePhiGradient & gradPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1398
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:2303
void prepareJacobianBlock()
Sizes and zeroes the Jacobian blocks used for the current element.
Definition Assembly.C:2686
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:2294
void resizeADMappingObjects(unsigned int n_qp, unsigned int dim)
resize any objects that contribute to automatic differentiation-related mapping calculations
Definition Assembly.C:973
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:3266
const libMesh::QBase *const & qRuleNeighbor() const
Returns the reference to the current quadrature being used on a current neighbor.
Definition Assembly.h:518
std::vector< VectorValue< ADReal > > _ad_dxyzdeta_map
Definition Assembly.h:2829
bool computingJacobian() const
Definition Assembly.h:1951
const Node * _current_node
The current node we are working with.
Definition Assembly.h:2623
VariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1605
DenseVector< Number > & residualBlockLower(unsigned int var_num, LocalDataKey, TagID tag_id)
Get residual block for lower.
Definition Assembly.h:1133
std::map< FEType, ADTemplateVariablePhiGradient< RealVectorValue > > _ad_vector_grad_phi_data_face
Definition Assembly.h:2785
void cacheJacobianMortar(GlobalDataKey)
Cache all portions of the Jacobian, e.g.
Definition Assembly.C:4135
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:577
THREAD_ID _tid
Thread number (id)
Definition Assembly.h:2351
bool _calculate_face_xyz
Definition Assembly.h:2859
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kel
dsecondary/dlower (or delement/dlower)
Definition Assembly.h:2696
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_dual_lower
Definition Assembly.h:2779
MooseArray< Point > _current_normals
The current Normal vectors at the quadrature points.
Definition Assembly.h:2531
void cacheJacobian(GlobalDataKey)
Takes the values that are currently in _sub_Kee and appends them to the cached values.
Definition Assembly.C:4045
bool _calculate_curvatures
Definition Assembly.h:2860
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME)
Definition Assembly.h:2799
const Node *const & node() const
Returns the reference to the node.
Definition Assembly.h:545
std::vector< std::vector< dof_id_type > > _cached_jacobian_cols
Column where the corresponding cached value should go.
Definition Assembly.h:2811
ArbitraryQuadrature * _current_qrule_arbitrary
The current arbitrary quadrature rule used within the element interior.
Definition Assembly.h:2415
void computeADFace(const Elem &elem, const unsigned int side)
compute AD things on an element face
Definition Assembly.C:2113
libMesh::ElemSideBuilder _current_side_elem_builder
In place side element builder for _current_side_elem.
Definition Assembly.h:2878
const VectorVariablePhiCurl & curlPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1406
void setCurrentBoundaryID(BoundaryID i)
set the current boundary ID
Definition Assembly.h:434
void computeFaceMap(const Elem &elem, const unsigned int side, const std::vector< Real > &qw)
Definition Assembly.C:1350
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_lower
Vector FE objects for lower dimensional elements.
Definition Assembly.h:2559
void setCachedJacobian(GlobalDataKey)
Sets previously-cached Jacobian values via SparseMatrix::set() calls.
Definition Assembly.C:4477
const VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1425
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:600
libMesh::QBase * qruleFace(const Elem *elem, unsigned int side)
This is an abstraction over the internal qrules function.
Definition Assembly.C:1919
std::vector< std::vector< DenseVector< Number > > > _sub_Rl
residual contributions for each variable from the lower dimensional element
Definition Assembly.h:2664
std::map< FEType, FEBase * > _current_fe_face
The "face" fe object that matches the current elem.
Definition Assembly.h:2385
VectorVariablePhiValue & phi(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1497
void addCachedJacobian(GlobalDataKey)
Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to th...
Definition Assembly.C:3800
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:2267
VectorVariablePhiDivergence _vector_div_phi
Definition Assembly.h:2725
const OutputTools< OutputType >::VariablePhiValue & fePhi(FEType type) const
Definition Assembly.h:1619
const VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1459
const VectorVariablePhiDivergence & divPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1410
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
Definition Assembly.C:1821
const dof_id_type & extraElemIDNeighbor(unsigned int id) const
Returns an integer ID of the current element given the index associated with the integer.
Definition Assembly.h:387
const VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1434
std::vector< dof_id_type > _neighbor_extra_elem_ids
Extra element IDs of neighbor.
Definition Assembly.h:2540
libMesh::ElemSideBuilder _compute_face_map_side_elem_builder
In place side element builder for computeFaceMap()
Definition Assembly.h:2882
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:3392
VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1536
void modifyFaceWeightsDueToXFEM(const Elem *elem, unsigned int side=0)
Update the face integration weights for XFEM partial elements.
Definition Assembly.C:4538
unsigned int _max_cached_residuals
Definition Assembly.h:2804
void buildFaceFE(FEType type) const
Build FEs for a face with a type.
Definition Assembly.C:294
const Real & sideElemVolume() const
Returns the reference to the volume of current side element.
Definition Assembly.h:464
std::shared_ptr< XFEMInterface > _xfem
The XFEM controller.
Definition Assembly.h:2380
std::map< unsigned int, FEBase * > _holder_fe_face_neighbor_helper
Definition Assembly.h:2554
std::set< FEType > _need_neighbor_div
Definition Assembly.h:2871
SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition Assembly.h:2613
const ADTemplateVariablePhiGradient< OutputType > & feADGradPhi(FEType type) const
Definition Assembly.h:1633
std::map< FEType, FEVectorBase * > _current_vector_fe_face
The "face" vector fe object that matches the current elem.
Definition Assembly.h:2394
VariablePhiValue _phi
Definition Assembly.h:2704
bool _custom_mortar_qrule
Flag specifying whether a custom quadrature rule has been specified for mortar segment mesh.
Definition Assembly.h:2589
libMesh::ElemSideBuilder _current_neighbor_side_elem_builder
In place side element builder for _current_neighbor_side_elem.
Definition Assembly.h:2880
const SubdomainID & currentNeighborSubdomainID() const
Return the current subdomain ID.
Definition Assembly.h:497
std::vector< std::vector< dof_id_type > > _cached_jacobian_rows
Row where the corresponding cached value should go.
Definition Assembly.h:2809
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data_face
Definition Assembly.h:2783
MooseArray< ADReal > _ad_coord
The AD version of the current coordinate transformation coefficients.
Definition Assembly.h:2427
const libMesh::QBase * attachQRuleFace(unsigned int dim, FEBase &fe)
Attaches the current face/area quadrature rule to the given fe.
Definition Assembly.h:1920
std::vector< std::unique_ptr< FEBase > > _unique_fe_neighbor_helper
Definition Assembly.h:2373
VariablePhiSecond & secondPhiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1587
std::map< FEType, FEBase * > _current_fe_face_neighbor
The "neighbor face" fe object that matches the current elem.
Definition Assembly.h:2389
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:1003
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1491
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_neighbor
Definition Assembly.h:2768
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:2258
VariablePhiValue & phi(const MooseVariableField< Real > &)
Definition Assembly.h:1465
VariablePhiValue & phiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1592
bool _need_lower_d_elem_volume
Whether we need to compute the lower dimensional element volume.
Definition Assembly.h:2636
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_face_neighbor
Definition Assembly.h:2777
QRules & qrules(unsigned int dim)
Definition Assembly.h:2491
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:2274
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition Assembly.h:2619
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFace(FEType type) const
Definition Assembly.h:1773
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Keg
Definition Assembly.h:2681
SubProblem & _subproblem
Definition Assembly.h:2314
std::set< FEType > _need_face_div
Definition Assembly.h:2870
const std::vector< Real > & jxWMortar() const
Returns a reference to JxW for mortar segment elements.
Definition Assembly.h:707
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:1996
const MooseArray< std::vector< Point > > & tangents() const
Returns the array of tangents for quadrature points on a current side.
Definition Assembly.h:368
const ADTemplateVariablePhiGradient< T > & adGradPhi(const MooseVariableFE< T > &v) const
Definition Assembly.h:1322
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:3842
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:2021
void init(const libMesh::CouplingMatrix *cm)
Initialize the Assembly object and set the CouplingMatrix for use throughout.
Definition Assembly.C:2469
const Real & elemVolume() const
Returns the reference to the current element volume.
Definition Assembly.h:440
VectorVariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1544
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:4283
const OutputTools< OutputType >::VariablePhiGradient & feGradPhiNeighbor(FEType type) const
Definition Assembly.h:1695
VectorVariablePhiGradient _vector_grad_phi_face
Definition Assembly.h:2728
VariablePhiValue & phiNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1473
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > _cm_fs_entry
Entries in the coupling matrix for field variables vs scalar variables.
Definition Assembly.h:2334
Real _current_side_volume
Volume of the current side element.
Definition Assembly.h:2609
void copyShapes(MooseVariableField< T > &v)
Definition Assembly.C:3003
const MooseArray< Real > & coordTransformation() const
Returns the reference to the coordinate transformation coefficients.
Definition Assembly.h:288
void addResidualBlock(NumericVector< Number > &residual, DenseVector< Number > &res_block, const std::vector< dof_id_type > &dof_indices, const std::vector< Real > &scaling_factor)
Add a local residual block to a global residual vector with proper scaling.
Definition Assembly.C:3251
VariablePhiSecond _second_phi_neighbor
Definition Assembly.h:2714
Real _current_neighbor_lower_d_elem_volume
The current neighboring lower dimensional element volume.
Definition Assembly.h:2642
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition Assembly.h:2425
void prepare()
Definition Assembly.C:2719
std::map< FEType, std::unique_ptr< VectorFEShapeData > > _vector_fe_shape_data_lower
Definition Assembly.h:2778
void buildVectorFE(FEType type) const
Build Vector FEs with a type.
Definition Assembly.C:455
VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1568
const OutputTools< OutputType >::VariablePhiValue & fePhiFace(FEType type) const
Definition Assembly.h:1660
VariablePhiGradient & gradPhiFace(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1583
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:120
DenseVector< Number > & residualBlock(unsigned int var_num, LocalDataKey, TagID tag_id)
Get local residual block for a variable and a tag.
Definition Assembly.h:1115
ArbitraryQuadrature * _current_qrule_arbitrary_face
The current arbitrary quadrature rule used on the element face.
Definition Assembly.h:2417
const MooseArray< Real > & JxW() const
Returns the reference to the transformed jacobian weights.
Definition Assembly.h:276
void havePRefinement(const std::unordered_set< FEFamily > &disable_p_refinement_for_families)
Indicate that we have p-refinement.
Definition Assembly.C:4844
VariablePhiValue _phi_face
Definition Assembly.h:2708
std::vector< std::vector< std::vector< unsigned char > > > _jacobian_block_nonlocal_used
Definition Assembly.h:2343
const FEBase *const & getFEFaceNeighbor(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current "neighbor" FE.
Definition Assembly.h:168
VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1560
void prepareResidual()
Sizes and zeroes the residual for the current element.
Definition Assembly.C:2710
void setCurrentLowerDElem(const Elem *const lower_d_elem)
Set the current lower dimensional element.
Definition Assembly.h:3228
bool needDual() const
Indicates whether dual shape functions are used (computation is now repeated on each element so expen...
Definition Assembly.h:623
void buildVectorFaceFE(FEType type) const
Build Vector FEs for a face with a type.
Definition Assembly.C:486
VectorVariablePhiValue _vector_phi_neighbor
Definition Assembly.h:2733
const MooseArray< Real > & JxWNeighbor() const
Returns the reference to the transformed jacobian weights on a current face.
Definition Assembly.C:261
bool _user_added_fe_neighbor_of_helper_type
Definition Assembly.h:2365
const MooseArray< Point > & qPointsFace() const
Returns the reference to the current quadrature being used.
Definition Assembly.h:345
VectorVariablePhiValue _vector_phi_face
Definition Assembly.h:2727
void reinitFEFace(const Elem *elem, unsigned int side)
Just an internal helper function to reinit the face FE objects.
Definition Assembly.C:1270
const MooseArray< ADReal > & adJxW() const
Definition Assembly.h:278
const MooseArray< Point > & qPointsFaceNeighbor() const
Returns the reference to the current quadrature points being used on the neighbor face.
Definition Assembly.h:539
std::map< unsigned int, FEBase * > _holder_fe_neighbor_helper
Each dimension's helper objects.
Definition Assembly.h:2553
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:4215
VectorVariablePhiSecond _vector_second_phi_face
Definition Assembly.h:2729
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:1841
const Elem *const & msmElem() const
Definition Assembly.h:1961
const libMesh::QBase *const & qRuleFace() const
Returns the reference to the current quadrature being used on a current face.
Definition Assembly.h:322
void reinitNeighborLowerDElem(const Elem *elem)
reinitialize a neighboring lower dimensional element
Definition Assembly.C:2385
void initNonlocalCoupling()
Create pair of variables requiring nonlocal jacobian contributions.
Definition Assembly.C:2651
MooseArray< ADReal > _ad_curvatures
Definition Assembly.h:2851
VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1523
const VectorVariablePhiCurl & curlPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1454
const Real & neighborVolume()
Returns the reference to the current neighbor volume.
Definition Assembly.h:508
const OutputTools< OutputType >::VariablePhiSecond & feSecondPhiFace(FEType type) const
Definition Assembly.h:1680
libMesh::QBase * _qrule_msm
A qrule object for working on mortar segement elements.
Definition Assembly.h:2587
unsigned int _max_cached_jacobians
Definition Assembly.h:2813
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition Assembly.h:2607
std::set< FEType > _need_div
Definition Assembly.h:2869
const FEBase *const & getFEFace(FEType type, unsigned int dim) const
Get a reference to a pointer that will contain the current "face" FE.
Definition Assembly.h:156
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:2802
const MooseArray< Real > & JxWFace() const
Returns the reference to the transformed jacobian weights on a current face.
Definition Assembly.h:351
std::map< FEType, ADTemplateVariablePhiGradient< Real > > _ad_grad_phi_data
Definition Assembly.h:2781
VariablePhiSecond & secondPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1600
const VariablePhiGradient & gradPhi(const MooseVariableField< Real > &) const
Definition Assembly.h:1328
std::map< unsigned int, FEBase * > _holder_fe_helper
Each dimension's helper objects.
Definition Assembly.h:2407
VariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1609
MooseArray< Point > _current_q_points_face_neighbor
The current quadrature points on the neighbor face.
Definition Assembly.h:2566
std::vector< ADReal > _ad_dzetadz_map
Definition Assembly.h:2845
std::vector< ADReal > _ad_detady_map
Definition Assembly.h:2841
const Elem *const & sideElem() const
Returns the side element.
Definition Assembly.h:458
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhi(FEType type) const
Definition Assembly.h:1734
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Kne
jacobian contributions from the neighbor and element <Tag, ivar, jvar>
Definition Assembly.h:2686
const NumericVector< Real > * _scaling_vector
The map from global index to variable scaling factor.
Definition Assembly.h:2875
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition Assembly.h:2421
void zeroCachedJacobian(GlobalDataKey)
Zero out previously-cached Jacobian rows.
Definition Assembly.C:4497
void buildVectorDualLowerDFE(FEType type) const
Definition Assembly.C:430
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
Definition Assembly.h:235
const Elem * _current_neighbor_lower_d_elem
The current neighboring lower dimensional element.
Definition Assembly.h:2634
VariablePhiValue & phi(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1578
libMesh::QBase * _current_qrule_lower
quadrature rule used on lower dimensional elements.
Definition Assembly.h:2593
const VariablePhiValue & phiFaceNeighbor(const MooseVariableField< Real > &) const
Definition Assembly.h:1360
void clearCachedResiduals(GlobalDataKey)
Clears all of the residuals in _cached_residual_rows and _cached_residual_values.
Definition Assembly.C:3485
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:4341
void computeCurrentElemVolume()
Definition Assembly.C:1756
const MooseArray< Real > & mortarCoordTransformation() const
Returns the reference to the coordinate transformation coefficients on the mortar segment mesh.
Definition Assembly.h:294
unsigned int _current_neighbor_side
The current side of the selected neighboring element (valid only when working with sides)
Definition Assembly.h:2615
std::vector< std::vector< std::vector< DenseMatrix< Number > > > > _sub_Knl
dprimary/dlower (or dneighbor/dlower)
Definition Assembly.h:2698
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:3361
MooseArray< VectorValue< ADReal > > _ad_q_points_face
Definition Assembly.h:2849
void reinitMortarElem(const Elem *elem)
reinitialize a mortar segment mesh element in order to get a proper JxW
Definition Assembly.C:2406
std::vector< VectorValue< ADReal > > _ad_d2xyzdxi2_map
Definition Assembly.h:2831
VariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1613
const Elem * _current_elem
The current "element" we are currently on.
Definition Assembly.h:2597
std::map< unsigned int, FEBase * > _holder_fe_face_helper
Each dimension's helper objects.
Definition Assembly.h:2519
const VectorVariablePhiSecond & secondPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1449
std::map< unsigned int, std::map< FEType, FEVectorBase * > > _vector_fe_face_neighbor
Definition Assembly.h:2550
const VectorVariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1420
VectorVariablePhiDivergence _vector_div_phi_face_neighbor
Definition Assembly.h:2743
bool _have_p_refinement
Whether we have ever conducted p-refinement.
Definition Assembly.h:2902
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< RealEigenVector > &)
Definition Assembly.h:1596
void reinitNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Reinitializes the neighbor side using reference coordinates.
Definition Assembly.C:1689
const Elem * _msm_elem
Definition Assembly.h:2884
libMesh::QBase * _current_qrule_volume
The current volumetric quadrature for the element.
Definition Assembly.h:2413
void addJacobianNeighborLowerD(GlobalDataKey)
Add all portions of the Jacobian except PrimaryPrimary, e.g.
Definition Assembly.C:3930
std::map< FEType, FEVectorBase * > _current_vector_fe_neighbor
The "neighbor" vector fe object that matches the current elem.
Definition Assembly.h:2396
VariablePhiGradient & gradPhiNeighbor(const MooseVariableField< Real > &)
Definition Assembly.h:1474
MooseArray< Real > _coord_msm
The coordinate transformation coefficients evaluated on the quadrature points of the mortar segment m...
Definition Assembly.h:2575
const FEVectorBase *const & getVectorFEFaceNeighbor(FEType type, unsigned int dim) const
GetVector a reference to a pointer that will contain the current "neighbor" FE.
Definition Assembly.h:216
Real _current_lower_d_elem_volume
The current lower dimensional element volume.
Definition Assembly.h:2638
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:3542
const VectorVariablePhiGradient & gradPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1444
std::vector< std::vector< Real > > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition Assembly.h:2807
bool _user_added_fe_face_of_helper_type
Definition Assembly.h:2363
void clearCachedJacobian()
Clear any currently cached jacobians.
Definition Assembly.C:4507
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:551
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_dual_lower
Definition Assembly.h:2771
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data
Shape function values, gradients, second derivatives for each FE type.
Definition Assembly.h:2766
void addJacobianBlock(libMesh::SparseMatrix< Number > &jacobian, 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)
Add a local Jacobian block to a global Jacobian with proper scaling.
std::vector< Point > _current_neighbor_ref_points
The current reference points on the neighbor element.
Definition Assembly.h:2905
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:3179
void copyNeighborShapes(MooseVariableField< T > &v)
Definition Assembly.C:3077
std::set< FEType > _need_second_derivative
Definition Assembly.h:2866
const OutputTools< OutputType >::VariablePhiCurl & feCurlPhiNeighbor(FEType type) const
Definition Assembly.h:1750
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:2899
std::vector< dof_id_type > _extra_elem_ids
Extra element IDs.
Definition Assembly.h:2538
void hasScalingVector()
signals this object that a vector containing variable scaling factors should be used when doing resid...
Definition Assembly.C:4559
void addCachedResiduals(GlobalDataKey, const std::vector< VectorTag > &tags)
Pushes all cached residuals to the global residual vectors associated with each tag.
Definition Assembly.C:3470
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face_neighbor
Definition Assembly.h:2769
bool _user_added_fe_lower_of_helper_type
Definition Assembly.h:2366
MooseArray< Real > _current_JxW_neighbor
The current transformed jacobian weights on a neighbor's face.
Definition Assembly.h:2570
std::vector< ADReal > _ad_dxidy_map
Definition Assembly.h:2838
unsigned int _mesh_dimension
Definition Assembly.h:2355
DenseVector< Number > _element_vector
A working vector to avoid repeated heap allocations when caching residuals that must have libMesh-lev...
Definition Assembly.h:2889
const OutputTools< OutputType >::VariablePhiDivergence & feDivPhiFaceNeighbor(FEType type) const
Definition Assembly.h:1789
const VectorVariablePhiValue & phiNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1415
VariablePhiSecond _second_phi_face_neighbor
Definition Assembly.h:2718
VectorVariablePhiDivergence & divPhiFaceNeighbor(const MooseVariableField< RealVectorValue > &)
Definition Assembly.h:1572
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:3533
std::map< FEType, std::unique_ptr< FEShapeData > > _fe_shape_data_face
Definition Assembly.h:2767
const VariablePhiSecond & secondPhi() const
Definition Assembly.h:1329
const VariablePhiSecond & secondPhi(const MooseVariableField< Real > &) const
Definition Assembly.h:1330
const Elem *const & neighbor() const
Return the neighbor element.
Definition Assembly.h:470
void prepareOffDiagScalar()
Definition Assembly.C:2977
void prepareNonlocal()
Definition Assembly.C:2726
const SubdomainID & currentSubdomainID() const
Return the current subdomain ID.
Definition Assembly.h:419
const FEVectorBase *const & getVectorFEFace(FEType type, unsigned int dim) const
GetVector a reference to a pointer that will contain the current "face" FE.
Definition Assembly.h:204
void prepareVariable(MooseVariableFieldBase *var)
Used for preparing the dense residual and jacobian blocks for one particular variable.
Definition Assembly.C:2752
VariablePhiSecond & secondPhiFace(const MooseVariableField< Real > &)
Definition Assembly.h:1471
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition Assembly.h:476
const VectorVariablePhiValue & phiFaceNeighbor(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1439
const VectorVariablePhiSecond & secondPhiFace(const MooseVariableField< RealVectorValue > &) const
Definition Assembly.h:1402
bool _need_dual
Whether dual shape functions need to be computed for mortar constraints.
Definition Assembly.h:2644
const MooseArray< ADReal > & adCoordTransformation() const
Returns the reference to the AD version of the coordinate transformation coefficients.
Definition Assembly.h:300
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:2432
std::unique_ptr< ArbitraryQuadrature > arbitrary_vol
volume/elem (meshdim) custom points quadrature rule
Definition Assembly.h:2449
std::unique_ptr< ArbitraryQuadrature > neighbor
area/face (meshdim-1) custom points quadrature rule for DG
Definition Assembly.h:2453
std::unique_ptr< libMesh::QBase > fv_face
finite volume face/flux quadrature rule (meshdim-1)
Definition Assembly.h:2447
std::unique_ptr< libMesh::QBase > vol
volume/elem (meshdim) quadrature rule
Definition Assembly.h:2443
std::unique_ptr< ArbitraryQuadrature > arbitrary_face
area/face (meshdim-1) custom points quadrature rule
Definition Assembly.h:2451
std::unique_ptr< libMesh::QBase > face
area/face (meshdim-1) quadrature rule
Definition Assembly.h:2445