https://mooseframework.inl.gov
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Adaptivity Class Reference

Takes care of everything related to mesh adaptivity. More...

#include <Adaptivity.h>

Inheritance diagram for Adaptivity:
[legend]

Public Member Functions

 Adaptivity (FEProblemBase &fe_problem)
 
virtual ~Adaptivity ()
 
void init (const unsigned int steps, const unsigned int initial_steps, const AdaptivityType adaptivity_type)
 Initialize and turn on adaptivity for the simulation. More...
 
template<typename T >
void setParam (const std::string &param_name, const T &param_value)
 Set adaptivity parameter. More...
 
void setErrorEstimator (const MooseEnum &error_estimator_name)
 Set the error estimator. More...
 
void setErrorNorm (libMesh::SystemNorm &sys_norm)
 Set the error norm (FIXME: improve description) More...
 
void setPrintMeshChanged (bool state=true)
 
unsigned int getInitialSteps () const
 Pull out the number of initial steps previously set by calling init() More...
 
unsigned int getSteps () const
 Pull out the number of steps previously set by calling init() More...
 
unsigned int getCyclesPerStep () const
 Pull out the number of cycles_per_step previously set through the AdaptivityAction. More...
 
void setCyclesPerStep (const unsigned int &num)
 Set the number of cycles_per_step. More...
 
bool getRecomputeMarkersFlag () const
 Pull out the _recompute_markers_during_cycles flag previously set through the AdaptivityAction. More...
 
void setRecomputeMarkersFlag (const bool flag)
 Set the flag to recompute markers during adaptivity cycles. More...
 
bool adaptMesh (std::string marker_name=std::string())
 Adapts the mesh based on the error estimator used. More...
 
bool initialAdaptMesh ()
 Used during initial adaptivity. More...
 
void uniformRefineWithProjection ()
 Performs uniform refinement on the meshes in the current object. More...
 
void setAdaptivityOn (bool state)
 Allow adaptivity to be toggled programatically. More...
 
bool isOn ()
 Is adaptivity on? More...
 
bool isInitialized ()
 Returns whether or not Adaptivity::init() has ran. More...
 
void setTimeActive (Real start_time, Real stop_time)
 Sets the time when the adaptivity is active. More...
 
void setUseNewSystem ()
 Tells this object we're using the "new" adaptivity system. More...
 
void setMarkerVariableName (std::string marker_field)
 Sets the name of the field variable to actually use to flag elements for refinement / coarsening. More...
 
void setInitialMarkerVariableName (std::string marker_field)
 Sets the name of the field variable to actually use to flag elements for initial refinement / coarsening. More...
 
void setMaxHLevel (unsigned int level)
 Set the maximum refinement level (for the new Adaptivity system). More...
 
unsigned int getMaxHLevel ()
 Return the maximum h-level. More...
 
void setInterval (unsigned int interval)
 Set the interval (number of timesteps) between refinement steps. More...
 
libMesh::ErrorVectorgetErrorVector (const std::string &indicator_field)
 Get an ErrorVector that will be filled up with values corresponding to the indicator field name passed in. More...
 
void updateErrorVectors ()
 Update the ErrorVectors that have been requested through calls to getErrorVector(). More...
 
bool isAdaptivityDue ()
 Query if an adaptivity step should be performed at the current time / time step. More...
 
PerfGraphperfGraph ()
 Get the PerfGraph. More...
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static void uniformRefine (MooseMesh *mesh, unsigned int level=libMesh::invalid_uint)
 Performs uniform refinement of the passed Mesh object. More...
 
static InputParameters validParams ()
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Member Functions

PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 Call to register a named section for timing. More...
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 Call to register a named section for timing. More...
 
std::string timedSectionName (const std::string &section_name) const
 

Protected Attributes

FEProblemBase_fe_problem
 
MooseMesh_mesh
 
bool _mesh_refinement_on
 on/off flag reporting if the adaptivity is being used More...
 
bool _initialized
 on/off flag reporting if the adaptivity system has been initialized More...
 
std::unique_ptr< libMesh::MeshRefinement_mesh_refinement
 A mesh refinement object to be used either with initial refinement or with Adaptivity. More...
 
std::unique_ptr< libMesh::ErrorEstimator_error_estimator
 Error estimator to be used by the apps. More...
 
std::unique_ptr< libMesh::ErrorVector_error
 Error vector for use with the error estimator. More...
 
std::shared_ptr< DisplacedProblem_displaced_problem
 
std::unique_ptr< libMesh::MeshRefinement_displaced_mesh_refinement
 A mesh refinement object for displaced mesh. More...
 
unsigned int _initial_steps
 the number of adaptivity steps to do at the beginning of simulation More...
 
unsigned int _steps
 steps of adaptivity to perform More...
 
bool _print_mesh_changed
 True if we want to print out info when mesh has changed. More...
 
Real_t
 Time. More...
 
int_step
 Time Step. More...
 
unsigned int _interval
 intreval between adaptivity runs More...
 
Real _start_time
 When adaptivity start. More...
 
Real _stop_time
 When adaptivity stops. More...
 
unsigned int _cycles_per_step
 The number of adaptivity cycles per step. More...
 
bool _use_new_system
 Whether or not to use the "new" adaptivity system. More...
 
std::string _marker_variable_name
 Name of the marker variable if using the new adaptivity system. More...
 
AdaptivityType _adaptivity_type
 Type of mesh adaptivity. More...
 
std::string _initial_marker_variable_name
 Name of the initial marker variable if using the new adaptivity system. More...
 
unsigned int _max_h_level
 The maximum number of refinement levels. More...
 
bool _recompute_markers_during_cycles
 Whether or not to recompute markers during adaptivity cycles. More...
 
std::unique_ptr< libMesh::SiblingCoupling_sibling_coupling
 Sibling coupling object for HP adaptivity for evaluating data on elements' siblings in HPCoarsenTest. More...
 
std::unique_ptr< libMesh::HPCoarsenTest_hp_coarsen_test
 Object for HP adaptivity. More...
 
std::map< std::string, std::unique_ptr< libMesh::ErrorVector > > _indicator_field_to_error_vector
 Stores pointers to ErrorVectors associated with indicator field names. More...
 
MooseApp_pg_moose_app
 The MooseApp that owns the PerfGraph. More...
 
const std::string _prefix
 A prefix to use for all sections. More...
 
const Parallel::Communicator_communicator
 

Detailed Description

Takes care of everything related to mesh adaptivity.

Definition at line 61 of file Adaptivity.h.

Constructor & Destructor Documentation

◆ Adaptivity()

Adaptivity::Adaptivity ( FEProblemBase fe_problem)

Definition at line 33 of file Adaptivity.C.

