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