https://mooseframework.inl.gov
BlockRestrictionDebugOutput.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 // MOOSE includes
12 #include "FEProblem.h"
13 #include "Material.h"
14 #include "ConsoleUtils.h"
15 #include "MooseMesh.h"
16 #include "MooseObjectName.h"
17 #include "NonlinearSystemBase.h"
18 #include "MooseVariableBase.h"
19 #include "BlockRestrictable.h"
20 #include "BoundaryRestrictable.h"
21 #include "KernelBase.h"
22 #include "AuxiliarySystem.h"
23 #include "AuxKernel.h"
24 #include "UserObject.h"
25 #include "MooseObject.h"
26 #include "InitialConditionBase.h"
27 #include "FVInitialConditionBase.h"
28 #include "Constraint.h"
29 
30 #include "libmesh/transient_system.h"
31 
32 #include <functional>
33 #include <map>
34 
35 using namespace libMesh;
36 
38 
39 namespace
40 {
41 template <typename ID>
42 using RestrictionGroups = std::map<std::set<ID>, std::set<std::string>>;
43 
44 template <typename ID>
45 std::string
46 formatRestrictionIDs(const std::set<ID> & ids,
47  const std::set<ID> & all_ids,
48  const std::string & all_text,
49  const std::function<std::string(ID)> & id_to_string)
50 {
51  if (ids.empty())
52  return "(none)";
53 
54  if (ids == all_ids)
55  return all_text;
56 
57  std::stringstream out;
58  unsigned int i = 0;
59  for (const auto id : ids)
60  out << id_to_string(id) << (++i < ids.size() ? ", " : "");
61 
62  return out.str();
63 }
64 
65 void
66 printGroupNames(std::stringstream & out, const std::set<std::string> & names)
67 {
68  std::streampos begin_string_pos = out.tellp();
69  std::streampos curr_string_pos = begin_string_pos;
70  unsigned int i = 0;
71  for (const auto & name : names)
72  {
73  out << Moose::stringify(name) << (++i < names.size() ? ", " : "");
74  curr_string_pos = out.tellp();
75  ConsoleUtils::insertNewline(out, begin_string_pos, curr_string_pos);
76  }
77  out << '\n';
78 }
79 
80 std::string
81 objectRestrictionName(const MooseObject & object)
82 {
83  return object.type() + "/" + object.name();
84 }
85 
86 void
87 addBlockRestrictionObject(RestrictionGroups<SubdomainID> & groups, const MooseObject & object)
88 {
89  if (!object.enabled())
90  return;
91 
92  const auto * const block_restrictable = dynamic_cast<const BlockRestrictable *>(&object);
93  if (block_restrictable)
94  groups[block_restrictable->blockIDs()].insert(objectRestrictionName(object));
95 }
96 
97 void
98 addBoundaryRestrictionObject(RestrictionGroups<BoundaryID> & groups,
99  const MooseObject & object,
100  const bool include_unrestricted)
101 {
102  if (!object.enabled())
103  return;
104 
105  const auto * const boundary_restrictable = dynamic_cast<const BoundaryRestrictable *>(&object);
106  if (!boundary_restrictable)
107  return;
108 
109  if (!include_unrestricted && !boundary_restrictable->boundaryRestricted())
110  return;
111 
112  const auto & ids = boundary_restrictable->boundaryRestricted()
113  ? boundary_restrictable->boundaryIDs()
114  : boundary_restrictable->meshBoundaryIDs();
115  groups[ids].insert(objectRestrictionName(object));
116 }
117 
118 template <typename T>
119 void
120 addWarehouseBlockRestrictionObjects(RestrictionGroups<SubdomainID> & groups,
121  const MooseObjectWarehouseBase<T> & warehouse)
122 {
123  for (const auto & object : warehouse.getObjects(/*tid = */ 0))
124  addBlockRestrictionObject(groups, *object);
125 }
126 
127 template <typename T>
128 void
129 addWarehouseBoundaryRestrictionObjects(RestrictionGroups<BoundaryID> & groups,
130  const MooseObjectWarehouseBase<T> & warehouse,
131  const bool include_unrestricted)
132 {
133  for (const auto & object : warehouse.getObjects(/*tid = */ 0))
134  addBoundaryRestrictionObject(groups, *object, include_unrestricted);
135 }
136 }
137 
140 {
142 
143  params.addParam<MultiMooseEnum>("scope",
144  getScopes("all"),
145  "The types of object to output block coverage for, if nothing is "
146  "provided everything will be output.");
147 
148  params.addParam<NonlinearSystemName>(
149  "nl_sys", "nl0", "The nonlinear system that we should output information for.");
150  params.addParam<bool>(
151  "show_block_restriction_map",
152  true,
153  "Print active objects for each block. This is the default block-restriction debug output.");
154  params.addParam<bool>("show_block_restriction_groups",
155  false,
156  "Print groups of objects with identical block restrictions.");
157  params.addParam<bool>("show_boundary_restriction_groups",
158  false,
159  "Print groups of objects with identical boundary restrictions.");
160 
161  params.addClassDescription(
162  "Debug output object for displaying information regarding block and boundary restrictions of "
163  "objects.");
164  params.set<ExecFlagEnum>("execute_on") = EXEC_INITIAL;
165  return params;
166 }
167 
169 BlockRestrictionDebugOutput::getScopes(std::string default_scopes)
170 {
171  return MultiMooseEnum("none all variables kernels auxvariables auxkernels materials userobjects",
172  default_scopes);
173 }
174 
176  : Output(parameters),
177  _scope(getParam<MultiMooseEnum>("scope")),
178  _nl(_problem_ptr->getNonlinearSystemBase(
179  _problem_ptr->nlSysNum(getParam<NonlinearSystemName>("nl_sys")))),
180  _sys(_nl.system()),
181  _show_block_restriction_map(getParam<bool>("show_block_restriction_map")),
182  _show_block_restriction_groups(getParam<bool>("show_block_restriction_groups")),
183  _show_boundary_restriction_groups(getParam<bool>("show_boundary_restriction_groups"))
184 {
185 }
186 
187 void
189 {
192 
195 
198 }
199 
200 void
202 {
203  // is there anything to do?
204  if (_scope.isValid() && _scope.contains("none"))
205  return;
206 
207  // Build output stream
208  std::stringstream out;
209 
210  auto printCategoryAndNames = [&out](std::string category, std::set<std::string> & names)
211  {
212  const auto n = names.size();
213  if (n > 0)
214  {
215  // print the category and number of items
216  out << " " << category << " (" << n << " " << ((n == 1) ? "item" : "items") << "): ";
217 
218  // If we would just use Moose::stringify(names), the indention is not right.
219  // So we are printing the names one by one and using ConsoleUtils::insertNewline.
220  std::streampos begin_string_pos = out.tellp();
221  std::streampos curr_string_pos = begin_string_pos;
222  unsigned int i = 0;
223  for (const auto & name : names)
224  {
225  out << Moose::stringify(name) << ((i++ < (n - 1)) ? ", " : "");
226  curr_string_pos = out.tellp();
227  ConsoleUtils::insertNewline(out, begin_string_pos, curr_string_pos);
228  }
229  out << '\n';
230  return true;
231  }
232  else
233  {
234  return false;
235  }
236  };
237 
238  // Reference to mesh for getting block names
240 
241  // set of all subdomains in the mesh
242  const std::set<SubdomainID> & mesh_subdomains = mesh.meshSubdomains();
243 
244  // get kernels via reference to the Kernel warehouse
245  const auto & kernel_warehouse = _nl.getKernelWarehouse();
246  const auto & kernels = kernel_warehouse.getObjects(/*tid = */ 0);
247 
248  // AuxSystem
249  const auto & auxSystem = _problem_ptr->getAuxiliarySystem();
250 
251  // Reference to the Material warehouse
252  const auto & material_warehouse = _problem_ptr->getMaterialWarehouse();
253 
254  // get all user objects
255  std::vector<UserObject *> userObjects;
257  .query()
258  .condition<AttribSystem>("UserObject")
259  .condition<AttribThread>(0)
260  .queryIntoUnsorted(userObjects);
261 
262  // do we have to check all object types?
263  const bool include_all = !_scope.isValid() || _scope.contains("all");
264 
265  // iterate all subdomains
266  for (const auto & subdomain_id : mesh_subdomains)
267  {
268  // get the corresponding subdomain name
269  const auto & subdomain_name = mesh.getSubdomainName(subdomain_id);
270 
271  out << "\n";
272  out << " Subdomain '" << subdomain_name << "' (id " << subdomain_id << "):\n";
273 
274  bool objectsFound = false;
275 
276  // Variables
277  if (include_all || _scope.contains("variables"))
278  {
279  std::set<std::string> names;
280  for (unsigned int var_num = 0; var_num < _sys.n_vars(); var_num++)
281  {
282  const auto & var_name = _sys.variable_name(var_num);
283  if (_problem_ptr->hasVariable(var_name))
284  {
285  const MooseVariableBase & var =
286  _problem_ptr->getVariable(/*tid = */ 0,
287  var_name,
290  if (var.hasBlocks(subdomain_id))
291  names.insert(var_name);
292  }
293  }
294  objectsFound = printCategoryAndNames("Variables", names) || objectsFound;
295  }
296 
297  // Kernels
298  if (include_all || _scope.contains("kernels"))
299  {
300  std::set<std::string> names;
301  for (const auto & kernel : kernels)
302  {
303  if (kernel->hasBlocks(subdomain_id))
304  names.insert(kernel->name());
305  }
306  objectsFound = printCategoryAndNames("Kernels", names) || objectsFound;
307  }
308 
309  // AuxVariables
310  if (include_all || _scope.contains("auxvariables"))
311  {
312  std::set<std::string> names;
313  const auto & sys = auxSystem.system();
314  for (unsigned int vg = 0; vg < sys.n_variable_groups(); vg++)
315  {
316  const VariableGroup & vg_description(sys.variable_group(vg));
317  for (unsigned int vn = 0; vn < vg_description.n_variables(); vn++)
318  {
319  if (vg_description.active_on_subdomain(subdomain_id))
320  names.insert(vg_description.name(vn));
321  }
322  }
323  objectsFound = printCategoryAndNames("AuxVariables", names) || objectsFound;
324  }
325 
326  // AuxKernels
327  if (include_all || _scope.contains("auxkernels"))
328  {
329 
330  {
331  const auto & wh = auxSystem.nodalAuxWarehouse();
332  std::set<std::string> names;
333  if (wh.hasActiveBlockObjects(subdomain_id))
334  {
335  const auto & auxkernels = wh.getActiveBlockObjects(subdomain_id);
336  for (auto & auxkernel : auxkernels)
337  names.insert(auxkernel->name());
338  }
339  objectsFound = printCategoryAndNames("AuxKernels[nodal]", names) || objectsFound;
340  }
341 
342  {
343  const auto & wh = auxSystem.nodalVectorAuxWarehouse();
344  std::set<std::string> names;
345  if (wh.hasActiveBlockObjects(subdomain_id))
346  {
347  const auto & auxkernels = wh.getActiveBlockObjects(subdomain_id);
348  for (auto & auxkernel : auxkernels)
349  names.insert(auxkernel->name());
350  }
351  objectsFound = printCategoryAndNames("AuxKernels[nodalVector]", names) || objectsFound;
352  }
353 
354  {
355  const auto & wh = auxSystem.nodalArrayAuxWarehouse();
356  std::set<std::string> names;
357  if (wh.hasActiveBlockObjects(subdomain_id))
358  {
359  const auto & auxkernels = wh.getActiveBlockObjects(subdomain_id);
360  for (auto & auxkernel : auxkernels)
361  names.insert(auxkernel->name());
362  }
363  objectsFound = printCategoryAndNames("AuxKernels[nodalArray]", names) || objectsFound;
364  }
365 
366  {
367  const auto & wh = auxSystem.elemAuxWarehouse();
368  std::set<std::string> names;
369  if (wh.hasActiveBlockObjects(subdomain_id))
370  {
371  const auto & auxkernels = wh.getActiveBlockObjects(subdomain_id);
372  for (auto & auxkernel : auxkernels)
373  names.insert(auxkernel->name());
374  }
375  objectsFound = printCategoryAndNames("AuxKernels[elemAux]", names) || objectsFound;
376  }
377 
378  {
379  const auto & wh = auxSystem.elemVectorAuxWarehouse();
380  std::set<std::string> names;
381  if (wh.hasActiveBlockObjects(subdomain_id))
382  {
383  const auto & auxkernels = wh.getActiveBlockObjects(subdomain_id);
384  for (auto & auxkernel : auxkernels)
385  names.insert(auxkernel->name());
386  }
387  objectsFound = printCategoryAndNames("AuxKernels[elemVector]", names) || objectsFound;
388  }
389 
390  {
391  const auto & wh = auxSystem.elemArrayAuxWarehouse();
392  std::set<std::string> names;
393  if (wh.hasActiveBlockObjects(subdomain_id))
394  {
395  const auto & auxkernels = wh.getActiveBlockObjects(subdomain_id);
396  for (auto & auxkernel : auxkernels)
397  names.insert(auxkernel->name());
398  }
399  objectsFound = printCategoryAndNames("AuxKernels[elemArray]", names) || objectsFound;
400  }
401  }
402 
403  // Materials
404  if (include_all || _scope.contains("materials"))
405  {
406  std::set<std::string> names;
407  if (material_warehouse.hasActiveBlockObjects(subdomain_id))
408  {
409  auto const objs = material_warehouse.getBlockObjects(subdomain_id);
410  for (const auto & mat : objs)
411  names.insert(mat->name());
412  }
413  objectsFound = printCategoryAndNames("Materials", names) || objectsFound;
414  }
415 
416  // UserObjects
417  if (include_all || _scope.contains("userobjects"))
418  {
419  std::set<std::string> names;
420  for (const auto & obj : userObjects)
421  if (BlockRestrictable * blockrestrictable_obj = dynamic_cast<BlockRestrictable *>(obj))
422  if (blockrestrictable_obj->hasBlocks(subdomain_id))
423  names.insert(obj->name());
424  objectsFound = printCategoryAndNames("UserObjects", names) || objectsFound;
425  }
426 
427  if (!objectsFound)
428  out << " (no objects found)\n";
429  }
430 
431  out << std::flush;
432 
433  // Write the stored string to the ConsoleUtils output objects
434  _console << "\n[DBG] Block-Restrictions (" << mesh_subdomains.size()
435  << " subdomains): showing active objects\n";
436  _console << std::setw(ConsoleUtils::console_field_width) << out.str() << std::endl;
437 }
438 
439 void
441 {
443  const auto & mesh_subdomains = mesh.meshSubdomains();
444 
445  RestrictionGroups<SubdomainID> groups;
446  std::vector<MooseObject *> objects;
448  .query()
450  .condition<AttribThread>(0)
451  .queryIntoUnsorted(objects);
452 
453  for (const auto object : objects)
454  if (object->enabled())
455  {
456  const auto * const block_restrictable = dynamic_cast<const BlockRestrictable *>(object);
457  mooseAssert(block_restrictable, "Query returned an object without BlockRestrictable");
458  groups[block_restrictable->blockIDs()].insert(objectRestrictionName(*object));
459  }
460 
461  // Variables and aux variables are stored in libMesh systems / VariableWarehouse, not in
462  // theWarehouse(), so add their block restrictions explicitly.
463  for (const auto var_num : make_range(_sys.n_vars()))
464  {
465  const auto & var_name = _sys.variable_name(var_num);
466  if (_problem_ptr->hasVariable(var_name))
467  {
468  const auto & var = _problem_ptr->getVariable(
470  groups[var.blockIDs()].insert("Variable/" + var_name);
471  }
472  }
473 
474  const auto & aux_system = _problem_ptr->getAuxiliarySystem().system();
475  for (const auto vg : make_range(aux_system.n_variable_groups()))
476  {
477  const VariableGroup & vg_description(aux_system.variable_group(vg));
478  std::set<SubdomainID> blocks;
479  for (const auto subdomain_id : mesh_subdomains)
480  if (vg_description.active_on_subdomain(subdomain_id))
481  blocks.insert(subdomain_id);
482 
483  for (const auto vn : make_range(vg_description.n_variables()))
484  groups[blocks].insert("AuxVariable/" + vg_description.name(vn));
485  }
486 
487  // Custom warehouses below are not covered by theWarehouse() queries.
488  const auto & aux_system_base = _problem_ptr->getAuxiliarySystem();
489  addWarehouseBlockRestrictionObjects(groups, aux_system_base.nodalAuxWarehouse());
490  addWarehouseBlockRestrictionObjects(groups, aux_system_base.mortarNodalAuxWarehouse());
491  addWarehouseBlockRestrictionObjects(groups, aux_system_base.nodalVectorAuxWarehouse());
492  addWarehouseBlockRestrictionObjects(groups, aux_system_base.nodalArrayAuxWarehouse());
493  addWarehouseBlockRestrictionObjects(groups, aux_system_base.elemAuxWarehouse());
494  addWarehouseBlockRestrictionObjects(groups, aux_system_base.elemVectorAuxWarehouse());
495  addWarehouseBlockRestrictionObjects(groups, aux_system_base.elemArrayAuxWarehouse());
496 #ifdef MOOSE_KOKKOS_ENABLED
497  addWarehouseBlockRestrictionObjects(groups, aux_system_base.kokkosNodalAuxWarehouse());
498  addWarehouseBlockRestrictionObjects(groups, aux_system_base.kokkosElemAuxWarehouse());
499 #endif
500 
501  addWarehouseBlockRestrictionObjects(groups, _problem_ptr->getInitialConditionWarehouse());
502  addWarehouseBlockRestrictionObjects(groups, _problem_ptr->getFVInitialConditionWarehouse());
503  addWarehouseBlockRestrictionObjects(groups, _nl.getConstraintWarehouse());
504 
505  // Materials use MaterialWarehouse, which also owns automatically-created face and neighbor
506  // materials; report the primary material objects from the aggregate material warehouse.
507  addWarehouseBlockRestrictionObjects(groups, _problem_ptr->getMaterialWarehouse());
508 
509  std::stringstream out;
510  for (const auto & group : groups)
511  {
512  out << "\n";
513  out << " Blocks "
514  << formatRestrictionIDs<SubdomainID>(group.first,
515  mesh_subdomains,
516  "all blocks",
517  [&mesh](const SubdomainID id)
518  {
519  const auto & name = mesh.getSubdomainName(id);
520  return name.empty() ? std::to_string(id)
521  : "'" + name + "' (id " +
522  std::to_string(id) + ")";
523  })
524  << " (" << group.second.size() << " " << (group.second.size() == 1 ? "item" : "items")
525  << "): ";
526  printGroupNames(out, group.second);
527  }
528 
529  if (groups.empty())
530  out << "\n (no objects found)\n";
531 
532  out << std::flush;
533 
534  _console << "\n[DBG] Block-Restriction Groups (" << groups.size()
535  << " groups): showing objects with matching block restrictions\n";
536  _console << std::setw(ConsoleUtils::console_field_width) << out.str() << std::endl;
537 }
538 
539 void
541 {
543  const auto & mesh_boundaries = mesh.getBoundaryIDs();
544 
545  RestrictionGroups<BoundaryID> groups;
546  std::vector<MooseObject *> objects;
548  .query()
550  .condition<AttribThread>(0)
551  .queryIntoUnsorted(objects);
552 
553  for (const auto object : objects)
554  if (object->enabled())
555  {
556  const auto * const boundary_restrictable = dynamic_cast<const BoundaryRestrictable *>(object);
557  mooseAssert(boundary_restrictable, "Query returned an object without BoundaryRestrictable");
558  const auto & ids = boundary_restrictable->boundaryRestricted()
559  ? boundary_restrictable->boundaryIDs()
560  : boundary_restrictable->meshBoundaryIDs();
561  groups[ids].insert(objectRestrictionName(*object));
562  }
563 
564  // Custom warehouses below are not covered by theWarehouse() queries. For these explicit passes,
565  // only boundary-restricted objects belong in boundary-restriction groups; block-only objects are
566  // already represented in the block groups.
567  const auto & aux_system = _problem_ptr->getAuxiliarySystem();
568  addWarehouseBoundaryRestrictionObjects(groups, aux_system.nodalAuxWarehouse(), false);
569  addWarehouseBoundaryRestrictionObjects(groups, aux_system.mortarNodalAuxWarehouse(), false);
570  addWarehouseBoundaryRestrictionObjects(groups, aux_system.nodalVectorAuxWarehouse(), false);
571  addWarehouseBoundaryRestrictionObjects(groups, aux_system.nodalArrayAuxWarehouse(), false);
572  addWarehouseBoundaryRestrictionObjects(groups, aux_system.elemAuxWarehouse(), false);
573  addWarehouseBoundaryRestrictionObjects(groups, aux_system.elemVectorAuxWarehouse(), false);
574  addWarehouseBoundaryRestrictionObjects(groups, aux_system.elemArrayAuxWarehouse(), false);
575 #ifdef MOOSE_KOKKOS_ENABLED
576  addWarehouseBoundaryRestrictionObjects(groups, aux_system.kokkosNodalAuxWarehouse(), false);
577  addWarehouseBoundaryRestrictionObjects(groups, aux_system.kokkosElemAuxWarehouse(), false);
578 #endif
579 
580  addWarehouseBoundaryRestrictionObjects(
581  groups, _problem_ptr->getInitialConditionWarehouse(), false);
582  addWarehouseBoundaryRestrictionObjects(groups, _nl.getConstraintWarehouse(), false);
583  addWarehouseBoundaryRestrictionObjects(groups, _problem_ptr->getMaterialWarehouse(), false);
584 
585  std::stringstream out;
586  for (const auto & group : groups)
587  {
588  out << "\n";
589  out << " Boundaries "
590  << formatRestrictionIDs<BoundaryID>(group.first,
591  mesh_boundaries,
592  "all boundaries",
593  [&mesh](const BoundaryID id)
594  {
595  const auto name = mesh.getBoundaryString(id);
596  return "'" + name + "' (id " + std::to_string(id) +
597  ")";
598  })
599  << " (" << group.second.size() << " " << (group.second.size() == 1 ? "item" : "items")
600  << "): ";
601  printGroupNames(out, group.second);
602  }
603 
604  if (groups.empty())
605  out << "\n (no objects found)\n";
606 
607  out << std::flush;
608 
609  _console << "\n[DBG] Boundary-Restriction Groups (" << groups.size()
610  << " groups): showing objects with matching boundary restrictions\n";
611  _console << std::setw(ConsoleUtils::console_field_width) << out.str() << std::endl;
612 }
virtual bool hasVariable(const std::string &var_name) const override
Whether or not this problem has the variable.
const ConstraintWarehouse & getConstraintWarehouse() const
BlockRestrictionDebugOutput(const InputParameters &parameters)
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:21
std::streampos tellp()
const bool & _show_block_restriction_groups
Whether to print object groups by identical block restriction.
virtual bool boundaryRestricted() const
Returns true if this object has been restricted to a boundary.
char ** blocks
void printBlockRestrictionMap() const
Prints block-restriction information.
virtual bool isValid() const override
IsValid.
virtual void output() override
Perform the debugging output.
MooseObjectTagWarehouse< KernelBase > & getKernelWarehouse()
Access functions to Warehouses from outside NonlinearSystemBase.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
MeshBase & mesh
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
A class for producing various debug related outputs.
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
const MaterialWarehouse & getMaterialWarehouse() const
const InitialConditionWarehouse & getInitialConditionWarehouse() const
Return InitialCondition storage.
const bool & _show_block_restriction_map
Whether to print the existing per-block restriction map.
const NonlinearSystemBase & _nl
Reference to MOOSE&#39;s nonlinear system.
const bool & _show_boundary_restriction_groups
Whether to print object groups by identical boundary restriction.
void printBoundaryRestrictionGroups() const
Prints object groups with identical boundary restrictions.
virtual const MooseVariableFieldBase & getVariable(const 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) const override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
static const unsigned int console_field_width
Width used for printing simulation information.
Definition: ConsoleUtils.h:30
Based class for output objects.
Definition: Output.h:43
bool contains(const std::string &value) const
Methods for seeing if a value is set in the MultiMooseEnum.
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
const std::vector< std::shared_ptr< T > > & getObjects(THREAD_ID tid=0) const
Retrieve complete vector to the all/block/boundary restricted objects for a given thread...
TheWarehouse & theWarehouse() const
const MultiMooseEnum & _scope
multi-enum of object types to show the block-restriction for
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
void insertNewline(std::stringstream &oss, std::streampos &begin, std::streampos &curr)
Helper function function for stringstream formatting.
Definition: ConsoleUtils.C:572
boundary_id_type BoundaryID
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
Definition: Output.h:185
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:93
const std::string & variable_name(const unsigned int i) const
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
AuxiliarySystem & getAuxiliarySystem()
registerMooseObject("MooseApp", BlockRestrictionDebugOutput)
virtual void insert(libMesh::NumericVector< libMesh::Number > &vector)=0
Insert the currently cached degree of freedom values into the provided vector.
const FVInitialConditionWarehouse & getFVInitialConditionWarehouse() const
Return FVInitialCondition storage.
OStreamProxy out
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
Definition: TheWarehouse.h:467
static MultiMooseEnum getScopes(std::string default_scopes="")
Get the supported scopes of output (e.g., variables, etc.)
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
IntRange< T > make_range(T beg, T end)
virtual MooseMesh & mesh() override
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
Definition: TheWarehouse.h:285
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
virtual libMesh::System & system() override
Get the reference to the libMesh system.
bool hasBlocks(const SubdomainName &name) const
Test if the supplied block name is valid for this object.
unsigned int n_vars() const
OStreamProxy out(std::cout)
A base storage container for MooseObjects.
static InputParameters validParams()
Definition: Output.C:32
void printBlockRestrictionGroups() const
Prints object groups with identical block restrictions.
virtual bool enabled() const
Return the enabled status of the object.
Definition: MooseObject.h:49
Base variable class.
const libMesh::System & _sys
Reference to libMesh system.
const ExecFlagType EXEC_INITIAL
Definition: Moose.C:30