34  : ConsoleStreamInterface(fe_problem.getMooseApp()),
35  PerfGraphInterface(fe_problem.getMooseApp().perfGraph(), "Adaptivity"),
36  ParallelObject(fe_problem.getMooseApp()),
37  _fe_problem(fe_problem),
39  _mesh_refinement_on(false),
40  _initialized(false),
41  _initial_steps(0),
42  _steps(0),
43  _print_mesh_changed(false),
44  _t(_fe_problem.time()),
46  _interval(1),
50  _use_new_system(false),
52  _max_h_level(0),
54 {
55 }
ParallelObject(const Parallel::Communicator &comm_in)
Real _stop_time
When adaptivity stops.
Definition: Adaptivity.h:307
virtual Real & time() const
bool _initialized
on/off flag reporting if the adaptivity system has been initialized
Definition: Adaptivity.h:277
bool _recompute_markers_during_cycles
Whether or not to recompute markers during adaptivity cycles.
Definition: Adaptivity.h:327
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:87
MooseMesh & _mesh
Definition: Adaptivity.h:272
auto max(const L &left, const R &right)
Real & _t
Time.
Definition: Adaptivity.h:299
bool _print_mesh_changed
True if we want to print out info when mesh has changed.
Definition: Adaptivity.h:296
bool _mesh_refinement_on
on/off flag reporting if the adaptivity is being used
Definition: Adaptivity.h:275
ConsoleStreamInterface(MooseApp &app)
A class for providing a helper stream object for writting message to all the Output objects...
unsigned int _steps
steps of adaptivity to perform
Definition: Adaptivity.h:293
virtual int & timeStep() const
unsigned int _initial_steps
the number of adaptivity steps to do at the beginning of simulation
Definition: Adaptivity.h:291
bool _use_new_system
Whether or not to use the "new" adaptivity system.
Definition: Adaptivity.h:312
unsigned int _interval
intreval between adaptivity runs
Definition: Adaptivity.h:303
AdaptivityType _adaptivity_type
Type of mesh adaptivity.
Definition: Adaptivity.h:318
virtual MooseMesh & mesh() override
unsigned int _cycles_per_step
The number of adaptivity cycles per step.
Definition: Adaptivity.h:309
Real _start_time
When adaptivity start.
Definition: Adaptivity.h:305
int & _step
Time Step.
Definition: Adaptivity.h:301
PerfGraphInterface(const MooseObject *moose_object)
For objects that are MooseObjects with a default prefix of type()
unsigned int _max_h_level
The maximum number of refinement levels.
Definition: Adaptivity.h:324
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition: MooseApp.h:178
FEProblemBase & _fe_problem
Definition: Adaptivity.h:271

◆ ~Adaptivity()

Adaptivity::~Adaptivity ( )
virtual

Definition at line 57 of file Adaptivity.C.

57 {}

Member Function Documentation

◆ adaptMesh()

bool Adaptivity::adaptMesh ( std::string  marker_name = std::string())

Adapts the mesh based on the error estimator used.

This method calls DisplacedProblem::undisplaceMesh, so it is necessary to update the displaced problem's mesh (undoing the undisplacement) before any objects relying on the displaced mesh are executed. However, projection of the displacement variables is required before doing so; therefore, the DisplacedProblem::updateMesh call needs to happen outside of this method.

See also
FEProblemBase::adaptMesh and FEProblemMase::meshChangedHelper.
Returns
a boolean that indicates whether the mesh was changed

Definition at line 145 of file Adaptivity.C.

Referenced by FEProblemBase::adaptMesh(), and initialAdaptMesh().

