www.mooseframework.org
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
MaterialWarehouse Class Reference

Material objects are special in that they have additional objects created automatically (see FEProblemBase::addMaterial). More...

#include <MaterialWarehouse.h>

Inheritance diagram for MaterialWarehouse:
[legend]

Public Member Functions

const MooseObjectWarehouse< Material > & operator[] (Moose::MaterialDataType data_type) const
 
void addObjects (std::shared_ptr< Material > block, std::shared_ptr< Material > neighbor, std::shared_ptr< Material > face, THREAD_ID tid=0)
 A special method unique to this class for adding Block, Neighbor, and Face material objects. More...
 
virtual void addObject (std::shared_ptr< Material > object, THREAD_ID tid=0, bool recurse=true) override
 Adds an object to the storage structure. More...
 
unsigned int size (THREAD_ID tid=0)
 Return how many kernels we store in the current warehouse. More...
 
std::set< SubdomainIDgetActiveBlocks (THREAD_ID tid=0) const
 Return a set of active SubdomainsIDs. More...
 
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. More...
 
THREAD_ID numThreads ()
 Return the number of threads. More...
 
virtual void initialSetup (THREAD_ID tid=0) const
 Convenience methods for calling object setup methods that handle the extra neighbor and face objects. More...
 
virtual void timestepSetup (THREAD_ID tid=0) const
 
virtual void subdomainSetup (THREAD_ID tid=0) const
 
virtual void subdomainSetup (SubdomainID id, THREAD_ID tid=0) const
 
virtual void neighborSubdomainSetup (THREAD_ID tid=0) const
 
virtual void neighborSubdomainSetup (SubdomainID id, THREAD_ID tid=0) const
 
virtual void jacobianSetup (THREAD_ID tid=0) const
 
virtual void residualSetup (THREAD_ID tid=0) const
 
virtual void updateActive (THREAD_ID tid=0)
 Update the active status of Kernels. More...
 
void sort (THREAD_ID tid=0)
 
bool hasActiveVariableBlockObjects (unsigned int variable_id, SubdomainID block_id, THREAD_ID tid=0) const
 Methods for checking/getting variable kernels for a variable and SubdomainID. More...
 
