www.mooseframework.org
MooseObjectWarehouseBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // MOOSE includes
14 #include "BoundaryRestrictable.h"
15 #include "BlockRestrictable.h"
16 #include "TransientInterface.h"
17 #include "Coupleable.h"
18 #include "SubProblem.h"
19 
20 // Forward declarations
22 
26 template <typename T>
28 {
29 public:
34  MooseObjectWarehouseBase(bool threaded = true);
35 
39  virtual ~MooseObjectWarehouseBase();
40 
46  virtual void addObject(std::shared_ptr<T> object, THREAD_ID tid = 0, bool recurse = true);
47 
51  unsigned int size(THREAD_ID tid = 0);
52 
54 
58  const std::vector<std::shared_ptr<T>> & getObjects(THREAD_ID tid = 0) const;
59  const std::map<SubdomainID, std::vector<std::shared_ptr<T>>> &
60  getBlockObjects(THREAD_ID tid = 0) const;
61  const std::vector<std::shared_ptr<T>> & getBlockObjects(SubdomainID id, THREAD_ID tid = 0) const;
62  const std::map<BoundaryID, std::vector<std::shared_ptr<T>>> &
63  getBoundaryObjects(THREAD_ID tid = 0) const;
64  const std::vector<std::shared_ptr<T>> & getBoundaryObjects(BoundaryID id,
65  THREAD_ID tid = 0) const;
67 
69 
74  const std::vector<std::shared_ptr<T>> & getActiveObjects(THREAD_ID tid = 0) const;
75  const std::map<SubdomainID, std::vector<std::shared_ptr<T>>> &
76  getActiveBlockObjects(THREAD_ID tid = 0) const;
77  const std::vector<std::shared_ptr<T>> & getActiveBlockObjects(SubdomainID id,
78  THREAD_ID tid = 0) const;
79  const std::map<BoundaryID, std::vector<std::shared_ptr<T>>> &
80  getActiveBoundaryObjects(THREAD_ID tid = 0) const;
81  const std::vector<std::shared_ptr<T>> & getActiveBoundaryObjects(BoundaryID id,
82  THREAD_ID tid = 0) const;
84 
86 
89  bool hasObjects(THREAD_ID tid = 0) const;
90  bool hasActiveObjects(THREAD_ID tid = 0) const;
91  bool hasActiveBlockObjects(THREAD_ID tid = 0) const;
92  bool hasActiveBlockObjects(SubdomainID id, THREAD_ID tid = 0) const;
93  bool hasActiveBoundaryObjects(THREAD_ID tid = 0) const;
94  bool hasActiveBoundaryObjects(BoundaryID id, THREAD_ID tid = 0) const;
96 
100  std::set<SubdomainID> getActiveBlocks(THREAD_ID tid = 0) const;
101 
103 
106  bool hasActiveObject(const std::string & name, THREAD_ID tid = 0) const;
107  std::shared_ptr<T> getObject(const std::string & name, THREAD_ID tid = 0) const;
108  std::shared_ptr<T> getActiveObject(const std::string & name, THREAD_ID tid = 0) const;
110 
114  virtual void updateActive(THREAD_ID tid = 0);
115 
119  void sort(THREAD_ID tid = 0);
120 
122 
125  void updateVariableDependency(std::set<MooseVariableFEBase *> & needed_moose_vars,
126  THREAD_ID tid = 0) const;
128  std::set<MooseVariableFEBase *> & needed_moose_vars,
129  THREAD_ID tid = 0) const;
130  void updateBoundaryVariableDependency(std::set<MooseVariableFEBase *> & needed_moose_vars,
131  THREAD_ID tid = 0) const;
133  std::set<MooseVariableFEBase *> & needed_moose_vars,
134  THREAD_ID tid = 0) const;
136 
138 
141  void updateMatPropDependency(std::set<unsigned int> & needed_mat_props, THREAD_ID tid = 0) const;
143  std::set<unsigned int> & needed_mat_props,
144  THREAD_ID tid = 0) const;
145  void updateBoundaryMatPropDependency(std::set<unsigned int> & needed_mat_props,
146  THREAD_ID tid = 0) const;
148  std::set<unsigned int> & needed_mat_props,
149  THREAD_ID tid = 0) const;
151 
155  void subdomainsCovered(std::set<SubdomainID> & subdomains_covered,
156  std::set<std::string> & unique_variables,
157  THREAD_ID tid = 0) const;
158 
163 
164 protected:
167 
169  std::vector<std::vector<std::shared_ptr<T>>> _all_objects;
170 
172  std::vector<std::vector<std::shared_ptr<T>>> _active_objects;
173 
174  // All block restricted objects (THREAD_ID on outer vector)
175  std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<T>>>> _all_block_objects;
176 
178  std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<T>>>> _active_block_objects;
179 
180  // All boundary restricted objects (THREAD_ID on outer vector)
181  std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<T>>>> _all_boundary_objects;
182 
184  std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<T>>>> _active_boundary_objects;
185 
189  static void updateActiveHelper(std::vector<std::shared_ptr<T>> & active,
190  const std::vector<std::shared_ptr<T>> & all);
191 
195  static void sortHelper(std::vector<std::shared_ptr<T>> & objects);
196 
200  static void updateVariableDependencyHelper(std::set<MooseVariableFEBase *> & needed_moose_vars,
201  const std::vector<std::shared_ptr<T>> & objects);
202 
206  static void updateMatPropDependencyHelper(std::set<unsigned int> & needed_mat_props,
207  const std::vector<std::shared_ptr<T>> & objects);
208 
212  void checkThreadID(THREAD_ID tid) const;
213 };
214 
215 template <typename T>
217  : _num_threads(threaded ? libMesh::n_threads() : 1),
218  _all_objects(_num_threads),
219  _active_objects(_num_threads),
220  _all_block_objects(_num_threads),
221  _active_block_objects(_num_threads),
222  _all_boundary_objects(_num_threads),
223  _active_boundary_objects(_num_threads)
224 {
225 }
226 
227 template <typename T>
229 {
230 }
231 
232 template <typename T>
233 unsigned int
235 {
236  checkThreadID(tid);
237  return _all_objects[tid].size();
238 }
239 
240 template <typename T>
241 void
242 MooseObjectWarehouseBase<T>::addObject(std::shared_ptr<T> object,
243  THREAD_ID tid /*= 0*/,
244  bool /* recurse = true */)
245 {
246  checkThreadID(tid);
247 
248  // Stores object in list of all objects
249  _all_objects[tid].push_back(object);
250 
251  // If enabled, store object in a list of all active
252  bool enabled = object->enabled();
253  if (enabled)
254  _active_objects[tid].push_back(object);
255 
256  // Perform casts to the Block/BoundaryRestrictable
257  std::shared_ptr<BoundaryRestrictable> bnd =
259  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
260 
261  // Boundary Restricted
262  if (bnd && bnd->boundaryRestricted())
263  {
264  const std::set<BoundaryID> & ids = bnd->boundaryIDs();
265  for (std::set<BoundaryID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
266  {
267  _all_boundary_objects[tid][*it].push_back(object);
268  if (enabled)
269  _active_boundary_objects[tid][*it].push_back(object);
270  }
271  }
272 
273  // Block Restricted
274  else if (blk)
275  {
276  const std::set<SubdomainID> & ids =
277  blk->blockRestricted() ? blk->blockIDs() : blk->meshBlockIDs();
278  for (std::set<SubdomainID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
279  {
280  _all_block_objects[tid][*it].push_back(object);
281  if (enabled)
282  _active_block_objects[tid][*it].push_back(object);
283  }
284 
285  // Check variables
286  std::shared_ptr<Coupleable> c_ptr = std::dynamic_pointer_cast<Coupleable>(object);
287  if (c_ptr)
288  for (MooseVariableFEBase * var : c_ptr->getCoupledMooseVars())
289  blk->checkVariable(*var);
290 
291  const InputParameters & parameters = object->parameters();
292 
293  SubProblem & problem = *parameters.get<SubProblem *>("_subproblem");
294 
295  THREAD_ID tid = parameters.get<THREAD_ID>("_tid");
296 
297  if (parameters.isParamValid("variable"))
298  {
299  // Try the scalar version first
300  std::string variable_name = parameters.getMooseType("variable");
301  if (variable_name == "")
302  // When using vector variables, we are only going to use the first one in the list at the
303  // interface level...
304  variable_name = parameters.getVecMooseType("variable")[0];
305 
306  blk->checkVariable(problem.getVariable(
308  }
309  }
310 }
311 
312 template <typename T>
313 inline const std::vector<std::shared_ptr<T>> &
315 {
316  checkThreadID(tid);
317  return _all_objects[tid];
318 }
319 
320 template <typename T>
321 inline const std::map<BoundaryID, std::vector<std::shared_ptr<T>>> &
323 {
324  checkThreadID(tid);
325  return _all_boundary_objects[tid];
326 }
327 
328 template <typename T>
329 const std::vector<std::shared_ptr<T>> &
331 {
332  checkThreadID(tid);
333  const auto iter = _all_boundary_objects[tid].find(id);
334  mooseAssert(iter != _all_boundary_objects[tid].end(),
335  "Unable to located active boundary objects for the given id: " << id << ".");
336  return iter->second;
337 }
338 
339 template <typename T>
340 inline const std::map<SubdomainID, std::vector<std::shared_ptr<T>>> &
342 {
343  checkThreadID(tid);
344  return _all_block_objects[tid];
345 }
346 
347 template <typename T>
348 const std::vector<std::shared_ptr<T>> &
350 {
351  checkThreadID(tid);
352  const auto iter = _all_block_objects[tid].find(id);
353  mooseAssert(iter != _all_block_objects[tid].end(),
354  "Unable to located active block objects for the given id: " << id << ".");
355  return iter->second;
356 }
357 
358 template <typename T>
359 inline const std::vector<std::shared_ptr<T>> &
361 {
362  checkThreadID(tid);
363  return _active_objects[tid];
364 }
365 
366 template <typename T>
367 inline const std::map<BoundaryID, std::vector<std::shared_ptr<T>>> &
369 {
370  checkThreadID(tid);
371  return _active_boundary_objects[tid];
372 }
373 
374 template <typename T>
375 const std::vector<std::shared_ptr<T>> &
377 {
378  checkThreadID(tid);
379  const auto iter = _active_boundary_objects[tid].find(id);
380  mooseAssert(iter != _active_boundary_objects[tid].end(),
381  "Unable to located active boundary objects for the given id: " << id << ".");
382  return iter->second;
383 }
384 
385 template <typename T>
386 inline const std::map<SubdomainID, std::vector<std::shared_ptr<T>>> &
388 {
389  checkThreadID(tid);
390  return _active_block_objects[tid];
391 }
392 
393 template <typename T>
394 const std::vector<std::shared_ptr<T>> &
396 {
397  checkThreadID(tid);
398  const auto iter = _active_block_objects[tid].find(id);
399  mooseAssert(iter != _active_block_objects[tid].end(),
400  "Unable to located active block objects for the given id: " << id << ".");
401  return iter->second;
402 }
403 
404 template <typename T>
405 bool
407 {
408  checkThreadID(tid);
409  return !_all_objects[tid].empty();
410 }
411 
412 template <typename T>
413 bool
415 {
416  checkThreadID(tid);
417  return !_active_objects[tid].empty();
418 }
419 
420 template <typename T>
421 bool
423 {
424  checkThreadID(tid);
425  bool has_active_block_objects = false;
426  for (const auto & object_pair : _active_block_objects[tid])
427  has_active_block_objects |= !(object_pair.second.empty());
428  return has_active_block_objects;
429 }
430 
431 template <typename T>
432 bool
434 {
435  checkThreadID(tid);
436  const auto iter = _active_block_objects[tid].find(id);
437  return iter != _active_block_objects[tid].end();
438 }
439 
440 template <typename T>
441 bool
443 {
444  checkThreadID(tid);
445  bool has_active_boundary_objects = false;
446  for (const auto & object_pair : _active_boundary_objects[tid])
447  has_active_boundary_objects |= !(object_pair.second.empty());
448  return has_active_boundary_objects;
449 }
450 
451 template <typename T>
452 bool
454 {
455  checkThreadID(tid);
456  const auto iter = _active_boundary_objects[tid].find(id);
457  return iter != _active_boundary_objects[tid].end();
458 }
459 
460 template <typename T>
461 bool
462 MooseObjectWarehouseBase<T>::hasActiveObject(const std::string & name, THREAD_ID tid /* = 0*/) const
463 {
464  checkThreadID(tid);
465  for (const auto & object : _active_objects[tid])
466  if (object->name() == name)
467  return true;
468  return false;
469 }
470 
471 template <typename T>
472 std::shared_ptr<T>
473 MooseObjectWarehouseBase<T>::getObject(const std::string & name, THREAD_ID tid /* = 0*/) const
474 {
475  checkThreadID(tid);
476  for (const auto & object : _all_objects[tid])
477  if (object->name() == name)
478  return object;
479  mooseError("Unable to locate object: ", name, ".");
480 }
481 
482 template <typename T>
483 std::shared_ptr<T>
484 MooseObjectWarehouseBase<T>::getActiveObject(const std::string & name, THREAD_ID tid /* = 0*/) const
485 {
486  checkThreadID(tid);
487  for (const auto & object : _active_objects[tid])
488  if (object->name() == name)
489  return object;
490  mooseError("Unable to locate active object: ", name, ".");
491 }
492 
493 template <typename T>
494 std::set<SubdomainID>
496 {
497  checkThreadID(tid);
498  std::set<SubdomainID> ids;
499  for (const auto & object_pair : _active_block_objects[tid])
500  ids.insert(object_pair.first);
501  return ids;
502 }
503 
504 template <typename T>
505 void
507 {
508  checkThreadID(tid);
509 
510  updateActiveHelper(_active_objects[tid], _all_objects[tid]);
511 
512  for (const auto & object_pair : _all_block_objects[tid])
513  updateActiveHelper(_active_block_objects[tid][object_pair.first], object_pair.second);
514 
515  for (const auto & object_pair : _all_boundary_objects[tid])
516  updateActiveHelper(_active_boundary_objects[tid][object_pair.first], object_pair.second);
517 }
518 
519 template <typename T>
520 void
521 MooseObjectWarehouseBase<T>::updateActiveHelper(std::vector<std::shared_ptr<T>> & active,
522  const std::vector<std::shared_ptr<T>> & all)
523 {
524  // Clear the active list
525  active.clear();
526 
527  std::copy_if(all.begin(),
528  all.end(),
529  std::back_inserter(active),
530  [](const std::shared_ptr<T> & object) { return object->enabled(); });
531 }
532 
533 template <typename T>
534 void
536 {
537  checkThreadID(tid);
538 
539  for (auto & object_pair : _all_block_objects[tid])
540  sortHelper(object_pair.second);
541 
542  for (auto & object_pair : _all_boundary_objects[tid])
543  sortHelper(object_pair.second);
544 
545  sortHelper(_all_objects[tid]);
546 
547  // The active lists now must be update to reflect the order changes
548  updateActive(tid);
549 }
550 
551 template <typename T>
552 void
554  std::set<MooseVariableFEBase *> & needed_moose_vars, THREAD_ID tid /* = 0*/) const
555 {
556  if (hasActiveObjects(tid))
557  updateVariableDependencyHelper(needed_moose_vars, _all_objects[tid]);
558 }
559 
560 template <typename T>
561 void
563  SubdomainID id,
564  std::set<MooseVariableFEBase *> & needed_moose_vars,
565  THREAD_ID tid /* = 0*/) const
566 {
567  if (hasActiveBlockObjects(id, tid))
568  updateVariableDependencyHelper(needed_moose_vars, getActiveBlockObjects(id, tid));
569 }
570 
571 template <typename T>
572 void
574  std::set<MooseVariableFEBase *> & needed_moose_vars, THREAD_ID tid /* = 0*/) const
575 {
576  if (hasActiveBoundaryObjects(tid))
577  {
578  typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
579  for (const auto & object_pair : _active_boundary_objects[tid])
580  updateVariableDependencyHelper(needed_moose_vars, object_pair.second);
581  }
582 }
583 
584 template <typename T>
585 void
587  BoundaryID id,
588  std::set<MooseVariableFEBase *> & needed_moose_vars,
589  THREAD_ID tid /* = 0*/) const
590 {
591  if (hasActiveBoundaryObjects(id, tid))
592  updateVariableDependencyHelper(needed_moose_vars, getActiveBoundaryObjects(id, tid));
593 }
594 
595 template <typename T>
596 void
598  std::set<MooseVariableFEBase *> & needed_moose_vars,
599  const std::vector<std::shared_ptr<T>> & objects)
600 {
601  for (const auto & object : objects)
602  {
603  const auto & mv_deps = object->getMooseVariableDependencies();
604  needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
605  }
606 }
607 
608 template <typename T>
609 void
610 MooseObjectWarehouseBase<T>::updateMatPropDependency(std::set<unsigned int> & needed_mat_props,
611  THREAD_ID tid /* = 0*/) const
612 {
613  if (hasActiveObjects(tid))
614  updateMatPropDependencyHelper(needed_mat_props, _all_objects[tid]);
615 }
616 
617 template <typename T>
618 void
620  std::set<unsigned int> & needed_mat_props,
621  THREAD_ID tid /* = 0*/) const
622 {
623  if (hasActiveBlockObjects(id, tid))
624  updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid));
625 }
626 
627 template <typename T>
628 void
630  std::set<unsigned int> & needed_mat_props, THREAD_ID tid /* = 0*/) const
631 {
632  if (hasActiveBoundaryObjects(tid))
633  for (auto & active_bnd_object : _active_boundary_objects[tid])
634  updateMatPropDependencyHelper(needed_mat_props, active_bnd_object.second);
635 }
636 
637 template <typename T>
638 void
640  BoundaryID id, std::set<unsigned int> & needed_mat_props, THREAD_ID tid /* = 0*/) const
641 {
642  if (hasActiveBoundaryObjects(id, tid))
643  updateMatPropDependencyHelper(needed_mat_props, getActiveBoundaryObjects(id, tid));
644 }
645 
646 template <typename T>
647 void
649  std::set<unsigned int> & needed_mat_props, const std::vector<std::shared_ptr<T>> & objects)
650 {
651  for (auto & object : objects)
652  {
653  auto & mp_deps = object->getMatPropDependencies();
654  needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
655  }
656 }
657 
658 template <typename T>
659 void
660 MooseObjectWarehouseBase<T>::subdomainsCovered(std::set<SubdomainID> & subdomains_covered,
661  std::set<std::string> & unique_variables,
662  THREAD_ID tid /*=0*/) const
663 {
664  for (const auto & object : _active_objects[tid])
665  unique_variables.insert(object->variable().name());
666 
667  for (const auto & object_pair : _active_block_objects[tid])
668  subdomains_covered.insert(object_pair.first);
669 }
670 
671 template <typename T>
672 void
673 MooseObjectWarehouseBase<T>::sortHelper(std::vector<std::shared_ptr<T>> & objects)
674 {
675  // Do nothing if the vector is empty
676  if (objects.empty())
677  return;
678 
679  try
680  {
681  // Sort based on dependencies
682  DependencyResolverInterface::sort<std::shared_ptr<T>>(objects);
683  }
684  catch (CyclicDependencyException<std::shared_ptr<T>> & e)
685  {
686  DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<T>>(
687  e, "Cyclic dependency detected in object ordering");
688  }
689 }
690 
691 template <typename T>
692 inline void
694 {
695  mooseAssert(tid < _num_threads,
696  "Attempting to access a thread id ("
697  << tid << ") greater than the number allowed by the storage item ("
698  << _num_threads << ")");
699 }
700 
unsigned int size(THREAD_ID tid=0)
Return how many kernels we store in the current warehouse.
void sort(THREAD_ID tid=0)
Sort the objects using the DependencyResolver.
std::string getMooseType(const std::string &name) const
Utility functions for retrieving one of the MooseTypes variables into the common "string" base class...
void updateBoundaryVariableDependency(std::set< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
bool hasActiveBlockObjects(THREAD_ID tid=0) const
void updateBlockMatPropDependency(SubdomainID id, std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
bool hasObjects(THREAD_ID tid=0) const
Convenience functions for determining if objects exist.
THREAD_ID numThreads()
Return the number of threads.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _all_block_objects
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating material property dependency vector.
void updateBlockVariableDependency(SubdomainID id, std::set< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
virtual MooseVariableFEBase & getVariable(THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY)=0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
virtual ~MooseObjectWarehouseBase()
Destructor.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
MooseObjectWarehouseBase(bool threaded=true)
Constructor.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
virtual bool blockRestricted() const
Returns true if this object has been restricted to a boundary.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
const std::vector< std::shared_ptr< T > > & getActiveObjects(THREAD_ID tid=0) const
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread...
std::set< SubdomainID > getActiveBlocks(THREAD_ID tid=0) const
Return a set of active SubdomainsIDs.
std::shared_ptr< T > getActiveObject(const std::string &name, THREAD_ID tid=0) const
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...
std::shared_ptr< T > getObject(const std::string &name, THREAD_ID tid=0) const
static void sortHelper(std::vector< std::shared_ptr< T >> &objects)
Helper method for sorting vectors of objects.
boundary_id_type BoundaryID
void subdomainsCovered(std::set< SubdomainID > &subdomains_covered, std::set< std::string > &unique_variables, THREAD_ID tid=0) const
Populates a set of covered subdomains and the associated variable names.
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getBlockObjects(THREAD_ID tid=0) const
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getBoundaryObjects(THREAD_ID tid=0) const
void updateVariableDependency(std::set< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
Update variable dependency vector.
subdomain_id_type SubdomainID
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _all_boundary_objects
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:62
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:59
bool hasActiveObject(const std::string &name, THREAD_ID tid=0) const
Convenience functions for checking/getting specific objects.
bool hasActiveObjects(THREAD_ID tid=0) const
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase *> &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.
std::vector< std::string > getVecMooseType(const std::string &name) const
void updateMatPropDependency(std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
Update material property dependency vector.
A base storage container for MooseObjects.
static void updateActiveHelper(std::vector< std::shared_ptr< T >> &active, const std::vector< std::shared_ptr< T >> &all)
Helper method for updating active vectors.
virtual void updateActive(THREAD_ID tid=0)
Updates the active objects storage.
void updateBoundaryMatPropDependency(std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
unsigned int THREAD_ID
Definition: MooseTypes.h:161
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.