146 {
147  TIME_SECTION("adaptMesh", 3, "Adapting Mesh");
148 
149  // If the marker name is supplied, use it. Otherwise, use the one in _marker_variable_name
150  if (marker_name.empty())
151  marker_name = _marker_variable_name;
152 
153  bool mesh_changed = false;
154 
155  // If mesh adaptivity is carried out in a distributed (scalable) way
156  bool distributed_adaptivity = false;
157 
158  if (_use_new_system)
159  {
160  if (!marker_name.empty()) // Only flag if a marker variable name has been set
161  {
162  _mesh_refinement->clean_refinement_flags();
163 
164  std::vector<Number> serialized_solution;
165 
166  auto distributed_mesh = dynamic_cast<DistributedMesh *>(&_fe_problem.mesh().getMesh());
167 
168  // Element range
169  std::unique_ptr<ConstElemRange> all_elems;
170  // If the mesh is distributed and we do not do "gather to zero" or "allgather".
171  // Then it is safe to not serialize solution.
172  // Some output idiom (Exodus) will do "gather to zero". That being said,
173  // if you have exodus output on, mesh adaptivty is not scalable.
174  if (distributed_mesh && !distributed_mesh->is_serial_on_zero())
175  {
176  // We update here to make sure local solution is up-to-date
178  distributed_adaptivity = true;
179 
180  // We can not assume that geometric and algebraic ghosting functors cover
181  // the same set of elements/nodes. That being said, in general,
182  // we would expect G(e) > A(e). Here G(e) is the set of elements reserved
183  // by the geometric ghosting functors, and A(e) corresponds to
184  // the one covered by the algebraic ghosting functors.
185  // Therefore, we have to work only on local elements instead of
186  // ghosted + local elements. The ghosted solution might not be enough
187  // for ghosted+local elements. But it is always sufficient for local elements.
188  // After we set markers for all local elements, we will do a global
189  // communication to sync markers for ghosted elements from their owners.
190  all_elems = std::make_unique<ConstElemRange>(
191  _fe_problem.mesh().getMesh().active_local_elements_begin(),
192  _fe_problem.mesh().getMesh().active_local_elements_end());
193  }
194  else // This is not scalable but it might be useful for small-size problems
195  {
197  _fe_problem.getAuxiliarySystem().solution().localize(serialized_solution);
198  distributed_adaptivity = false;
199 
200  // For a replicated mesh or a serialized distributed mesh, the solution
201  // is serialized to everyone. Then we update markers for all active elements.
202  // In this case, we can avoid a global communication to update mesh.
203  // I do not know if it is a good idea, but it the old code behavior.
204  // We might not care about much since a replicated mesh
205  // or a serialized distributed mesh is not scalable anyway.
206  all_elems =
207  std::make_unique<ConstElemRange>(_fe_problem.mesh().getMesh().active_elements_begin(),
208  _fe_problem.mesh().getMesh().active_elements_end());
209  }
210 
211  FlagElementsThread fet(
212  _fe_problem, serialized_solution, _max_h_level, marker_name, !distributed_adaptivity);
213  Threads::parallel_reduce(*all_elems, fet);
215  }
216  }
217  else
218  {
219  if (_fe_problem.numSolverSystems() > 1)
220  mooseError("The old adaptivity system based on libMesh error estimators does not currently "
221  "support multiple solver systems because we currently only use the zeroth solver "
222  "system solution for estimating errors");
223 
224  // Compute the error for each active element
225  _error_estimator->estimate_error(_fe_problem.getSolverSystem(/*nl_sys=*/0).system(), *_error);
226 
227  // Flag elements to be refined and coarsened
228  _mesh_refinement->flag_elements_by_error_fraction(*_error);
229  }
230 
231  // Moving some of h flagged elements to p flagged based on the
232  // local smoothness and prior h & p error estimates
234  {
235  _hp_coarsen_test = std::make_unique<HPCoarsenTest>();
236  _hp_coarsen_test->select_refinement(_fe_problem.getSolverSystem(/*nl_sys=*/0).system());
237  }
238 
239  // If the DisplacedProblem is active, undisplace the DisplacedMesh
240  // in preparation for refinement. We can't safely refine the
241  // DisplacedMesh directly, since the Hilbert keys computed on the
242  // inconsistenly-displaced Mesh are different on different
243  // processors, leading to inconsistent Hilbert keys. We must do
244  // this before the undisplaced Mesh is refined, so that the
245  // element and node numbering is still consistent.
246  if (_displaced_problem)
247  _displaced_problem->undisplaceMesh();
248 
249  // If markers are added to only local elements,
250  // we sync them here.
251  if (distributed_adaptivity)
252  _mesh_refinement->make_flags_parallel_consistent();
253 
254  // Sync flags from the reference mesh
255  if (_displaced_problem)
256  for (auto * const displaced_elem :
257  _displaced_problem->mesh().getMesh().active_element_ptr_range())
258  {
259  const auto * const reference_elem = _fe_problem.mesh().elemPtr(displaced_elem->id());
260  displaced_elem->set_refinement_flag(reference_elem->refinement_flag());
261  displaced_elem->set_p_refinement_flag(reference_elem->p_refinement_flag());
262  }
263 
265  _mesh_refinement->switch_h_to_p_refinement();
266 
267  // Perform refinement and coarsening
268  mesh_changed = _mesh_refinement->refine_and_coarsen_elements();
269 
270  if (_displaced_problem && mesh_changed)
271  {
273  _displaced_mesh_refinement->switch_h_to_p_refinement();
274 
275 #ifndef NDEBUG
276  bool displaced_mesh_changed =
277 #endif
278  _displaced_mesh_refinement->refine_and_coarsen_elements();
279 
280  // Since the undisplaced mesh changed, the displaced mesh better have changed!
281  mooseAssert(displaced_mesh_changed, "Undisplaced mesh changed, but displaced mesh did not!");
282  }
283 
284  if (mesh_changed && _print_mesh_changed)
285  {
286  _console << "\nMesh Changed:\n";
287  _mesh.printInfo();
288  _console << std::flush;
289  }
290 
291  return mesh_changed;
292 }
std::unique_ptr< libMesh::ErrorVector > _error
Error vector for use with the error estimator.
Definition: Adaptivity.h:283
std::shared_ptr< DisplacedProblem > _displaced_problem
Definition: Adaptivity.h:285
std::string _marker_variable_name
Name of the marker variable if using the new adaptivity system.
Definition: Adaptivity.h:315
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:3240
NumericVector< Number > & solution()
Definition: SystemBase.h:197
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
std::unique_ptr< libMesh::ErrorEstimator > _error_estimator
Error estimator to be used by the apps.
Definition: Adaptivity.h:281
std::unique_ptr< libMesh::MeshRefinement > _mesh_refinement
A mesh refinement object to be used either with initial refinement or with Adaptivity.
Definition: Adaptivity.h:279
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
void parallel_reduce(const Range &range, Body &body, const Partitioner &, unsigned int n_threads=libMesh::n_threads())
void set_refinement_flag(const RefinementState rflag)
MooseMesh & _mesh
Definition: Adaptivity.h:272
void update()
Update the system (doing libMesh magic)
Definition: SystemBase.C:1244
bool _print_mesh_changed
True if we want to print out info when mesh has changed.
Definition: Adaptivity.h:296
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:3575
std::unique_ptr< libMesh::MeshRefinement > _displaced_mesh_refinement
A mesh refinement object for displaced mesh.
Definition: Adaptivity.h:288
AuxiliarySystem & getAuxiliarySystem()
virtual void close()=0
void printInfo(std::ostream &os=libMesh::out, const unsigned int verbosity=0) const
Calls print_info() on the underlying Mesh.
Definition: MooseMesh.C:3589
bool _use_new_system
Whether or not to use the "new" adaptivity system.
Definition: Adaptivity.h:312
AdaptivityType _adaptivity_type
Type of mesh adaptivity.
Definition: Adaptivity.h:318
virtual MooseMesh & mesh() override
SolverSystem & getSolverSystem(unsigned int sys_num)
Get non-constant reference to a solver system.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
unsigned int _max_h_level
The maximum number of refinement levels.
Definition: Adaptivity.h:324
virtual std::size_t numSolverSystems() const override
FEProblemBase & _fe_problem
Definition: Adaptivity.h:271
std::unique_ptr< libMesh::HPCoarsenTest > _hp_coarsen_test
Object for HP adaptivity.
Definition: Adaptivity.h:334
virtual void localize(std::vector< T > &v_local) const=0

◆ getCyclesPerStep()

unsigned int Adaptivity::getCyclesPerStep ( ) const
inline

Pull out the number of cycles_per_step previously set through the AdaptivityAction.

Returns
the number of cycles per step

Definition at line 126 of file Adaptivity.h.

Referenced by FEProblemBase::adaptMesh().

126 { return _cycles_per_step; }
unsigned int _cycles_per_step
The number of adaptivity cycles per step.
Definition: Adaptivity.h:309

◆ getErrorVector()

ErrorVector & Adaptivity::getErrorVector ( const std::string &  indicator_field)

Get an ErrorVector that will be filled up with values corresponding to the indicator field name passed in.

Note that this returns a reference... and the return value should be stored as a reference!

Parameters
indicator_fieldThe name of the field to get an ErrorVector for.

Definition at line 390 of file Adaptivity.C.

Referenced by Marker::getErrorVector().

391 {
392  // Insert or retrieve error vector
393  auto insert_pair = moose_try_emplace(
394  _indicator_field_to_error_vector, indicator_field, std::make_unique<ErrorVector>());
395  return *insert_pair.first->second;
396 }
std::pair< typename M::iterator, bool > moose_try_emplace(M &m, const typename M::key_type &k, Args &&... args)
Function to mirror the behavior of the C++17 std::map::try_emplace() method (no hint).
Definition: Moose.h:102
std::map< std::string, std::unique_ptr< libMesh::ErrorVector > > _indicator_field_to_error_vector
Stores pointers to ErrorVectors associated with indicator field names.
Definition: Adaptivity.h:337

◆ getInitialSteps()

unsigned int Adaptivity::getInitialSteps ( ) const
inline

Pull out the number of initial steps previously set by calling init()

Returns
the number of initial steps

Definition at line 112 of file Adaptivity.h.

Referenced by FEProblemBase::hasInitialAdaptivity(), FEProblemBase::initialAdaptMesh(), and FEProblemBase::initialSetup().

112 { return _initial_steps; }
unsigned int _initial_steps
the number of adaptivity steps to do at the beginning of simulation
Definition: Adaptivity.h:291

◆ getMaxHLevel()

unsigned int Adaptivity::getMaxHLevel ( )
inline

Return the maximum h-level.

Definition at line 243 of file Adaptivity.h.

243 { return _max_h_level; }
unsigned int _max_h_level
The maximum number of refinement levels.
Definition: Adaptivity.h:324

◆ getRecomputeMarkersFlag()

bool Adaptivity::getRecomputeMarkersFlag ( ) const
inline

Pull out the _recompute_markers_during_cycles flag previously set through the AdaptivityAction.

Returns
the flag to recompute markers during adaptivity cycles

Definition at line 139 of file Adaptivity.h.

Referenced by FEProblemBase::adaptMesh().

bool _recompute_markers_during_cycles
Whether or not to recompute markers during adaptivity cycles.
Definition: Adaptivity.h:327