const std::vector< std::shared_ptr< Material > > & getActiveVariableBlockObjects (unsigned int variable_id, SubdomainID block_id, THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Material > > & getObjects (THREAD_ID tid=0) const
 Retrieve complete vector to the all/block/boundary restricted objects for a given thread. More...
 
const std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > & getBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Material > > & getBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > & getBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Material > > & getBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Material > > & getActiveObjects (THREAD_ID tid=0) const
 Retrieve complete vector to the active all/block/boundary restricted objects for a given thread. More...
 
const std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > & getActiveBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Material > > & getActiveBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > & getActiveBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< Material > > & getActiveBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool hasActiveObjects (THREAD_ID tid=0) const
 Convenience functions for determining if objects exist. More...
 
bool hasActiveBlockObjects (THREAD_ID tid=0) const
 
bool hasActiveBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
bool hasActiveBoundaryObjects (THREAD_ID tid=0) const
 
bool hasActiveBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool hasActiveObject (const std::string &name, THREAD_ID tid=0) const
 Convenience functions for checking/getting specific objects. More...
 
std::shared_ptr< MaterialgetActiveObject (const std::string &name, THREAD_ID tid=0) const
 
void updateVariableDependency (std::set< MooseVariableFEBase * > &needed_moose_vars, THREAD_ID tid=0) const
 Update variable dependency vector. More...
 
void updateBlockVariableDependency (SubdomainID id, std::set< MooseVariableFEBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (std::set< MooseVariableFEBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (BoundaryID id, std::set< MooseVariableFEBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateMatPropDependency (std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 Update material property dependency vector. More...
 
void updateBlockMatPropDependency (SubdomainID id, std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 
void updateBoundaryMatPropDependency (std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 
void updateBoundaryMatPropDependency (BoundaryID id, std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 

Protected Member Functions

void checkThreadID (THREAD_ID tid) const
 Calls assert on thread id. More...
 

Static Protected Member Functions

static void updateActiveHelper (std::vector< std::shared_ptr< Material >> &active, const std::vector< std::shared_ptr< Material >> &all)
 Helper method for updating active vectors. More...
 
static void sortHelper (std::vector< std::shared_ptr< Material >> &objects)
 Helper method for sorting vectors of objects. More...
 
static void updateVariableDependencyHelper (std::set< MooseVariableFEBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Material >> &objects)
 Helper method for updating variable dependency vector. More...
 
static void updateMatPropDependencyHelper (std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Material >> &objects)
 Helper method for updating material property dependency vector. More...
 

Protected Attributes

MooseObjectWarehouse< Material_neighbor_materials
 Stroage for neighbor material objects (Block are stored in the base class) More...
 
MooseObjectWarehouse< Material_face_materials
 Stroage for face material objects (Block are stored in the base class) More...
 
std::map< unsigned int, MooseObjectWarehouse< Material > > _variable_objects
 Variable based storage. More...
 
const THREAD_ID _num_threads
 Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) More...
 
std::vector< std::vector< std::shared_ptr< Material > > > _all_objects
 Storage container for the ALL pointers (THREAD_ID on outer vector) More...
 
std::vector< std::vector< std::shared_ptr< Material > > > _active_objects
 All active objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > > _all_block_objects
 
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > > _active_block_objects
 Active block restricted objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > > _all_boundary_objects
 
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > > _active_boundary_objects
 Active boundary restricted objects (THREAD_ID on outer vector) More...
 

Detailed Description

Material objects are special in that they have additional objects created automatically (see FEProblemBase::addMaterial).

This class specializes the base class to acount for the additional Neightbor and face objects that may exist.

Definition at line 27 of file MaterialWarehouse.h.

Member Function Documentation

◆ addObject()

void MooseObjectWarehouse< Material >::addObject ( std::shared_ptr< Material object,
THREAD_ID  tid = 0,
bool  recurse = true 
)
overridevirtualinherited

Adds an object to the storage structure.

Parameters
objectA shared pointer to the object being added
tidThe thread ID (default is 0)
recurseWhether or not to build recusive warehouses (typically for Kernels)

Reimplemented from MooseObjectWarehouseBase< Material >.

Definition at line 92 of file MooseObjectWarehouse.h.

95 {
96  MooseObjectWarehouseBase<T>::addObject(object, tid, recurse);
97 
98  if (recurse)
99  {
100  {
102 
103  if (mvi)
104  _variable_objects[mvi->mooseVariable()->number()].addObject(object, tid, false);
105  }
106 
107  {
109 
110  if (mvi)
111  _variable_objects[mvi->mooseVariable()->number()].addObject(object, tid, false);
112  }
113  }
114 }
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
std::map< unsigned int, MooseObjectWarehouse< Material > > _variable_objects
Variable based storage.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.

◆ addObjects()

void MaterialWarehouse::addObjects ( std::shared_ptr< Material block,
std::shared_ptr< Material neighbor,
std::shared_ptr< Material face,
THREAD_ID  tid = 0 
)

A special method unique to this class for adding Block, Neighbor, and Face material objects.

Definition at line 15 of file MaterialWarehouse.C.

Referenced by FEProblemBase::addMaterialHelper().

19 {
21  _neighbor_materials.addObject(neighbor, tid);
22  _face_materials.addObject(face, tid);
23 }
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.

◆ checkThreadID()

void MooseObjectWarehouseBase< Material >::checkThreadID ( THREAD_ID  tid) const
inlineprotectedinherited

Calls assert on thread id.

Definition at line 673 of file MooseObjectWarehouseBase.h.

674 {
675  mooseAssert(tid < _num_threads,
676  "Attempting to access a thread id ("
677  << tid << ") greater than the number allowed by the storage item ("
678  << _num_threads << ")");
679 }
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...

◆ getActiveBlockObjects() [1/2]

const std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > & MooseObjectWarehouseBase< Material >::getActiveBlockObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 386 of file MooseObjectWarehouseBase.h.

387 {
388  checkThreadID(tid);
389  return _active_block_objects[tid];
390 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getActiveBlockObjects() [2/2]

const std::vector< std::shared_ptr< Material > > & MooseObjectWarehouseBase< Material >::getActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 394 of file MooseObjectWarehouseBase.h.

395 {
396  checkThreadID(tid);
397  const auto iter = _active_block_objects[tid].find(id);
398  mooseAssert(iter != _active_block_objects[tid].end(),
399  "Unable to located active block objects for the given id: " << id << ".");
400  return iter->second;
401 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getActiveBlocks()

std::set< SubdomainID > MooseObjectWarehouseBase< Material >::getActiveBlocks ( THREAD_ID  tid = 0) const
inherited

Return a set of active SubdomainsIDs.

Definition at line 475 of file MooseObjectWarehouseBase.h.

476 {
477  checkThreadID(tid);
478  std::set<SubdomainID> ids;
479  for (const auto & object_pair : _active_block_objects[tid])
480  ids.insert(object_pair.first);
481  return ids;
482 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getActiveBoundaryObjects() [1/2]

const std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > & MooseObjectWarehouseBase< Material >::getActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 367 of file MooseObjectWarehouseBase.h.

368 {
369  checkThreadID(tid);
370  return _active_boundary_objects[tid];
371 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ getActiveBoundaryObjects() [2/2]

const std::vector< std::shared_ptr< Material > > & MooseObjectWarehouseBase< Material >::getActiveBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 375 of file MooseObjectWarehouseBase.h.

376 {
377  checkThreadID(tid);
378  const auto iter = _active_boundary_objects[tid].find(id);
379  mooseAssert(iter != _active_boundary_objects[tid].end(),
380  "Unable to located active boundary objects for the given id: " << id << ".");
381  return iter->second;
382 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ getActiveObject()

std::shared_ptr< Material > MooseObjectWarehouseBase< Material >::getActiveObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 464 of file MooseObjectWarehouseBase.h.

465 {
466  checkThreadID(tid);
467  for (const auto & object : _active_objects[tid])
468  if (object->name() == name)
469  return object;
470  mooseError("Unable to locate active object: ", name, ".");
471 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Material > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ getActiveObjects()

const std::vector< std::shared_ptr< Material > > & MooseObjectWarehouseBase< Material >::getActiveObjects ( THREAD_ID  tid = 0) const
inlineinherited

Retrieve complete vector to the active all/block/boundary restricted objects for a given thread.

Parameters
tidThe thread id to retrieve objects from

Definition at line 359 of file MooseObjectWarehouseBase.h.

360 {
361  checkThreadID(tid);
362  return _active_objects[tid];
363 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Material > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ getActiveVariableBlockObjects()

const std::vector< std::shared_ptr< Material > > & MooseObjectWarehouse< Material >::getActiveVariableBlockObjects ( unsigned int  variable_id,
SubdomainID  block_id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 128 of file MooseObjectWarehouse.h.

131 {
132  checkThreadID(tid);
133  const auto iter = _variable_objects.find(variable_id);
134  mooseAssert(iter != _variable_objects.end(),
135  "Unable to locate variable kernels for the given variable id: " << variable_id
136  << ".");
137  return iter->second.getActiveBlockObjects(block_id, tid);
138 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::map< unsigned int, MooseObjectWarehouse< Material > > _variable_objects
Variable based storage.

◆ getBlockObjects() [1/2]

const std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > & MooseObjectWarehouseBase< Material >::getBlockObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 340 of file MooseObjectWarehouseBase.h.

341 {
342  checkThreadID(tid);
343  return _all_block_objects[tid];
344 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > > _all_block_objects
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getBlockObjects() [2/2]

const std::vector< std::shared_ptr< Material > > & MooseObjectWarehouseBase< Material >::getBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 348 of file MooseObjectWarehouseBase.h.

349 {
350  checkThreadID(tid);
351  const auto iter = _all_block_objects[tid].find(id);
352  mooseAssert(iter != _all_block_objects[tid].end(),
353  "Unable to located active block objects for the given id: " << id << ".");
354  return iter->second;
355 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > > _all_block_objects
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getBoundaryObjects() [1/2]

const std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > & MooseObjectWarehouseBase< Material >::getBoundaryObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 321 of file MooseObjectWarehouseBase.h.

322 {
323  checkThreadID(tid);
324  return _all_boundary_objects[tid];
325 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > > _all_boundary_objects

◆ getBoundaryObjects() [2/2]

const std::vector< std::shared_ptr< Material > > & MooseObjectWarehouseBase< Material >::getBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 329 of file MooseObjectWarehouseBase.h.

330 {
331  checkThreadID(tid);
332  const auto iter = _all_boundary_objects[tid].find(id);
333  mooseAssert(iter != _all_boundary_objects[tid].end(),
334  "Unable to located active boundary objects for the given id: " << id << ".");
335  return iter->second;
336 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > > _all_boundary_objects

◆ getObjects()

const std::vector< std::shared_ptr< Material > > & MooseObjectWarehouseBase< Material >::getObjects ( THREAD_ID  tid = 0) const
inlineinherited

Retrieve complete vector to the all/block/boundary restricted objects for a given thread.

Parameters
tidThe thread id to retrieve objects from

Definition at line 313 of file MooseObjectWarehouseBase.h.

314 {
315  checkThreadID(tid);
316  return _all_objects[tid];
317 }
std::vector< std::vector< std::shared_ptr< Material > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasActiveBlockObjects() [1/2]

bool MooseObjectWarehouseBase< Material >::hasActiveBlockObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 413 of file MooseObjectWarehouseBase.h.

414 {
415  checkThreadID(tid);
416  bool has_active_block_objects = false;
417  for (const auto & object_pair : _active_block_objects[tid])
418  has_active_block_objects |= !(object_pair.second.empty());
419  return has_active_block_objects;
420 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasActiveBlockObjects() [2/2]

bool MooseObjectWarehouseBase< Material >::hasActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 424 of file MooseObjectWarehouseBase.h.

425 {
426  checkThreadID(tid);
427  const auto iter = _active_block_objects[tid].find(id);
428  return iter != _active_block_objects[tid].end();
429 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasActiveBoundaryObjects() [1/2]

bool MooseObjectWarehouseBase< Material >::hasActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 433 of file MooseObjectWarehouseBase.h.

434 {
435  checkThreadID(tid);
436  bool has_active_boundary_objects = false;
437  for (const auto & object_pair : _active_boundary_objects[tid])
438  has_active_boundary_objects |= !(object_pair.second.empty());
439  return has_active_boundary_objects;
440 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ hasActiveBoundaryObjects() [2/2]

bool MooseObjectWarehouseBase< Material >::hasActiveBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 444 of file MooseObjectWarehouseBase.h.

445 {
446  checkThreadID(tid);
447  const auto iter = _active_boundary_objects[tid].find(id);
448  return iter != _active_boundary_objects[tid].end();
449 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ hasActiveObject()

bool MooseObjectWarehouseBase< Material >::hasActiveObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const
inherited

Convenience functions for checking/getting specific objects.

Definition at line 453 of file MooseObjectWarehouseBase.h.

454 {
455  checkThreadID(tid);
456  for (const auto & object : _active_objects[tid])
457  if (object->name() == name)
458  return true;
459  return false;
460 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Material > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ hasActiveObjects()

bool MooseObjectWarehouseBase< Material >::hasActiveObjects ( THREAD_ID  tid = 0) const
inherited

Convenience functions for determining if objects exist.

Definition at line 405 of file MooseObjectWarehouseBase.h.

406 {
407  checkThreadID(tid);
408  return !_active_objects[tid].empty();
409 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< Material > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ hasActiveVariableBlockObjects()

bool MooseObjectWarehouse< Material >::hasActiveVariableBlockObjects ( unsigned int  variable_id,
SubdomainID  block_id,
THREAD_ID  tid = 0 
) const
inherited

Methods for checking/getting variable kernels for a variable and SubdomainID.

Definition at line 118 of file MooseObjectWarehouse.h.

121 {
122  auto iter = _variable_objects.find(variable_id);
123  return (iter != _variable_objects.end() && iter->second.hasActiveBlockObjects(block_id, tid));
124 }
std::map< unsigned int, MooseObjectWarehouse< Material > > _variable_objects
Variable based storage.

◆ initialSetup()

void MaterialWarehouse::initialSetup ( THREAD_ID  tid = 0) const
virtual

Convenience methods for calling object setup methods that handle the extra neighbor and face objects.

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 42 of file MaterialWarehouse.C.

Referenced by FEProblemBase::initialSetup().

43 {
47 }
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)

◆ jacobianSetup()

void MaterialWarehouse::jacobianSetup ( THREAD_ID  tid = 0) const
virtual

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 92 of file MaterialWarehouse.C.

Referenced by FEProblemBase::computeJacobianTags().

93 {
97 }
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
virtual void jacobianSetup(THREAD_ID tid=0) const
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)

◆ neighborSubdomainSetup() [1/2]

void MaterialWarehouse::neighborSubdomainSetup ( THREAD_ID  tid = 0) const
virtual

Definition at line 65 of file MaterialWarehouse.C.

Referenced by FEProblemBase::neighborSubdomainSetup().

66 {
68 }
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
virtual void subdomainSetup(THREAD_ID tid=0) const

◆ neighborSubdomainSetup() [2/2]

void MaterialWarehouse::neighborSubdomainSetup ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
virtual

Definition at line 78 of file MaterialWarehouse.C.

79 {
81 }
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
virtual void subdomainSetup(THREAD_ID tid=0) const

◆ numThreads()

THREAD_ID MooseObjectWarehouseBase< Material >::numThreads ( )
inlineinherited

Return the number of threads.

Definition at line 161 of file MooseObjectWarehouseBase.h.

161 { return _num_threads; }
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...

◆ operator[]()

const MooseObjectWarehouse< Material > & MaterialWarehouse::operator[] ( Moose::MaterialDataType  data_type) const

Definition at line 26 of file MaterialWarehouse.C.

27 {
28  switch (data_type)
29  {
31  return _neighbor_materials;
32  break;
34  return _face_materials;
35  break;
36  default:
37  return *this;
38  }
39 }
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)

◆ residualSetup()

void MaterialWarehouse::residualSetup ( THREAD_ID  tid = 0) const
virtual

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 84 of file MaterialWarehouse.C.

Referenced by FEProblemBase::computeBounds(), and FEProblemBase::computeResidualTags().

85 {
89 }
virtual void residualSetup(THREAD_ID tid=0) const
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)

◆ size()

unsigned int MooseObjectWarehouseBase< Material >::size ( THREAD_ID  tid = 0)
inherited

Return how many kernels we store in the current warehouse.

Definition at line 233 of file MooseObjectWarehouseBase.h.

234 {
235  checkThreadID(tid);
236  return _all_objects[tid].size();
237 }
std::vector< std::vector< std::shared_ptr< Material > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ sort()

void MaterialWarehouse::sort ( THREAD_ID  tid = 0)

Definition at line 108 of file MaterialWarehouse.C.

Referenced by FEProblemBase::initialSetup().

109 {
112  _face_materials.sort(tid);
113 }
void sort(THREAD_ID tid=0)
Sort the objects using the DependencyResolver.
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)

◆ sortHelper()

void MooseObjectWarehouseBase< Material >::sortHelper ( std::vector< std::shared_ptr< Material >> &  objects)
staticprotectedinherited

Helper method for sorting vectors of objects.

Definition at line 653 of file MooseObjectWarehouseBase.h.

654 {
655  // Do nothing if the vector is empty
656  if (objects.empty())
657  return;
658 
659  try
660  {
661  // Sort based on dependencies
662  DependencyResolverInterface::sort<std::shared_ptr<T>>(objects);
663  }
664  catch (CyclicDependencyException<std::shared_ptr<T>> & e)
665  {
666  DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<T>>(
667  e, "Cyclic dependency detected in object ordering");
668  }
669 }

◆ subdomainsCovered()

void MooseObjectWarehouseBase< Material >::subdomainsCovered ( std::set< SubdomainID > &  subdomains_covered,
std::set< std::string > &  unique_variables,
THREAD_ID  tid = 0 
) const
inherited

Populates a set of covered subdomains and the associated variable names.

Definition at line 640 of file MooseObjectWarehouseBase.h.

643 {
644  for (const auto & object : _active_objects[tid])
645  unique_variables.insert(object->variable().name());
646 
647  for (const auto & object_pair : _active_block_objects[tid])
648  subdomains_covered.insert(object_pair.first);
649 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
std::vector< std::vector< std::shared_ptr< Material > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ subdomainSetup() [1/2]

void MaterialWarehouse::subdomainSetup ( THREAD_ID  tid = 0) const
virtual

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 58 of file MaterialWarehouse.C.

Referenced by FEProblemBase::subdomainSetup().

59 {
62 }
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)
virtual void subdomainSetup(THREAD_ID tid=0) const

◆ subdomainSetup() [2/2]

void MaterialWarehouse::subdomainSetup ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
virtual

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 71 of file MaterialWarehouse.C.

72 {
75 }
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)
virtual void subdomainSetup(THREAD_ID tid=0) const

◆ timestepSetup()

void MaterialWarehouse::timestepSetup ( THREAD_ID  tid = 0) const
virtual

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 50 of file MaterialWarehouse.C.

Referenced by FEProblemBase::timestepSetup().

51 {
55 }
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
virtual void timestepSetup(THREAD_ID tid=0) const
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)

◆ updateActive()

void MaterialWarehouse::updateActive ( THREAD_ID  tid = 0)
virtual

Update the active status of Kernels.

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 100 of file MaterialWarehouse.C.

Referenced by FEProblemBase::updateActiveObjects().

101 {
105 }
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.

◆ updateActiveHelper()

void MooseObjectWarehouseBase< Material >::updateActiveHelper ( std::vector< std::shared_ptr< Material >> &  active,
const std::vector< std::shared_ptr< Material >> &  all 
)
staticprotectedinherited

Helper method for updating active vectors.

Definition at line 501 of file MooseObjectWarehouseBase.h.

503 {
504  // Clear the active list
505  active.clear();
506 
507  std::copy_if(all.begin(),
508  all.end(),
509  std::back_inserter(active),
510  [](const std::shared_ptr<T> & object) { return object->enabled(); });
511 }

◆ updateBlockMatPropDependency()

void MooseObjectWarehouseBase< Material >::updateBlockMatPropDependency ( SubdomainID  id,
std::set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 599 of file MooseObjectWarehouseBase.h.

602 {
603  if (hasActiveBlockObjects(id, tid))
604  updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid));
605 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Material >> &objects)
Helper method for updating material property dependency vector.

◆ updateBlockVariableDependency()

void MooseObjectWarehouseBase< Material >::updateBlockVariableDependency ( SubdomainID  id,
std::set< MooseVariableFEBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 542 of file MooseObjectWarehouseBase.h.

546 {
547  if (hasActiveBlockObjects(id, tid))
548  updateVariableDependencyHelper(needed_moose_vars, getActiveBlockObjects(id, tid));
549 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< Material > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Material >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryMatPropDependency() [1/2]

void MooseObjectWarehouseBase< Material >::updateBoundaryMatPropDependency ( std::set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 609 of file MooseObjectWarehouseBase.h.

611 {
612  if (hasActiveBoundaryObjects(tid))
613  for (auto & active_bnd_object : _active_boundary_objects[tid])
614  updateMatPropDependencyHelper(needed_mat_props, active_bnd_object.second);
615 }
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Material >> &objects)
Helper method for updating material property dependency vector.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ updateBoundaryMatPropDependency() [2/2]

void MooseObjectWarehouseBase< Material >::updateBoundaryMatPropDependency ( BoundaryID  id,
std::set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 619 of file MooseObjectWarehouseBase.h.

621 {
622  if (hasActiveBoundaryObjects(id, tid))
623  updateMatPropDependencyHelper(needed_mat_props, getActiveBoundaryObjects(id, tid));
624 }
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< Material >> &objects)
Helper method for updating material property dependency vector.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
const std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const

◆ updateBoundaryVariableDependency() [1/2]

void MooseObjectWarehouseBase< Material >::updateBoundaryVariableDependency ( std::set< MooseVariableFEBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 553 of file MooseObjectWarehouseBase.h.

555 {
556  if (hasActiveBoundaryObjects(tid))
557  {
558  typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
559  for (const auto & object_pair : _active_boundary_objects[tid])
560  updateVariableDependencyHelper(needed_moose_vars, object_pair.second);
561  }
562 }
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Material >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryVariableDependency() [2/2]

void MooseObjectWarehouseBase< Material >::updateBoundaryVariableDependency ( BoundaryID  id,
std::set< MooseVariableFEBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 566 of file MooseObjectWarehouseBase.h.

570 {
571  if (hasActiveBoundaryObjects(id, tid))
572  updateVariableDependencyHelper(needed_moose_vars, getActiveBoundaryObjects(id, tid));
573 }
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
const std::map< BoundaryID, std::vector< std::shared_ptr< Material > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Material >> &objects)
Helper method for updating variable dependency vector.

◆ updateMatPropDependency()

void MooseObjectWarehouseBase< Material >::updateMatPropDependency ( std::set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0 
) const
inherited

Update material property dependency vector.

Definition at line 590 of file MooseObjectWarehouseBase.h.

592 {
593  if (hasActiveObjects(tid))
594  updateMatPropDependencyHelper(needed_mat_props, _all_objects[tid]);
595 }
std::vector< std::vector< std::shared_ptr< Material > > > _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< Material >> &objects)
Helper method for updating material property dependency vector.
bool hasActiveObjects(THREAD_ID tid=0) const
Convenience functions for determining if objects exist.

◆ updateMatPropDependencyHelper()

void MooseObjectWarehouseBase< Material >::updateMatPropDependencyHelper ( std::set< unsigned int > &  needed_mat_props,
const std::vector< std::shared_ptr< Material >> &  objects 
)
staticprotectedinherited

Helper method for updating material property dependency vector.

Definition at line 628 of file MooseObjectWarehouseBase.h.

630 {
631  for (auto & object : objects)
632  {
633  auto & mp_deps = object->getMatPropDependencies();
634  needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
635  }
636 }

◆ updateVariableDependency()

void MooseObjectWarehouseBase< Material >::updateVariableDependency ( std::set< MooseVariableFEBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Update variable dependency vector.

Definition at line 533 of file MooseObjectWarehouseBase.h.

535 {
536  if (hasActiveObjects(tid))
537  updateVariableDependencyHelper(needed_moose_vars, _all_objects[tid]);
538 }
std::vector< std::vector< std::shared_ptr< Material > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
bool hasActiveObjects(THREAD_ID tid=0) const
Convenience functions for determining if objects exist.
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase * > &needed_moose_vars, const std::vector< std::shared_ptr< Material >> &objects)
Helper method for updating variable dependency vector.

◆ updateVariableDependencyHelper()

void MooseObjectWarehouseBase< Material >::updateVariableDependencyHelper ( std::set< MooseVariableFEBase *> &  needed_moose_vars,
const std::vector< std::shared_ptr< Material >> &  objects 
)
staticprotectedinherited

Helper method for updating variable dependency vector.

Definition at line 577 of file MooseObjectWarehouseBase.h.

580 {
581  for (const auto & object : objects)
582  {
583  const auto & mv_deps = object->getMooseVariableDependencies();
584  needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
585  }
586 }

Member Data Documentation

◆ _active_block_objects

std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<Material > > > > MooseObjectWarehouseBase< Material >::_active_block_objects
protectedinherited

Active block restricted objects (THREAD_ID on outer vector)

Definition at line 177 of file MooseObjectWarehouseBase.h.

◆ _active_boundary_objects

std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<Material > > > > MooseObjectWarehouseBase< Material >::_active_boundary_objects
protectedinherited

Active boundary restricted objects (THREAD_ID on outer vector)

Definition at line 183 of file MooseObjectWarehouseBase.h.

◆ _active_objects

std::vector<std::vector<std::shared_ptr<Material > > > MooseObjectWarehouseBase< Material >::_active_objects
protectedinherited

All active objects (THREAD_ID on outer vector)

Definition at line 171 of file MooseObjectWarehouseBase.h.

◆ _all_block_objects

std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<Material > > > > MooseObjectWarehouseBase< Material >::_all_block_objects
protectedinherited

Definition at line 174 of file MooseObjectWarehouseBase.h.

◆ _all_boundary_objects

std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<Material > > > > MooseObjectWarehouseBase< Material >::_all_boundary_objects
protectedinherited

Definition at line 180 of file MooseObjectWarehouseBase.h.

◆ _all_objects

std::vector<std::vector<std::shared_ptr<Material > > > MooseObjectWarehouseBase< Material >::_all_objects
protectedinherited

Storage container for the ALL pointers (THREAD_ID on outer vector)

Definition at line 168 of file MooseObjectWarehouseBase.h.

◆ _face_materials

MooseObjectWarehouse<Material> MaterialWarehouse::_face_materials
protected

Stroage for face material objects (Block are stored in the base class)

Definition at line 62 of file MaterialWarehouse.h.

Referenced by addObjects(), initialSetup(), jacobianSetup(), operator[](), residualSetup(), sort(), subdomainSetup(), timestepSetup(), and updateActive().

◆ _neighbor_materials

MooseObjectWarehouse<Material> MaterialWarehouse::_neighbor_materials
protected

Stroage for neighbor material objects (Block are stored in the base class)

Definition at line 59 of file MaterialWarehouse.h.

Referenced by addObjects(), initialSetup(), jacobianSetup(), neighborSubdomainSetup(), operator[](), residualSetup(), sort(), timestepSetup(), and updateActive().

◆ _num_threads

const THREAD_ID MooseObjectWarehouseBase< Material >::_num_threads
protectedinherited

Convenience member storing the number of threads used for storage (1 or libMesh::n_threads)

Definition at line 165 of file MooseObjectWarehouseBase.h.

◆ _variable_objects

std::map<unsigned int, MooseObjectWarehouse<Material > > MooseObjectWarehouse< Material >::_variable_objects
protectedinherited

Variable based storage.

Definition at line 81 of file MooseObjectWarehouse.h.


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