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)
 Adds an object to the storage structure. 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...
 
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)
 Updates the active objects storage. More...
 
void sort (THREAD_ID tid=0)
 
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< MooseVariable * > &needed_moose_vars, THREAD_ID tid=0) const
 Update variable dependency vector. More...
 
void updateBlockVariableDependency (SubdomainID id, std::set< MooseVariable * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (std::set< MooseVariable * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (BoundaryID id, std::set< MooseVariable * > &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< MooseVariable * > &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...
 
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 32 of file MaterialWarehouse.h.

Member Function Documentation

virtual void MooseObjectWarehouseBase< Material >::addObject ( std::shared_ptr< Material object,
THREAD_ID  tid = 0 
)
virtualinherited

Adds an object to the storage structure.

Parameters
objectA shared pointer to the object being added
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 20 of file MaterialWarehouse.C.

Referenced by FEProblemBase::addMaterial().

24 {
26  _neighbor_materials.addObject(neighbor, tid);
27  _face_materials.addObject(face, tid);
28 }
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
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)
void MooseObjectWarehouseBase< Material >::checkThreadID ( THREAD_ID  tid) const
protectedinherited

Calls assert on thread id.

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

Return a set of active SubdomainsIDs.

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

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

Parameters
tidThe thread id to retrieve objects from
const std::map<SubdomainID, std::vector<std::shared_ptr<Material > > >& MooseObjectWarehouseBase< Material >::getBlockObjects ( THREAD_ID  tid = 0) const
inherited
const std::vector<std::shared_ptr<Material > >& MooseObjectWarehouseBase< Material >::getBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited
const std::map<BoundaryID, std::vector<std::shared_ptr<Material > > >& MooseObjectWarehouseBase< Material >::getBoundaryObjects ( THREAD_ID  tid = 0) const
inherited
const std::vector<std::shared_ptr<Material > >& MooseObjectWarehouseBase< Material >::getBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited
const std::vector<std::shared_ptr<Material > >& MooseObjectWarehouseBase< Material >::getObjects ( THREAD_ID  tid = 0) const
inherited

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

Parameters
tidThe thread id to retrieve objects from
bool MooseObjectWarehouseBase< Material >::hasActiveBlockObjects ( THREAD_ID  tid = 0) const
inherited
bool MooseObjectWarehouseBase< Material >::hasActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited
bool MooseObjectWarehouseBase< Material >::hasActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inherited
bool MooseObjectWarehouseBase< Material >::hasActiveBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited
bool MooseObjectWarehouseBase< Material >::hasActiveObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const
inherited

Convenience functions for checking/getting specific objects.

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

Convenience functions for determining if objects exist.

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 47 of file MaterialWarehouse.C.

Referenced by FEProblemBase::initialSetup().

48 {
52 }
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)
void MaterialWarehouse::jacobianSetup ( THREAD_ID  tid = 0) const
virtual

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 97 of file MaterialWarehouse.C.

Referenced by FEProblemBase::computeJacobian().

98 {
102 }
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)
void MaterialWarehouse::neighborSubdomainSetup ( THREAD_ID  tid = 0) const
virtual

Definition at line 70 of file MaterialWarehouse.C.

Referenced by FEProblemBase::neighborSubdomainSetup().

71 {
73 }
virtual void subdomainSetup(THREAD_ID tid=0) const
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
void MaterialWarehouse::neighborSubdomainSetup ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
virtual

Definition at line 83 of file MaterialWarehouse.C.

84 {
86 }
virtual void subdomainSetup(THREAD_ID tid=0) const
MooseObjectWarehouse< Material > _neighbor_materials
Stroage for neighbor material objects (Block are stored in the base class)
const MooseObjectWarehouse< Material > & MaterialWarehouse::operator[] ( Moose::MaterialDataType  data_type) const

Definition at line 31 of file MaterialWarehouse.C.

Referenced by addObjects().

32 {
33  switch (data_type)
34  {
36  return _neighbor_materials;
37  break;
39  return _face_materials;
40  break;
41  default:
42  return *this;
43  }
44 }
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)
void MaterialWarehouse::residualSetup ( THREAD_ID  tid = 0) const
virtual

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 89 of file MaterialWarehouse.C.

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

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

Definition at line 113 of file MaterialWarehouse.C.

Referenced by FEProblemBase::initialSetup().

114 {
117  _face_materials.sort(tid);
118 }
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)
static void MooseObjectWarehouseBase< Material >::sortHelper ( std::vector< std::shared_ptr< Material >> &  objects)
staticprotectedinherited

Helper method for sorting vectors of objects.

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.

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

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 63 of file MaterialWarehouse.C.

Referenced by FEProblemBase::subdomainSetup().

64 {
67 }
virtual void subdomainSetup(THREAD_ID tid=0) const
MooseObjectWarehouse< Material > _face_materials
Stroage for face material objects (Block are stored in the base class)
void MaterialWarehouse::subdomainSetup ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
virtual

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 76 of file MaterialWarehouse.C.

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

Reimplemented from MooseObjectWarehouse< Material >.

Definition at line 55 of file MaterialWarehouse.C.

Referenced by FEProblemBase::timestepSetup().

56 {
60 }
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)
void MaterialWarehouse::updateActive ( THREAD_ID  tid = 0)
virtual

Updates the active objects storage.

Reimplemented from MooseObjectWarehouseBase< Material >.

Definition at line 105 of file MaterialWarehouse.C.

Referenced by FEProblemBase::updateActiveObjects().

106 {
110 }
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)
Updates the active objects storage.
static 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.

void MooseObjectWarehouseBase< Material >::updateBlockMatPropDependency ( SubdomainID  id,
std::set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0 
) const
inherited
void MooseObjectWarehouseBase< Material >::updateBlockVariableDependency ( SubdomainID  id,
std::set< MooseVariable * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited
void MooseObjectWarehouseBase< Material >::updateBoundaryMatPropDependency ( std::set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0 
) const
inherited
void MooseObjectWarehouseBase< Material >::updateBoundaryMatPropDependency ( BoundaryID  id,
std::set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0 
) const
inherited
void MooseObjectWarehouseBase< Material >::updateBoundaryVariableDependency ( std::set< MooseVariable * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited
void MooseObjectWarehouseBase< Material >::updateBoundaryVariableDependency ( BoundaryID  id,
std::set< MooseVariable * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited
void MooseObjectWarehouseBase< Material >::updateMatPropDependency ( std::set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0 
) const
inherited

Update material property dependency vector.

static 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.

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

Update variable dependency vector.

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

Helper method for updating variable dependency vector.

Member Data Documentation

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 171 of file MooseObjectWarehouseBase.h.

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 177 of file MooseObjectWarehouseBase.h.

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

All active objects (THREAD_ID on outer vector)

Definition at line 165 of file MooseObjectWarehouseBase.h.

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

Definition at line 168 of file MooseObjectWarehouseBase.h.

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

Definition at line 174 of file MooseObjectWarehouseBase.h.

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 162 of file MooseObjectWarehouseBase.h.

MooseObjectWarehouse<Material> MaterialWarehouse::_face_materials
protected

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

Definition at line 67 of file MaterialWarehouse.h.

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

MooseObjectWarehouse<Material> MaterialWarehouse::_neighbor_materials
protected

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

Definition at line 64 of file MaterialWarehouse.h.

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

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 159 of file MooseObjectWarehouseBase.h.


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