◆ getSteps()

unsigned int Adaptivity::getSteps ( ) const
inline

Pull out the number of steps previously set by calling init()

Returns
the number of steps

Definition at line 119 of file Adaptivity.h.

Referenced by SteadyBase::execute(), and Eigenvalue::execute().

119 { return _steps; }
unsigned int _steps
steps of adaptivity to perform
Definition: Adaptivity.h:293

◆ init()

void Adaptivity::init ( const unsigned int  steps,
const unsigned int  initial_steps,
const AdaptivityType  adaptivity_type 
)

Initialize and turn on adaptivity for the simulation.

initial_steps specifies the number of adaptivity cycles to perform before the simulation starts and steps indicates the number of adaptivity cycles to run during a steady (not transient) solve. steps is not used for transient or eigen solves. p_refinement indicates whether the refinement will be p-refinement or h-refinement.

Definition at line 60 of file Adaptivity.C.

Referenced by AdaptivityAction::act(), and SetAdaptivityOptionsAction::act().

63 {
64  // Get the pointer to the DisplacedProblem, this cannot be done at construction because
65  // DisplacedProblem
66  // does not exist at that point.
68 
69  _mesh_refinement = std::make_unique<MeshRefinement>(_mesh);
70  _error = std::make_unique<ErrorVector>();
71 
73  es.parameters.set<bool>("adaptivity") = true;
74 
75  _initial_steps = initial_steps;
76  _steps = steps;
77 
78  _adaptivity_type = adaptivity_type;
79 
80  _mesh_refinement_on = true;
81 
83  _mesh.doingPRefinement(true);
84 
86  {
87  if (_fe_problem.numSolverSystems() > 1)
88  mooseError("HP adaptivity doesn't support multiple solver systems because currently only the "
89  "zeroth solver system solution is analyzed for determining whether to toggle "
90  "h-refinement flags to p-refinement flags");
91 
92  _sibling_coupling = std::make_unique<SiblingCoupling>();
95  }
96 
97  _mesh_refinement->set_periodic_boundaries_ptr(
99 
100  if (_displaced_problem)
101  {
102  EquationSystems & displaced_es = _displaced_problem->es();
103  displaced_es.parameters.set<bool>("adaptivity") = true;
104 
106  _displaced_mesh_refinement = std::make_unique<MeshRefinement>(_displaced_problem->mesh());
107 
108  // The periodic boundaries pointer allows the MeshRefinement
109  // object to determine elements which are "topological" neighbors,
110  // i.e. neighbors across periodic boundaries, for the purposes of
111  // refinement.
112  _displaced_mesh_refinement->set_periodic_boundaries_ptr(
114 
115  // TODO: This is currently an empty function on the DisplacedProblem... could it be removed?
116  _displaced_problem->initAdaptivity();
117  }
118 
119  // indicate the Adaptivity system has been initialized
120  _initialized = true;
121 }
std::unique_ptr< libMesh::ErrorVector > _error
Error vector for use with the error estimator.
Definition: Adaptivity.h:283
std::shared_ptr< DisplacedProblem > _displaced_problem
Definition: Adaptivity.h:285
std::unique_ptr< libMesh::SiblingCoupling > _sibling_coupling
Sibling coupling object for HP adaptivity for evaluating data on elements&#39; siblings in HPCoarsenTest...
Definition: Adaptivity.h:331
bool _initialized
on/off flag reporting if the adaptivity system has been initialized
Definition: Adaptivity.h:277
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
std::unique_ptr< libMesh::MeshRefinement > _mesh_refinement
A mesh refinement object to be used either with initial refinement or with Adaptivity.
Definition: Adaptivity.h:279
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
MooseMesh & _mesh
Definition: Adaptivity.h:272
virtual libMesh::DofMap & dofMap()
Gets writeable reference to the dof map.
Definition: SystemBase.C:1164
PeriodicBoundaries * get_periodic_boundaries()
bool _mesh_refinement_on
on/off flag reporting if the adaptivity is being used
Definition: Adaptivity.h:275
virtual libMesh::EquationSystems & es() override
std::unique_ptr< libMesh::MeshRefinement > _displaced_mesh_refinement
A mesh refinement object for displaced mesh.
Definition: Adaptivity.h:288
unsigned int _steps
steps of adaptivity to perform
Definition: Adaptivity.h:293
unsigned int _initial_steps
the number of adaptivity steps to do at the beginning of simulation
Definition: Adaptivity.h:291
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
AdaptivityType _adaptivity_type
Type of mesh adaptivity.
Definition: Adaptivity.h:318
T & set(const std::string &)
SolverSystem & getSolverSystem(unsigned int sys_num)
Get non-constant reference to a solver system.
void doingPRefinement(bool doing_p_refinement)
Indicate whether the kind of adaptivity we&#39;re doing includes p-refinement.
Definition: MooseMesh.h:1501
void add_algebraic_ghosting_functor(GhostingFunctor &evaluable_functor, bool to_mesh=true)
virtual std::size_t numSolverSystems() const override
const DofMap & get_dof_map() const
FEProblemBase & _fe_problem
Definition: Adaptivity.h:271

◆ initialAdaptMesh()

bool Adaptivity::initialAdaptMesh ( )

Used during initial adaptivity.

Returns
a boolean that indicates whether the mesh was changed

Definition at line 295 of file Adaptivity.C.

Referenced by FEProblemBase::initialAdaptMesh().

296 {
298 }
bool adaptMesh(std::string marker_name=std::string())
Adapts the mesh based on the error estimator used.
Definition: Adaptivity.C:145
std::string _initial_marker_variable_name
Name of the initial marker variable if using the new adaptivity system.
Definition: Adaptivity.h:321

◆ isAdaptivityDue()

bool Adaptivity::isAdaptivityDue ( )

Query if an adaptivity step should be performed at the current time / time step.

Definition at line 420 of file Adaptivity.C.

Referenced by FEProblemBase::adaptMesh().

421 {
422  return _mesh_refinement_on && (_start_time <= _t && _t < _stop_time) && _step % _interval == 0;
423 }
Real _stop_time
When adaptivity stops.
Definition: Adaptivity.h:307
Real & _t
Time.
Definition: Adaptivity.h:299
bool _mesh_refinement_on
on/off flag reporting if the adaptivity is being used
Definition: Adaptivity.h:275
unsigned int _interval
intreval between adaptivity runs
Definition: Adaptivity.h:303
Real _start_time
When adaptivity start.
Definition: Adaptivity.h:305
int & _step
Time Step.
Definition: Adaptivity.h:301

◆ isInitialized()

bool Adaptivity::isInitialized ( )
inline

Returns whether or not Adaptivity::init() has ran.

Can be used to indicate if mesh adaptivity is available.

Returns
true if the Adaptivity system is ready to be used, otherwise false

Definition at line 201 of file Adaptivity.h.

201 { return _initialized; }
bool _initialized
on/off flag reporting if the adaptivity system has been initialized
Definition: Adaptivity.h:277

◆ isOn()

bool Adaptivity::isOn ( )
inline

Is adaptivity on?

Returns
true if mesh adaptivity is on, otherwise false

Definition at line 193 of file Adaptivity.h.

Referenced by FEProblemBase::addAnyRedistributers(), FEProblemBase::checkProblemIntegrity(), and FEProblemBase::initialSetup().

193 { return _mesh_refinement_on; }
bool _mesh_refinement_on
on/off flag reporting if the adaptivity is being used
Definition: Adaptivity.h:275

◆ perfGraph()

PerfGraph & PerfGraphInterface::perfGraph ( )
inherited

Get the PerfGraph.

Definition at line 86 of file PerfGraphInterface.C.

Referenced by CommonOutputAction::act(), PerfGraphData::finalize(), PerfGraphReporter::finalize(), and PerfGraphOutput::output().

87 {
88  return _pg_moose_app.perfGraph();
89 }
MooseApp & _pg_moose_app
The MooseApp that owns the PerfGraph.
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition: MooseApp.h:178

◆ registerTimedSection() [1/2]

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level 
) const
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
Returns
The ID of the section - use when starting timing

Definition at line 61 of file PerfGraphInterface.C.

63 {
64  const auto timed_section_name = timedSectionName(section_name);
65  if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
66  return moose::internal::getPerfGraphRegistry().registerSection(timed_section_name, level);
67  else
68  return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
69 }
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID The name of the section.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.

◆ registerTimedSection() [2/2]

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level,
const std::string &  live_message,
const bool  print_dots = true 
) const
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
live_messageThe message to be printed to the screen during execution
print_dotsWhether or not progress dots should be printed for this section
Returns
The ID of the section - use when starting timing

