www.mooseframework.org
SubProblem.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "Problem.h"
13 #include "DiracKernelInfo.h"
14 #include "GeometricSearchData.h"
15 #include "MooseTypes.h"
16 
17 #include "libmesh/coupling_matrix.h"
18 
19 namespace libMesh
20 {
21 template <typename>
22 class VectorValue;
23 typedef VectorValue<Real> RealVectorValue;
24 }
25 
26 class MooseMesh;
27 class SubProblem;
28 class Factory;
29 class Assembly;
32 template <typename>
37 class SystemBase;
38 
39 // libMesh forward declarations
40 namespace libMesh
41 {
42 class EquationSystems;
43 class DofMap;
44 class CouplingMatrix;
45 template <typename T>
46 class SparseMatrix;
47 template <typename T>
48 class NumericVector;
49 class System;
50 } // namespace libMesh
51 
52 template <>
54 
59 class SubProblem : public Problem
60 {
61 public:
63  virtual ~SubProblem();
64 
65  virtual EquationSystems & es() = 0;
66  virtual MooseMesh & mesh() = 0;
67  virtual const MooseMesh & mesh() const = 0;
68 
70 
71  virtual void solve() = 0;
72  virtual bool converged() = 0;
73 
74  virtual void onTimestepBegin() = 0;
75  virtual void onTimestepEnd() = 0;
76 
77  virtual bool isTransient() const = 0;
78 
83 
92  virtual TagID addVectorTag(TagName tag_name);
93 
97  virtual TagID getVectorTagID(const TagName & tag_name);
98 
102  virtual TagName vectorTagName(TagID tag);
103 
107  virtual std::map<TagName, TagID> & getVectorTags() { return _vector_tag_name_to_tag_id; }
108 
112  virtual bool vectorTagExists(TagID tag) { return tag < _vector_tag_name_to_tag_id.size(); }
113 
117  bool vectorTagExists(const TagName & tag_name);
118 
122  virtual unsigned int numVectorTags() const { return _vector_tag_name_to_tag_id.size(); }
123 
132  virtual TagID addMatrixTag(TagName tag_name);
133 
137  virtual TagID getMatrixTagID(const TagName & tag_name);
138 
142  virtual TagName matrixTagName(TagID tag);
143 
147  virtual bool matrixTagExists(const TagName & tag_name);
148 
152  virtual bool matrixTagExists(TagID tag_id);
153 
157  virtual unsigned int numMatrixTags() const { return _matrix_tag_name_to_tag_id.size(); }
158 
162  virtual std::map<TagName, TagID> & getMatrixTags() { return _matrix_tag_name_to_tag_id; }
163 
164  // Variables /////
165  virtual bool hasVariable(const std::string & var_name) const = 0;
166 
176  virtual MooseVariableFEBase &
178  const std::string & var_name,
180  Moose::VarFieldType expected_var_field_type = Moose::VarFieldType::VAR_FIELD_ANY) = 0;
181 
183  virtual MooseVariable & getStandardVariable(THREAD_ID tid, const std::string & var_name) = 0;
184 
186  virtual VectorMooseVariable & getVectorVariable(THREAD_ID tid, const std::string & var_name) = 0;
187 
189  virtual bool hasScalarVariable(const std::string & var_name) const = 0;
190 
192  virtual MooseVariableScalar & getScalarVariable(THREAD_ID tid, const std::string & var_name) = 0;
193 
195  virtual System & getSystem(const std::string & var_name) = 0;
196 
203  virtual void setActiveElementalMooseVariables(const std::set<MooseVariableFEBase *> & moose_vars,
204  THREAD_ID tid);
205 
211  virtual const std::set<MooseVariableFEBase *> &
213 
219  virtual bool hasActiveElementalMooseVariables(THREAD_ID tid) const;
220 
229 
236  virtual void setActiveMaterialProperties(const std::set<unsigned int> & mat_prop_ids,
237  THREAD_ID tid);
238 
244  virtual const std::set<unsigned int> & getActiveMaterialProperties(THREAD_ID tid) const;
245 
254  virtual bool hasActiveMaterialProperties(THREAD_ID tid) const;
255 
261  virtual void clearActiveMaterialProperties(THREAD_ID tid);
262 
263  virtual Assembly & assembly(THREAD_ID tid) = 0;
264  virtual const Assembly & assembly(THREAD_ID tid) const = 0;
265 
269  virtual const SystemBase & systemBaseNonlinear() const = 0;
270  virtual SystemBase & systemBaseNonlinear() = 0;
274  virtual const SystemBase & systemBaseAuxiliary() const = 0;
275  virtual SystemBase & systemBaseAuxiliary() = 0;
276 
277  virtual void prepareShapes(unsigned int var, THREAD_ID tid) = 0;
278  virtual void prepareFaceShapes(unsigned int var, THREAD_ID tid) = 0;
279  virtual void prepareNeighborShapes(unsigned int var, THREAD_ID tid) = 0;
281 
286  unsigned int getAxisymmetricRadialCoord() const;
287 
288  virtual DiracKernelInfo & diracKernelInfo();
289  virtual Real finalNonlinearResidual() const;
290  virtual unsigned int nNonlinearIterations() const;
291  virtual unsigned int nLinearIterations() const;
292 
293  virtual void addResidual(THREAD_ID tid) = 0;
294  virtual void addResidualNeighbor(THREAD_ID tid) = 0;
295 
296  virtual void cacheResidual(THREAD_ID tid) = 0;
297  virtual void cacheResidualNeighbor(THREAD_ID tid) = 0;
298  virtual void addCachedResidual(THREAD_ID tid) = 0;
299 
300  virtual void setResidual(NumericVector<Number> & residual, THREAD_ID tid) = 0;
301  virtual void setResidualNeighbor(NumericVector<Number> & residual, THREAD_ID tid) = 0;
302 
303  virtual void addJacobian(THREAD_ID tid) = 0;
304  virtual void addJacobianNeighbor(THREAD_ID tid) = 0;
305  virtual void addJacobianBlock(SparseMatrix<Number> & jacobian,
306  unsigned int ivar,
307  unsigned int jvar,
308  const DofMap & dof_map,
309  std::vector<dof_id_type> & dof_indices,
310  THREAD_ID tid) = 0;
311  virtual void addJacobianNeighbor(SparseMatrix<Number> & jacobian,
312  unsigned int ivar,
313  unsigned int jvar,
314  const DofMap & dof_map,
315  std::vector<dof_id_type> & dof_indices,
316  std::vector<dof_id_type> & neighbor_dof_indices,
317  THREAD_ID tid) = 0;
318 
319  virtual void cacheJacobian(THREAD_ID tid) = 0;
320  virtual void cacheJacobianNeighbor(THREAD_ID tid) = 0;
321  virtual void addCachedJacobian(THREAD_ID tid) = 0;
322 
323  virtual void prepare(const Elem * elem, THREAD_ID tid) = 0;
324  virtual void prepareFace(const Elem * elem, THREAD_ID tid) = 0;
325  virtual void prepare(const Elem * elem,
326  unsigned int ivar,
327  unsigned int jvar,
328  const std::vector<dof_id_type> & dof_indices,
329  THREAD_ID tid) = 0;
330  virtual void setCurrentSubdomainID(const Elem * elem, THREAD_ID tid) = 0;
331  virtual void setNeighborSubdomainID(const Elem * elem, unsigned int side, THREAD_ID tid) = 0;
332  virtual void prepareAssembly(THREAD_ID tid) = 0;
333 
334  virtual void reinitElem(const Elem * elem, THREAD_ID tid) = 0;
335  virtual void reinitElemPhys(const Elem * elem,
336  const std::vector<Point> & phys_points_in_elem,
337  THREAD_ID tid,
338  bool suppress_displaced_init = false) = 0;
339  virtual void
340  reinitElemFace(const Elem * elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid) = 0;
341  virtual void reinitNode(const Node * node, THREAD_ID tid) = 0;
342  virtual void reinitNodeFace(const Node * node, BoundaryID bnd_id, THREAD_ID tid) = 0;
343  virtual void reinitNodes(const std::vector<dof_id_type> & nodes, THREAD_ID tid) = 0;
344  virtual void reinitNodesNeighbor(const std::vector<dof_id_type> & nodes, THREAD_ID tid) = 0;
345  virtual void reinitNeighbor(const Elem * elem, unsigned int side, THREAD_ID tid) = 0;
346  virtual void reinitNeighborPhys(const Elem * neighbor,
347  unsigned int neighbor_side,
348  const std::vector<Point> & physical_points,
349  THREAD_ID tid) = 0;
350  virtual void reinitNeighborPhys(const Elem * neighbor,
351  const std::vector<Point> & physical_points,
352  THREAD_ID tid) = 0;
353  virtual void reinitScalars(THREAD_ID tid) = 0;
354  virtual void reinitOffDiagScalars(THREAD_ID tid) = 0;
355 
362  void reinitElemFaceRef(const Elem * elem,
363  unsigned int side,
364  BoundaryID bnd_id,
365  Real tolerance,
366  const std::vector<Point> * const pts,
367  const std::vector<Real> * const weights = nullptr,
368  THREAD_ID tid = 0);
369 
376  void reinitNeighborFaceRef(const Elem * neighbor_elem,
377  unsigned int neighbor_side,
378  BoundaryID bnd_id,
379  Real tolerance,
380  const std::vector<Point> * const pts,
381  const std::vector<Real> * const weights = nullptr,
382  THREAD_ID tid = 0);
383 
389  void reinitLowerDElemRef(const Elem * elem,
390  const std::vector<Point> * const pts,
391  const std::vector<Real> * const weights = nullptr,
392  THREAD_ID tid = 0);
393 
397  void reinitMortarElem(const Elem * elem, THREAD_ID tid = 0);
398 
402  virtual bool reinitDirac(const Elem * elem, THREAD_ID tid) = 0;
406  virtual void getDiracElements(std::set<const Elem *> & elems) = 0;
411  virtual void clearDiracInfo() = 0;
412 
413  // Geom Search
414  virtual void
416 
417  virtual GeometricSearchData & geomSearchData() = 0;
418 
419  virtual void meshChanged();
420 
429  virtual void storeSubdomainMatPropName(SubdomainID block_id, const std::string & name);
430 
439  virtual void storeBoundaryMatPropName(BoundaryID boundary_id, const std::string & name);
440 
449  virtual void storeSubdomainZeroMatProp(SubdomainID block_id, const MaterialPropertyName & name);
450 
459  virtual void storeBoundaryZeroMatProp(BoundaryID boundary_id, const MaterialPropertyName & name);
460 
467  virtual void storeSubdomainDelayedCheckMatProp(const std::string & requestor,
468  SubdomainID block_id,
469  const std::string & name);
470 
478  virtual void storeBoundaryDelayedCheckMatProp(const std::string & requestor,
479  BoundaryID boundary_id,
480  const std::string & name);
481 
487  virtual void checkBlockMatProps();
488 
494  virtual void checkBoundaryMatProps();
495 
499  virtual void markMatPropRequested(const std::string &);
500 
504  virtual bool isMatPropRequested(const std::string & prop_name) const;
505 
509  virtual void addGhostedElem(dof_id_type elem_id) = 0;
510 
514  virtual void addGhostedBoundary(BoundaryID boundary_id) = 0;
515 
519  virtual void ghostGhostedBoundaries() = 0;
520 
524  virtual std::set<SubdomainID> getMaterialPropertyBlocks(const std::string & prop_name);
525 
529  virtual std::vector<SubdomainName> getMaterialPropertyBlockNames(const std::string & prop_name);
530 
534  virtual bool hasBlockMaterialProperty(SubdomainID block_id, const std::string & prop_name);
535 
539  virtual std::set<BoundaryID> getMaterialPropertyBoundaryIDs(const std::string & prop_name);
540 
544  virtual std::vector<BoundaryName> getMaterialPropertyBoundaryNames(const std::string & prop_name);
545 
549  virtual bool hasBoundaryMaterialProperty(BoundaryID boundary_id, const std::string & prop_name);
550 
555  virtual bool computingInitialResidual() const = 0;
556 
561  virtual std::set<dof_id_type> & ghostedElems() { return _ghosted_elems; }
562 
563  std::map<std::string, std::vector<dof_id_type>> _var_dof_map;
564  const CouplingMatrix & nonlocalCouplingMatrix() const { return _nonlocal_cm; }
565 
569  virtual const bool & currentlyComputingJacobian() const { return _currently_computing_jacobian; };
570 
571  virtual void setCurrentlyComputingJacobian(const bool & flag)
572  {
574  }
575 
578 
580  void computingNonlinearResid(bool computing_nonlinear_residual)
581  {
582  _computing_nonlinear_residual = computing_nonlinear_residual;
583  }
584 
587 
590 
592 
594 
595  virtual void setActiveFEVariableCoupleableVectorTags(std::set<TagID> & vtags, THREAD_ID tid);
596 
597  virtual void setActiveFEVariableCoupleableMatrixTags(std::set<TagID> & mtags, THREAD_ID tid);
598 
600 
602 
603  virtual void setActiveScalarVariableCoupleableVectorTags(std::set<TagID> & vtags, THREAD_ID tid);
604 
605  virtual void setActiveScalarVariableCoupleableMatrixTags(std::set<TagID> & mtags, THREAD_ID tid);
606 
607  const std::set<TagID> & getActiveScalarVariableCoupleableVectorTags(THREAD_ID tid) const;
608 
609  const std::set<TagID> & getActiveScalarVariableCoupleableMatrixTags(THREAD_ID tid) const;
610 
611  const std::set<TagID> & getActiveFEVariableCoupleableVectorTags(THREAD_ID tid) const;
612 
613  const std::set<TagID> & getActiveFEVariableCoupleableMatrixTags(THREAD_ID tid) const;
614 
618  virtual void haveADObjects(bool have_ad_objects) { _have_ad_objects = have_ad_objects; }
622  bool haveADObjects() const { return _have_ad_objects; }
623 
624 protected:
630  const std::string & var_name,
631  Moose::VarKindType expected_var_type,
632  Moose::VarFieldType expected_var_field_type,
633  SystemBase & nl,
634  SystemBase & aux);
635 
637  std::map<TagName, TagID> _vector_tag_name_to_tag_id;
638 
640  std::map<TagID, TagName> _vector_tag_id_to_tag_name;
641 
643  std::map<TagName, TagID> _matrix_tag_name_to_tag_id;
644 
646  std::map<TagID, TagName> _matrix_tag_id_to_tag_name;
647 
650 
651  CouplingMatrix _nonlocal_cm;
652 
654  std::map<SubdomainID, Moose::CoordinateSystemType> _coord_sys;
655 
657 
659  std::map<SubdomainID, std::set<std::string>> _map_block_material_props;
660 
662  std::map<BoundaryID, std::set<std::string>> _map_boundary_material_props;
663 
665  std::map<SubdomainID, std::set<MaterialPropertyName>> _zero_block_material_props;
666  std::map<BoundaryID, std::set<MaterialPropertyName>> _zero_boundary_material_props;
667 
669  std::set<std::string> _material_property_requested;
670 
672 
677  std::map<SubdomainID, std::multimap<std::string, std::string>> _map_block_material_props_check;
678  std::map<BoundaryID, std::multimap<std::string, std::string>> _map_boundary_material_props_check;
680 
682  std::vector<std::set<MooseVariableFEBase *>> _active_elemental_moose_variables;
683 
685  /* This needs to remain <unsigned int> for threading purposes */
686  std::vector<unsigned int> _has_active_elemental_moose_variables;
687 
689  std::vector<std::set<unsigned int>> _active_material_property_ids;
690 
691  std::vector<std::set<TagID>> _active_fe_var_coupleable_matrix_tags;
692 
693  std::vector<std::set<TagID>> _active_fe_var_coupleable_vector_tags;
694 
695  std::vector<std::set<TagID>> _active_sc_var_coupleable_matrix_tags;
696 
697  std::vector<std::set<TagID>> _active_sc_var_coupleable_vector_tags;
698 
701 
704 
706  std::set<dof_id_type> _ghosted_elems;
707 
709  unsigned int _rz_coord_axis;
710 
713 
716 
719 
722 
725 
726 private:
728  std::string restrictionSubdomainCheckName(SubdomainID check_id);
729  std::string restrictionBoundaryCheckName(BoundaryID check_id);
731 
732  friend class Restartable;
733 };
734 
735 namespace Moose
736 {
737 
738 void initial_condition(EquationSystems & es, const std::string & system_name);
739 
740 } // namespace Moose
741 
virtual unsigned int nNonlinearIterations() const
Definition: SubProblem.C:570
virtual void getDiracElements(std::set< const Elem *> &elems)=0
Fills "elems" with the elements that should be looped over for Dirac Kernels.
virtual MooseMesh & mesh()=0
VarFieldType
Definition: MooseTypes.h:488
unsigned int getAxisymmetricRadialCoord() const
Returns the desired radial direction for RZ coordinate transformation.
Definition: SubProblem.C:605
std::map< TagName, TagID > _matrix_tag_name_to_tag_id
The currently declared tags.
Definition: SubProblem.h:643
virtual bool hasActiveMaterialProperties(THREAD_ID tid) const
Method to check whether or not a list of active material roperties has been set.
Definition: SubProblem.C:279
virtual void prepareNeighborShapes(unsigned int var, THREAD_ID tid)=0
virtual TagID getVectorTagID(const TagName &tag_name)
Get a TagID from a TagName.
Definition: SubProblem.C:91
bool _requires_nonlocal_coupling
nonlocal coupling requirement flag
Definition: SubProblem.h:700
virtual bool hasBoundaryMaterialProperty(BoundaryID boundary_id, const std::string &prop_name)
Check if a material property is defined on a block.
Definition: SubProblem.C:393
bool _have_ad_objects
AD flag indicating whether any AD objects have been added.
Definition: SubProblem.h:724
virtual std::map< TagName, TagID > & getVectorTags()
Return all vector tags, where a tag is represented by a map from name to ID.
Definition: SubProblem.h:107
virtual void addResidualNeighbor(THREAD_ID tid)=0
virtual bool converged()=0
std::map< BoundaryID, std::multimap< std::string, std::string > > _map_boundary_material_props_check
Definition: SubProblem.h:678
A class for creating restricted objects.
Definition: Restartable.h:29
virtual TagName vectorTagName(TagID tag)
Retrieve the name associated with a TagID.
Definition: SubProblem.C:106
The DiracKernelInfo object is a place where all the Dirac points added by different DiracKernels are ...
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:649
unsigned int _rz_coord_axis
Storage for RZ axis selection.
Definition: SubProblem.h:709
virtual void setResidual(NumericVector< Number > &residual, THREAD_ID tid)=0
virtual void reinitNeighbor(const Elem *elem, unsigned int side, THREAD_ID tid)=0
void initial_condition(EquationSystems &es, const std::string &system_name)
virtual std::set< BoundaryID > getMaterialPropertyBoundaryIDs(const std::string &prop_name)
Get a vector containing the block ids the material property is defined on.
Definition: SubProblem.C:348
virtual void haveADObjects(bool have_ad_objects)
Method for setting whether we have any ad objects.
Definition: SubProblem.h:618
virtual Moose::CoordinateSystemType getCoordSystem(SubdomainID sid)=0
std::map< TagName, TagID > _vector_tag_name_to_tag_id
The currently declared tags.
Definition: SubProblem.h:637
virtual MooseVariable & getStandardVariable(THREAD_ID tid, const std::string &var_name)=0
Returns the variable reference for requested MooseVariable which may be in any system.
Keeps track of stuff related to assembling.
Definition: Assembly.h:62
Class for stuff related to variables.
Definition: Adaptivity.h:29
virtual void prepareFaceShapes(unsigned int var, THREAD_ID tid)=0
virtual TagID addVectorTag(TagName tag_name)
Create a Tag.
Definition: SubProblem.C:66
unsigned int TagID
Definition: MooseTypes.h:162
virtual void onTimestepEnd()=0
std::map< SubdomainID, Moose::CoordinateSystemType > _coord_sys
nonlocal coupling matrix;
Definition: SubProblem.h:654
virtual void storeSubdomainZeroMatProp(SubdomainID block_id, const MaterialPropertyName &name)
Adds to a map based on block ids of material properties for which a zero value can be returned...
Definition: SubProblem.C:418
virtual bool hasBlockMaterialProperty(SubdomainID block_id, const std::string &prop_name)
Check if a material property is defined on a block.
Definition: SubProblem.C:334
std::string restrictionBoundaryCheckName(BoundaryID check_id)
Definition: SubProblem.C:599
Generic factory class for build all sorts of objects.
Definition: Factory.h:153
virtual const bool & currentlyComputingJacobian() const
Returns true if the problem is in the process of computing Jacobian.
Definition: SubProblem.h:569
MooseVariableFE< RealVectorValue > VectorMooseVariable
Definition: SubProblem.h:35
VectorValue< Real > RealVectorValue
Definition: Assembly.h:31
virtual bool hasActiveElementalMooseVariables(THREAD_ID tid) const
Whether or not a list of active elemental moose variables has been set.
Definition: SubProblem.C:253
virtual void prepareShapes(unsigned int var, THREAD_ID tid)=0
virtual VectorMooseVariable & getVectorVariable(THREAD_ID tid, const std::string &var_name)=0
Returns the variable reference for requested VectorMooseVariable which may be in any system...
bool _currently_computing_jacobian
Flag to determine whether the problem is currently computing Jacobian.
Definition: SubProblem.h:712
virtual Real finalNonlinearResidual() const
Definition: SubProblem.C:564
bool safeAccessTaggedVectors() const
Is it safe to access the tagged vectors.
Definition: SubProblem.h:589
virtual void storeSubdomainDelayedCheckMatProp(const std::string &requestor, SubdomainID block_id, const std::string &name)
Adds to a map based on block ids of material properties to validate.
Definition: SubProblem.C:430
virtual ~SubProblem()
Definition: SubProblem.C:63
virtual MooseVariableFEBase & getVariable(THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY)=0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
virtual Assembly & assembly(THREAD_ID tid)=0
virtual void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes, THREAD_ID tid)=0
void reinitMortarElem(const Elem *elem, THREAD_ID tid=0)
Reinit a mortar element to obtain a valid JxW.
Definition: SubProblem.C:756
virtual void reinitNodeFace(const Node *node, BoundaryID bnd_id, THREAD_ID tid)=0
virtual MooseVariableScalar & getScalarVariable(THREAD_ID tid, const std::string &var_name)=0
Returns the scalar variable reference from whichever system contains it.
virtual void storeBoundaryZeroMatProp(BoundaryID boundary_id, const MaterialPropertyName &name)
Adds to a map based on boundary ids of material properties for which a zero value can be returned...
Definition: SubProblem.C:424
Class that hold the whole problem being solved.
Definition: Problem.h:24
virtual void cacheJacobianNeighbor(THREAD_ID tid)=0
virtual void reinitNode(const Node *node, THREAD_ID tid)=0
MooseVariableFEBase & getVariableHelper(THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type, Moose::VarFieldType expected_var_field_type, SystemBase &nl, SystemBase &aux)
Helper function called by getVariable that handles the logic for checking whether Variables of the re...
Definition: SubProblem.C:614
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, THREAD_ID tid)
Definition: SubProblem.C:206
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void setCurrentSubdomainID(const Elem *elem, THREAD_ID tid)=0
virtual void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid)=0
virtual void storeBoundaryDelayedCheckMatProp(const std::string &requestor, BoundaryID boundary_id, const std::string &name)
Adds to a map based on boundary ids of material properties to validate.
Definition: SubProblem.C:438
virtual void addCachedResidual(THREAD_ID tid)=0
void reinitNeighborFaceRef(const Elem *neighbor_elem, unsigned int neighbor_side, BoundaryID bnd_id, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, THREAD_ID tid=0)
reinitialize FE objects on a given neighbor element on a given side at a given set of reference point...
Definition: SubProblem.C:704
const std::set< TagID > & getActiveScalarVariableCoupleableMatrixTags(THREAD_ID tid) const
Definition: SubProblem.C:224
virtual unsigned int nLinearIterations() const
Definition: SubProblem.C:576
virtual void clearActiveScalarVariableCoupleableVectorTags(THREAD_ID tid)
Definition: SubProblem.C:212
const CouplingMatrix & nonlocalCouplingMatrix() const
Definition: SubProblem.h:564
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Base class for a system (of equations)
Definition: SystemBase.h:92
bool computingNonlinearResid() const
Check whether residual being evaulated is non-linear.
Definition: SubProblem.h:577
virtual const std::set< MooseVariableFEBase * > & getActiveElementalMooseVariables(THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
Definition: SubProblem.C:247
virtual void addJacobianBlock(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices, THREAD_ID tid)=0
std::set< dof_id_type > _ghosted_elems
Elements that should have Dofs ghosted to the local processor.
Definition: SubProblem.h:706
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, THREAD_ID tid)
Definition: SubProblem.C:164
virtual void markMatPropRequested(const std::string &)
Helper method for adding a material property name to the _material_property_requested set...
Definition: SubProblem.C:546
std::vector< std::set< TagID > > _active_sc_var_coupleable_vector_tags
Definition: SubProblem.h:697
std::map< BoundaryID, std::set< MaterialPropertyName > > _zero_boundary_material_props
Definition: SubProblem.h:666
virtual EquationSystems & es()=0
virtual void prepareFace(const Elem *elem, THREAD_ID tid)=0
virtual void solve()=0
void reinitLowerDElemRef(const Elem *elem, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, THREAD_ID tid=0)
reinitialize a lower dimensional FE object at a given set of reference points and then compute variab...
Definition: SubProblem.C:733
InputParameters validParams< SubProblem >()
Definition: SubProblem.C:23
bool _computing_nonlinear_residual
Whether residual being evaulated is non-linear.
Definition: SubProblem.h:715
virtual void cacheResidualNeighbor(THREAD_ID tid)=0
virtual void addJacobianNeighbor(THREAD_ID tid)=0
std::map< BoundaryID, std::set< std::string > > _map_boundary_material_props
Map for boundary material properties (boundary_id -> list of properties)
Definition: SubProblem.h:662
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:53
virtual bool matrixTagExists(const TagName &tag_name)
Check to see if a particular Tag exists.
Definition: SubProblem.C:129
virtual void clearActiveFEVariableCoupleableVectorTags(THREAD_ID tid)
Definition: SubProblem.C:176
NonlinearSystemBase * nl
virtual const std::set< unsigned int > & getActiveMaterialProperties(THREAD_ID tid) const
Get the material properties required by the current computing thread.
Definition: SubProblem.C:273
std::map< std::string, std::vector< dof_id_type > > _var_dof_map
Definition: SubProblem.h:563
virtual void checkBoundaryMatProps()
Checks boundary material properties integrity.
Definition: SubProblem.C:496
virtual void ghostGhostedBoundaries()=0
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, THREAD_ID tid)=0
virtual bool isMatPropRequested(const std::string &prop_name) const
Find out if a material property has been requested by any object.
Definition: SubProblem.C:552
virtual void clearDiracInfo()=0
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in...
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, THREAD_ID tid)
Definition: SubProblem.C:170
std::map< TagID, TagName > _matrix_tag_id_to_tag_name
Reverse map.
Definition: SubProblem.h:646
virtual void clearActiveElementalMooseVariables(THREAD_ID tid)
Clear the active elemental MooseVariableFEBase.
Definition: SubProblem.C:259
virtual DiracKernelInfo & diracKernelInfo()
Definition: SubProblem.C:558
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
virtual const SystemBase & systemBaseAuxiliary() const =0
Return the auxiliary system object as a base class reference.
virtual void addResidual(THREAD_ID tid)=0
bool _safe_access_tagged_vectors
Is it safe to retrieve data from tagged vectors.
Definition: SubProblem.h:721
virtual void cacheJacobian(THREAD_ID tid)=0
boundary_id_type BoundaryID
virtual bool reinitDirac(const Elem *elem, THREAD_ID tid)=0
Returns true if the Problem has Dirac kernels it needs to compute on elem.
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:481
virtual void prepareAssembly(THREAD_ID tid)=0
virtual void storeBoundaryMatPropName(BoundaryID boundary_id, const std::string &name)
Adds the given material property to a storage map based on boundary ids.
Definition: SubProblem.C:412
virtual void prepare(const Elem *elem, THREAD_ID tid)=0
SubProblem(const InputParameters &parameters)
Definition: SubProblem.C:39
DofMap & dof_map
virtual bool isTransient() const =0
virtual TagID addMatrixTag(TagName tag_name)
Create a Tag.
Definition: SubProblem.C:112
std::string restrictionSubdomainCheckName(SubdomainID check_id)
Helper functions for checking MaterialProperties.
Definition: SubProblem.C:588
virtual void onTimestepBegin()=0
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
virtual bool hasScalarVariable(const std::string &var_name) const =0
Returns a Boolean indicating whether any system contains a variable with the name provided...
virtual void checkBlockMatProps()
Checks block material properties integrity.
Definition: SubProblem.C:446
std::vector< std::set< unsigned int > > _active_material_property_ids
Set of material property ids that determine whether materials get reinited.
Definition: SubProblem.h:689
virtual bool checkNonlocalCouplingRequirement()
Definition: SubProblem.h:69
virtual const SystemBase & systemBaseNonlinear() const =0
Return the nonlinear system object as a base class reference.
virtual void reinitOffDiagScalars(THREAD_ID tid)=0
virtual void clearActiveFEVariableCoupleableMatrixTags(THREAD_ID tid)
Definition: SubProblem.C:182
virtual std::set< dof_id_type > & ghostedElems()
Return the list of elements that should have their DoFs ghosted to this processor.
Definition: SubProblem.h:561
virtual std::vector< SubdomainName > getMaterialPropertyBlockNames(const std::string &prop_name)
Get a vector of block id equivalences that the material property is defined on.
Definition: SubProblem.C:307
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, THREAD_ID tid)=0
virtual bool vectorTagExists(TagID tag)
Check to see if a particular Tag exists.
Definition: SubProblem.h:112
subdomain_id_type SubdomainID
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, THREAD_ID tid)
Definition: SubProblem.C:200
virtual GeometricSearchData & geomSearchData()=0
virtual bool hasVariable(const std::string &var_name) const =0
bool haveADObjects() const
Method for reading wehther we have any ad objects.
Definition: SubProblem.h:622
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase *> &moose_vars, THREAD_ID tid)
Set the MOOSE variables to be reinited on each element.
Definition: SubProblem.C:236
virtual std::map< TagName, TagID > & getMatrixTags()
Return all matrix tags in the sytem, where a tag is represented by a map from name to ID...
Definition: SubProblem.h:162
virtual unsigned int numVectorTags() const
The total number of tags.
Definition: SubProblem.h:122
GeometricSearchType
Used to select groups of geometric search objects to update.
virtual void reinitElem(const Elem *elem, THREAD_ID tid)=0
CoordinateSystemType
Definition: MooseTypes.h:556
void computingNonlinearResid(bool computing_nonlinear_residual)
Set whether residual being evaulated is non-linear.
Definition: SubProblem.h:580
std::vector< std::set< TagID > > _active_fe_var_coupleable_vector_tags
Definition: SubProblem.h:693
virtual unsigned int numMatrixTags() const
The total number of tags.
Definition: SubProblem.h:157
virtual void setResidualNeighbor(NumericVector< Number > &residual, THREAD_ID tid)=0
virtual bool computingInitialResidual() const =0
Returns true if the problem is in the process of computing it&#39;s initial residual. ...
bool _default_ghosting
Whether or not to use default libMesh coupling.
Definition: SubProblem.h:703
virtual std::set< SubdomainID > getMaterialPropertyBlocks(const std::string &prop_name)
Get a vector containing the block ids the material property is defined on.
Definition: SubProblem.C:291
virtual System & getSystem(const std::string &var_name)=0
Returns the equation system containing the variable provided.
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:59
std::map< SubdomainID, std::set< MaterialPropertyName > > _zero_block_material_props
Set of properties returned as zero properties.
Definition: SubProblem.h:665
virtual std::vector< BoundaryName > getMaterialPropertyBoundaryNames(const std::string &prop_name)
Get a vector of block id equivalences that the material property is defined on.
Definition: SubProblem.C:364
virtual void cacheResidual(THREAD_ID tid)=0
virtual void updateGeomSearch(GeometricSearchData::GeometricSearchType type=GeometricSearchData::ALL)=0
std::vector< unsigned int > _has_active_elemental_moose_variables
Whether or not there is currently a list of active elemental moose variables.
Definition: SubProblem.h:686
virtual void addGhostedBoundary(BoundaryID boundary_id)=0
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
const std::set< TagID > & getActiveScalarVariableCoupleableVectorTags(THREAD_ID tid) const
Definition: SubProblem.C:230
virtual void addGhostedElem(dof_id_type elem_id)=0
Will make sure that all dofs connected to elem_id are ghosted to this processor.
virtual TagID getMatrixTagID(const TagName &tag_name)
Get a TagID from a TagName.
Definition: SubProblem.C:143
Class for scalar variables (they are different).
std::vector< std::set< MooseVariableFEBase * > > _active_elemental_moose_variables
This is the set of MooseVariableFEBases that will actually get reinited by a call to reinit(elem) ...
Definition: SubProblem.h:682
std::map< TagID, TagName > _vector_tag_id_to_tag_name
Reverse map.
Definition: SubProblem.h:640
std::set< std::string > _material_property_requested
set containing all material property names that have been requested by getMaterialProperty* ...
Definition: SubProblem.h:669
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:59
virtual void setCurrentlyComputingJacobian(const bool &flag)
Definition: SubProblem.h:571
void reinitElemFaceRef(const Elem *elem, unsigned int side, BoundaryID bnd_id, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, THREAD_ID tid=0)
reinitialize FE objects on a given element on a given side at a given set of reference points and the...
Definition: SubProblem.C:674
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, THREAD_ID tid)=0
virtual void reinitScalars(THREAD_ID tid)=0
virtual void addCachedJacobian(THREAD_ID tid)=0
Definition: Moose.h:111
std::map< SubdomainID, std::multimap< std::string, std::string > > _map_block_material_props_check
Data structures of the requested material properties.
Definition: SubProblem.h:677
virtual void clearActiveScalarVariableCoupleableMatrixTags(THREAD_ID tid)
Definition: SubProblem.C:218
virtual void clearActiveMaterialProperties(THREAD_ID tid)
Clear the active material properties.
Definition: SubProblem.C:285
bool _safe_access_tagged_matrices
Is it safe to retrieve data from tagged matrices.
Definition: SubProblem.h:718
MooseVariableFE< Real > MooseVariable
Definition: SubProblem.h:33
DiracKernelInfo _dirac_kernel_info
Definition: SubProblem.h:656
bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
Definition: SubProblem.h:586
virtual void addJacobian(THREAD_ID tid)=0
std::map< SubdomainID, std::set< std::string > > _map_block_material_props
Map of material properties (block_id -> list of properties)
Definition: SubProblem.h:659
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(THREAD_ID tid) const
Definition: SubProblem.C:188
bool defaultGhosting()
Whether or not the user has requested default ghosting ot be on.
Definition: SubProblem.h:82
CouplingMatrix _nonlocal_cm
Definition: SubProblem.h:651
std::vector< std::set< TagID > > _active_fe_var_coupleable_matrix_tags
Definition: SubProblem.h:691
std::vector< std::set< TagID > > _active_sc_var_coupleable_matrix_tags
Definition: SubProblem.h:695
virtual void storeSubdomainMatPropName(SubdomainID block_id, const std::string &name)
Adds the given material property to a storage map based on block ids.
Definition: SubProblem.C:406
virtual void meshChanged()
Definition: SubProblem.C:582
Abstract definition of a RestartableData value.
virtual TagName matrixTagName(TagID tag)
Retrieve the name associated with a TagID.
Definition: SubProblem.C:158
const std::set< TagID > & getActiveFEVariableCoupleableVectorTags(THREAD_ID tid) const
Definition: SubProblem.C:194
unsigned int THREAD_ID
Definition: MooseTypes.h:161
virtual void setActiveMaterialProperties(const std::set< unsigned int > &mat_prop_ids, THREAD_ID tid)
Record and set the material properties required by the current computing thread.
Definition: SubProblem.C:266
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, THREAD_ID tid, bool suppress_displaced_init=false)=0