Definition at line 72 of file PerfGraphInterface.C.

76 {
77  const auto timed_section_name = timedSectionName(section_name);
78  if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
80  timedSectionName(section_name), level, live_message, print_dots);
81  else
82  return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
83 }
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID The name of the section.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.

◆ setAdaptivityOn()

void Adaptivity::setAdaptivityOn ( bool  state)

Allow adaptivity to be toggled programatically.

Parameters
stateThe adaptivity state (on/off).

Definition at line 355 of file Adaptivity.C.

356 {
357  // check if Adaptivity has been initialized before turning on
358  if (state == true && !_initialized)
359  mooseError("Mesh adaptivity system not available");
360 
361  _mesh_refinement_on = state;
362 }
bool _initialized
on/off flag reporting if the adaptivity system has been initialized
Definition: Adaptivity.h:277
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
bool _mesh_refinement_on
on/off flag reporting if the adaptivity is being used
Definition: Adaptivity.h:275

◆ setCyclesPerStep()

void Adaptivity::setCyclesPerStep ( const unsigned int num)
inline

Set the number of cycles_per_step.

Parameters
numThe number of cycles per step to execute

Definition at line 132 of file Adaptivity.h.

Referenced by SetAdaptivityOptionsAction::act().

132 { _cycles_per_step = num; }
unsigned int _cycles_per_step
The number of adaptivity cycles per step.
Definition: Adaptivity.h:309

◆ setErrorEstimator()

void Adaptivity::setErrorEstimator ( const MooseEnum error_estimator_name)

Set the error estimator.

Parameters
error_estimator_namethe name of the error estimator (currently: Laplacian, Kelly, and PatchRecovery)

Definition at line 124 of file Adaptivity.C.

Referenced by AdaptivityAction::act().

125 {
126  if (error_estimator_name == "KellyErrorEstimator")
127  _error_estimator = std::make_unique<KellyErrorEstimator>();
128  else if (error_estimator_name == "LaplacianErrorEstimator")
129  _error_estimator = std::make_unique<LaplacianErrorEstimator>();
130  else if (error_estimator_name == "PatchRecoveryErrorEstimator")
131  _error_estimator = std::make_unique<PatchRecoveryErrorEstimator>();
132  else
133  mooseError(std::string("Unknown error_estimator selection: ") +
134  std::string(error_estimator_name));
135 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
std::unique_ptr< libMesh::ErrorEstimator > _error_estimator
Error estimator to be used by the apps.
Definition: Adaptivity.h:281

◆ setErrorNorm()

void Adaptivity::setErrorNorm ( libMesh::SystemNorm sys_norm)

Set the error norm (FIXME: improve description)

Definition at line 138 of file Adaptivity.C.

Referenced by AdaptivityAction::act().

139 {
140  mooseAssert(_error_estimator, "error_estimator not initialized. Did you call init_adaptivity()?");
141  _error_estimator->error_norm = sys_norm;
142 }
std::unique_ptr< libMesh::ErrorEstimator > _error_estimator
Error estimator to be used by the apps.
Definition: Adaptivity.h:281

◆ setInitialMarkerVariableName()

void Adaptivity::setInitialMarkerVariableName ( std::string  marker_field)

Sets the name of the field variable to actually use to flag elements for initial refinement / coarsening.

This must be a CONSTANT, MONOMIAL Auxiliary Variable Name that contains values corresponding to libMesh::Elem::RefinementState.

Parameters
marker_fieldThe name of the field to use for refinement / coarsening.

Definition at line 384 of file Adaptivity.C.

Referenced by SetAdaptivityOptionsAction::act().

385 {
386  _initial_marker_variable_name = marker_field;
387 }
std::string _initial_marker_variable_name
Name of the initial marker variable if using the new adaptivity system.
Definition: Adaptivity.h:321

◆ setInterval()

void Adaptivity::setInterval ( unsigned int  interval)
inline

Set the interval (number of timesteps) between refinement steps.

Definition at line 248 of file Adaptivity.h.

Referenced by AdaptivityAction::act(), and SetAdaptivityOptionsAction::act().

248 { _interval = interval; }
unsigned int _interval
intreval between adaptivity runs
Definition: Adaptivity.h:303

◆ setMarkerVariableName()

void Adaptivity::setMarkerVariableName ( std::string  marker_field)

Sets the name of the field variable to actually use to flag elements for refinement / coarsening.

This must be a CONSTANT, MONOMIAL Auxiliary Variable Name that contains values corresponding to libMesh::Elem::RefinementState.

Parameters
marker_fieldThe name of the field to use for refinement / coarsening.

Definition at line 378 of file Adaptivity.C.

Referenced by SetAdaptivityOptionsAction::act().

379 {
380  _marker_variable_name = marker_field;
381 }
std::string _marker_variable_name
Name of the marker variable if using the new adaptivity system.
Definition: Adaptivity.h:315

◆ setMaxHLevel()

void Adaptivity::setMaxHLevel ( unsigned int  level)
inline

Set the maximum refinement level (for the new Adaptivity system).

Definition at line 238 of file Adaptivity.h.

Referenced by SetAdaptivityOptionsAction::act().

238 { _max_h_level = level; }
unsigned int _max_h_level
The maximum number of refinement levels.
Definition: Adaptivity.h:324

◆ setParam()

template<typename T >
void Adaptivity::setParam ( const std::string &  param_name,
const T &  param_value 
)

Set adaptivity parameter.

Parameters
param_namethe name of the parameter
param_valuethe value of parameter

Definition at line 342 of file Adaptivity.h.

Referenced by AdaptivityAction::act().

343 {
344  if (param_name == "refine fraction")
345  {
346  _mesh_refinement->refine_fraction() = param_value;
348  _displaced_mesh_refinement->refine_fraction() = param_value;
349  }
350  else if (param_name == "coarsen fraction")
351  {
352  _mesh_refinement->coarsen_fraction() = param_value;
354  _displaced_mesh_refinement->coarsen_fraction() = param_value;
355  }
356  else if (param_name == "max h-level")
357  {
358  _mesh_refinement->max_h_level() = param_value;
360  _displaced_mesh_refinement->max_h_level() = param_value;
361  }
362  else if (param_name == "cycles_per_step")
363  _cycles_per_step = param_value;
364  else if (param_name == "recompute_markers_during_cycles")
365  _recompute_markers_during_cycles = param_value;
366  else
367  mooseError("Invalid Param in adaptivity object");
368 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
bool _recompute_markers_during_cycles
Whether or not to recompute markers during adaptivity cycles.
Definition: Adaptivity.h:327
std::unique_ptr< libMesh::MeshRefinement > _mesh_refinement
A mesh refinement object to be used either with initial refinement or with Adaptivity.
Definition: Adaptivity.h:279
std::unique_ptr< libMesh::MeshRefinement > _displaced_mesh_refinement
A mesh refinement object for displaced mesh.
Definition: Adaptivity.h:288
unsigned int _cycles_per_step
The number of adaptivity cycles per step.
Definition: Adaptivity.h:309

◆ setPrintMeshChanged()

void Adaptivity::setPrintMeshChanged ( bool  state = true)
inline

Definition at line 105 of file Adaptivity.h.

Referenced by AdaptivityAction::act().

105 { _print_mesh_changed = state; }
bool _print_mesh_changed
True if we want to print out info when mesh has changed.
Definition: Adaptivity.h:296

◆ setRecomputeMarkersFlag()

void Adaptivity::setRecomputeMarkersFlag ( const bool  flag)
inline

Set the flag to recompute markers during adaptivity cycles.

Parameters
flagThe flag to recompute markers

Definition at line 145 of file Adaptivity.h.

Referenced by SetAdaptivityOptionsAction::act().

bool _recompute_markers_during_cycles
Whether or not to recompute markers during adaptivity cycles.
Definition: Adaptivity.h:327

◆ setTimeActive()

void Adaptivity::setTimeActive ( Real  start_time,
Real  stop_time 
)

Sets the time when the adaptivity is active.

Parameters
start_timeThe time when adaptivity starts
stop_timeThe time when adaptivity stops

Definition at line 365 of file Adaptivity.C.

Referenced by AdaptivityAction::act(), and SetAdaptivityOptionsAction::act().

366 {
367  _start_time = start_time;
368  _stop_time = stop_time;
369 }
Real _stop_time
When adaptivity stops.
Definition: Adaptivity.h:307
Real _start_time
When adaptivity start.
Definition: Adaptivity.h:305

◆ setUseNewSystem()

void Adaptivity::setUseNewSystem ( )

Tells this object we're using the "new" adaptivity system.

Definition at line 372 of file Adaptivity.C.

Referenced by SetAdaptivityOptionsAction::act().

373 {
374  _use_new_system = true;
375 }
bool _use_new_system
Whether or not to use the "new" adaptivity system.
Definition: Adaptivity.h:312

◆ timedSectionName()

std::string PerfGraphInterface::timedSectionName ( const std::string &  section_name) const
protectedinherited
Returns
The name of the timed section with the name section_name.

Optionally adds a prefix if one is defined.

Definition at line 55 of file PerfGraphInterface.C.

Referenced by PerfGraphInterface::registerTimedSection().

56 {
57  return _prefix.empty() ? "" : (_prefix + "::") + section_name;
58 }
const std::string _prefix
A prefix to use for all sections.

◆ uniformRefine()

void Adaptivity::uniformRefine ( MooseMesh mesh,
unsigned int  level = libMesh::invalid_uint 
)
static

Performs uniform refinement of the passed Mesh object.

The number of levels of refinement performed is stored in the MooseMesh object. No solution projection is performed in this version.

Definition at line 301 of file Adaptivity.C.

Referenced by SetupMeshCompleteAction::act(), and FEProblemBase::uniformRefine().

302 {
303  mooseAssert(mesh, "Mesh pointer must not be NULL");
304 
305  // NOTE: we are using a separate object here, since adaptivity may not be on, but we need to be
306  // able to do refinements
307  MeshRefinement mesh_refinement(*mesh);
308  if (level == libMesh::invalid_uint)
309  level = mesh->uniformRefineLevel();
310 
311  // Skip deletion and repartition will make uniform refinements run more
312  // efficiently, but at the same time, there might be extra ghosting elements.
313  // The number of layers of additional ghosting elements depends on the number
314  // of uniform refinement levels. This should happen only when you have a "fine enough"
315  // coarse mesh and want to refine the mesh by a few levels. Otherwise, it might
316  // introduce an unbalanced workload and too large ghosting domain.
317  if (mesh->skipDeletionRepartitionAfterRefine())
318  {
319  mesh->getMesh().skip_partitioning(true);
320  mesh->getMesh().allow_remote_element_removal(false);
321  mesh->needsRemoteElemDeletion(false);
322  }
323 
324  mesh_refinement.uniformly_refine(level);
325 }
const unsigned int invalid_uint
void skip_partitioning(bool skip)
MeshBase & mesh
void allow_remote_element_removal(bool allow)

◆ uniformRefineWithProjection()

void Adaptivity::uniformRefineWithProjection ( )

Performs uniform refinement on the meshes in the current object.

Projections are performed of the solution vectors.

Definition at line 328 of file Adaptivity.C.

Referenced by FEProblemBase::initialSetup().

329 {
330  TIME_SECTION("uniformRefineWithProjection", 2, "Uniformly Refining and Reprojecting");
331 
332  // NOTE: we are using a separate object here, since adaptivity may not be on, but we need to be
333  // able to do refinements
334  MeshRefinement mesh_refinement(_mesh);
335  unsigned int level = _mesh.uniformRefineLevel();
336  MeshRefinement displaced_mesh_refinement(_displaced_problem ? _displaced_problem->mesh() : _mesh);
337 
338  // we have to go step by step so EquationSystems::reinit() won't freak out
339  for (unsigned int i = 0; i < level; i++)
340  {
341  // See comment above about why refining the displaced mesh is potentially unsafe.
342  if (_displaced_problem)
343  _displaced_problem->undisplaceMesh();
344 
345  mesh_refinement.uniformly_refine(1);
346 
347  if (_displaced_problem)
348  displaced_mesh_refinement.uniformly_refine(1);
350  /*intermediate_step=*/false, /*contract_mesh=*/true, /*clean_refinement_flags=*/true);
351  }
352 }
virtual void meshChanged(bool intermediate_change, bool contract_mesh, bool clean_refinement_flags)
Update data after a mesh change.
std::shared_ptr< DisplacedProblem > _displaced_problem
Definition: Adaptivity.h:285
MooseMesh & _mesh
Definition: Adaptivity.h:272
unsigned int uniformRefineLevel() const
Returns the level of uniform refinement requested (zero if AMR is disabled).
Definition: MooseMesh.C:3343
FEProblemBase & _fe_problem
Definition: Adaptivity.h:271

◆ updateErrorVectors()

void Adaptivity::updateErrorVectors ( )

Update the ErrorVectors that have been requested through calls to getErrorVector().

Definition at line 399 of file Adaptivity.C.

Referenced by FEProblemBase::computeMarkers().

400 {
401  TIME_SECTION("updateErrorVectors", 5, "Updating Error Vectors");
402 
403  // Resize all of the ErrorVectors in case the mesh has changed
404  for (const auto & it : _indicator_field_to_error_vector)
405  {
406  ErrorVector & vec = *(it.second);
407  vec.assign(_mesh.getMesh().max_elem_id(), 0);
408  }
409 
410  // Fill the vectors with the local contributions
413 
414  // Now sum across all processors
415  for (const auto & it : _indicator_field_to_error_vector)
416  _fe_problem.comm().sum((std::vector<float> &)*(it.second));
417 }
libMesh::ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:1261
void parallel_reduce(const Range &range, Body &body, const Partitioner &, unsigned int n_threads=libMesh::n_threads())
const Parallel::Communicator & comm() const
MooseMesh & _mesh
Definition: Adaptivity.h:272
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:3575
virtual dof_id_type max_elem_id() const=0
std::map< std::string, std::unique_ptr< libMesh::ErrorVector > > _indicator_field_to_error_vector
Stores pointers to ErrorVectors associated with indicator field names.
Definition: Adaptivity.h:337
FEProblemBase & _fe_problem
Definition: Adaptivity.h:271

◆ validParams()

InputParameters PerfGraphInterface::validParams ( )
staticinherited

Definition at line 16 of file PerfGraphInterface.C.

Referenced by Convergence::validParams().

17 {
19  return params;
20 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters emptyInputParameters()

Member Data Documentation

◆ _adaptivity_type

AdaptivityType Adaptivity::_adaptivity_type
protected

Type of mesh adaptivity.

Definition at line 318 of file Adaptivity.h.

Referenced by adaptMesh(), and init().

◆ _console

const ConsoleStream ConsoleStreamInterface::_console
inherited

An instance of helper class to write streams to the Console objects.

Definition at line 31 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), MeshOnlyAction::act(), SetupDebugAction::act(), MaterialOutputAction::act(), adaptMesh(), FEProblemBase::adaptMesh(), PerfGraph::addToExecutionList(), SimplePredictor::apply(), SystemBase::applyScalingFactors(), MultiApp::backup(), FEProblemBase::backupMultiApps(), CoarsenedPiecewiseLinear::buildCoarsenedGrid(), DefaultSteadyStateConvergence::checkConvergence(), MeshDiagnosticsGenerator::checkElementOverlap(), MeshDiagnosticsGenerator::checkElementTypes(), MeshDiagnosticsGenerator::checkElementVolumes(), FEProblemBase::checkExceptionAndStopSolve(), SolverSystem::checkInvalidSolution(), MeshDiagnosticsGenerator::checkLocalJacobians(), MeshDiagnosticsGenerator::checkNonConformalMesh(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), MeshDiagnosticsGenerator::checkNonMatchingEdges(), MeshDiagnosticsGenerator::checkNonPlanarSides(), MeshDiagnosticsGenerator::checkPolygons(), FEProblemBase::checkProblemIntegrity(), ReferenceResidualConvergence::checkRelativeConvergence(), MeshDiagnosticsGenerator::checkSidesetsOrientation(), MeshDiagnosticsGenerator::checkWatertightNodesets(), MeshDiagnosticsGenerator::checkWatertightSidesets(), IterationAdaptiveDT::computeAdaptiveDT(), TransientBase::computeConstrainedDT(), DefaultMultiAppFixedPointConvergence::computeCustomConvergencePostprocessor(), NonlinearSystemBase::computeDamping(), FixedPointIterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInitialDT(), IterationAdaptiveDT::computeInterpolationDT(), LinearSystem::computeLinearSystemTags(), FEProblemBase::computeLinearSystemTags(), NonlinearSystemBase::computeScaling(), Problem::console(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), MultiApp::createApp(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MFEMSteady::execute(), MessageFromInput::execute(), SteadyBase::execute(), Eigenvalue::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MeshGeneratorSystem::executeMeshGenerators(), ElementQualityChecker::finalize(), SidesetAroundSubdomainUpdater::finalize(), FEProblemBase::finishMultiAppStep(), MeshRepairGenerator::fixOverlappingNodes(), SurfaceSubdomainsDelaunayRemesher::General2DDelaunay(), OrientSurfaceMeshGenerator::generate(), CoarsenBlockGenerator::generate(), PolyLineMeshFollowingNodeSetGenerator::generate(), MeshGenerator::generateInternal(), VariableCondensationPreconditioner::getDofToCondense(), InversePowerMethod::init(), NonlinearEigen::init(), FEProblemBase::initialAdaptMesh(), DefaultMultiAppFixedPointConvergence::initialize(), SubProblem::initialSetup(), EigenExecutionerBase::inversePowerIteration(), FEProblemBase::joinAndFinalize(), TransientBase::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), FEProblemBase::logAdd(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), SurfaceDelaunayGeneratorBase::meshNormalDeviation2D(), MooseBase::mooseDeprecated(), MooseBase::mooseDeprecatedNoTrace(), MooseBase::mooseInfo(), MooseBase::mooseWarning(), MooseBase::mooseWarningNonPrefixed(), ReferenceResidualConvergence::nonlinearConvergenceSetup(), ReporterDebugOutput::output(), PerfGraphOutput::output(), SolutionInvalidityOutput::output(), MaterialPropertyDebugOutput::output(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), WebServerControl::outputMessage(), Console::outputPostprocessors(), PseudoTimestep::outputPseudoTimestep(), Console::outputReporters(), DefaultMultiAppFixedPointConvergence::outputResidualNorm(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), AB2PredictorCorrector::postSolve(), ActionWarehouse::printActionDependencySets(), BlockRestrictionDebugOutput::printBlockRestrictionMap(), SolutionInvalidity::printDebug(), EigenExecutionerBase::printEigenvalue(), SecantSolve::printFixedPointConvergenceHistory(), SteffensenSolve::printFixedPointConvergenceHistory(), PicardSolve::printFixedPointConvergenceHistory(), FixedPointSolve::printFixedPointConvergenceReason(), PerfGraphLivePrint::printLiveMessage(), MaterialPropertyDebugOutput::printMaterialMap(), PerfGraphLivePrint::printStats(), NEML2Action::printSummary(), AutomaticMortarGeneration::projectPrimaryNodesSinglePair(), AutomaticMortarGeneration::projectSecondaryNodesSinglePair(), CoarsenBlockGenerator::recursiveCoarsen(), SolutionTimeAdaptiveDT::rejectStep(), MultiApp::restore(), FEProblemBase::restoreMultiApps(), FEProblemBase::restoreSolutions(), NonlinearSystemBase::setInitialSolution(), MooseApp::setupOptions(), Checkpoint::shouldOutput(), SubProblem::showFunctorRequestors(), SubProblem::showFunctors(), FullSolveMultiApp::showStatusMessage(), EigenProblem::solve(), FEProblemSolve::solve(), FixedPointSolve::solve(), NonlinearSystem::solve(), LinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), AStableDirk4::solve(), LStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), FixedPointSolve::solveStep(), MeshRepairGenerator::splitNonConvexPolygons(), PerfGraphLivePrint::start(), WebServerControl::startServer(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), MFEMTransient::takeStep(), TransientBase::takeStep(), TerminateChainControl::terminate(), SubProblem::timestepSetup(), FEProblemBase::updateMeshXFEM(), Convergence::verboseOutput(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

◆ _cycles_per_step

unsigned int Adaptivity::_cycles_per_step
protected

The number of adaptivity cycles per step.

Definition at line 309 of file Adaptivity.h.

Referenced by getCyclesPerStep(), setCyclesPerStep(), and setParam().

◆ _displaced_mesh_refinement

std::unique_ptr<libMesh::MeshRefinement> Adaptivity::_displaced_mesh_refinement
protected

A mesh refinement object for displaced mesh.

Definition at line 288 of file Adaptivity.h.

Referenced by adaptMesh(), init(), and setParam().

◆ _displaced_problem

std::shared_ptr<DisplacedProblem> Adaptivity::_displaced_problem
protected

Definition at line 285 of file Adaptivity.h.

Referenced by adaptMesh(), init(), and uniformRefineWithProjection().

◆ _error

std::unique_ptr<libMesh::ErrorVector> Adaptivity::_error
protected

Error vector for use with the error estimator.

Definition at line 283 of file Adaptivity.h.

Referenced by adaptMesh(), and init().

◆ _error_estimator

std::unique_ptr<libMesh::ErrorEstimator> Adaptivity::_error_estimator
protected

Error estimator to be used by the apps.

Definition at line 281 of file Adaptivity.h.

Referenced by adaptMesh(), setErrorEstimator(), and setErrorNorm().

◆ _fe_problem

FEProblemBase& Adaptivity::_fe_problem
protected

Definition at line 271 of file Adaptivity.h.

Referenced by adaptMesh(), init(), uniformRefineWithProjection(), and updateErrorVectors().

◆ _hp_coarsen_test

std::unique_ptr<libMesh::HPCoarsenTest> Adaptivity::_hp_coarsen_test
protected

Object for HP adaptivity.

Definition at line 334 of file Adaptivity.h.

Referenced by adaptMesh().

◆ _indicator_field_to_error_vector

std::map<std::string, std::unique_ptr<libMesh::ErrorVector> > Adaptivity::_indicator_field_to_error_vector
protected

Stores pointers to ErrorVectors associated with indicator field names.

Definition at line 337 of file Adaptivity.h.

Referenced by getErrorVector(), and updateErrorVectors().

◆ _initial_marker_variable_name

std::string Adaptivity::_initial_marker_variable_name
protected

Name of the initial marker variable if using the new adaptivity system.

Definition at line 321 of file Adaptivity.h.

Referenced by initialAdaptMesh(), and setInitialMarkerVariableName().

◆ _initial_steps

unsigned int Adaptivity::_initial_steps
protected

the number of adaptivity steps to do at the beginning of simulation

Definition at line 291 of file Adaptivity.h.

Referenced by getInitialSteps(), and init().

◆ _initialized

bool Adaptivity::_initialized
protected

on/off flag reporting if the adaptivity system has been initialized

Definition at line 277 of file Adaptivity.h.

Referenced by init(), isInitialized(), and setAdaptivityOn().

◆ _interval

unsigned int Adaptivity::_interval
protected

intreval between adaptivity runs

Definition at line 303 of file Adaptivity.h.

Referenced by isAdaptivityDue(), and setInterval().

◆ _marker_variable_name

std::string Adaptivity::_marker_variable_name
protected

Name of the marker variable if using the new adaptivity system.

Definition at line 315 of file Adaptivity.h.

Referenced by adaptMesh(), and setMarkerVariableName().

◆ _max_h_level

unsigned int Adaptivity::_max_h_level
protected

The maximum number of refinement levels.

Definition at line 324 of file Adaptivity.h.

Referenced by adaptMesh(), getMaxHLevel(), and setMaxHLevel().

◆ _mesh

MooseMesh& Adaptivity::_mesh
protected

Definition at line 272 of file Adaptivity.h.

Referenced by adaptMesh(), init(), uniformRefineWithProjection(), and updateErrorVectors().

◆ _mesh_refinement

std::unique_ptr<libMesh::MeshRefinement> Adaptivity::_mesh_refinement
protected

A mesh refinement object to be used either with initial refinement or with Adaptivity.

Definition at line 279 of file Adaptivity.h.

Referenced by adaptMesh(), init(), and setParam().

◆ _mesh_refinement_on

bool Adaptivity::_mesh_refinement_on
protected

on/off flag reporting if the adaptivity is being used

Definition at line 275 of file Adaptivity.h.

Referenced by init(), isAdaptivityDue(), isOn(), and setAdaptivityOn().

◆ _pg_moose_app

MooseApp& PerfGraphInterface::_pg_moose_app
protectedinherited

The MooseApp that owns the PerfGraph.

Definition at line 135 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::perfGraph().

◆ _prefix

const std::string PerfGraphInterface::_prefix
protectedinherited

A prefix to use for all sections.

Definition at line 138 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::timedSectionName().

◆ _print_mesh_changed

bool Adaptivity::_print_mesh_changed
protected

True if we want to print out info when mesh has changed.

Definition at line 296 of file Adaptivity.h.

Referenced by adaptMesh(), and setPrintMeshChanged().

◆ _recompute_markers_during_cycles

bool Adaptivity::_recompute_markers_during_cycles
protected

Whether or not to recompute markers during adaptivity cycles.

Definition at line 327 of file Adaptivity.h.

Referenced by getRecomputeMarkersFlag(), setParam(), and setRecomputeMarkersFlag().

◆ _sibling_coupling

std::unique_ptr<libMesh::SiblingCoupling> Adaptivity::_sibling_coupling
protected

Sibling coupling object for HP adaptivity for evaluating data on elements' siblings in HPCoarsenTest.

Definition at line 331 of file Adaptivity.h.

Referenced by init().

◆ _start_time

Real Adaptivity::_start_time
protected

When adaptivity start.

Definition at line 305 of file Adaptivity.h.

Referenced by isAdaptivityDue(), and setTimeActive().

◆ _step

int& Adaptivity::_step
protected

Time Step.

Definition at line 301 of file Adaptivity.h.

Referenced by isAdaptivityDue().

◆ _steps

unsigned int Adaptivity::_steps
protected

steps of adaptivity to perform

Definition at line 293 of file Adaptivity.h.

Referenced by getSteps(), and init().

◆ _stop_time

Real Adaptivity::_stop_time
protected

When adaptivity stops.

Definition at line 307 of file Adaptivity.h.

Referenced by isAdaptivityDue(), and setTimeActive().

◆ _t

Real& Adaptivity::_t
protected

Time.

Definition at line 299 of file Adaptivity.h.

Referenced by isAdaptivityDue().

◆ _use_new_system

bool Adaptivity::_use_new_system
protected

Whether or not to use the "new" adaptivity system.

Definition at line 312 of file Adaptivity.h.

Referenced by adaptMesh(), and setUseNewSystem().


The documentation for this class was generated from the following files: