Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
panzer::WorksetContainer Class Reference

Class that provides access to worksets on each element block and side set. More...

#include <Panzer_WorksetContainer.hpp>

Public Member Functions

 WorksetContainer ()
 Default contructor, starts with no workset factory objects. More...
 
 WorksetContainer (const Teuchos::RCP< const WorksetFactoryBase > &factory, const std::map< std::string, WorksetNeeds > &needs={})
 
 WorksetContainer (const WorksetContainer &wc)
 
void setFactory (const Teuchos::RCP< const WorksetFactoryBase > &factory)
 
Teuchos::RCP< const
WorksetFactoryBase
getFactory () const
 Access the workset factory pointer. More...
 
void setWorksetSize (std::size_t worksetSize)
 set the workset size More...
 
std::size_t getWorksetSize () const
 get the workset size More...
 
void setNeeds (const std::string &eBlock, const WorksetNeeds &needs)
 
void clear ()
 
void clearVolumeWorksets ()
 
void clearSideWorksets ()
 
const WorksetNeedslookupNeeds (const std::string &eBlock) const
 Look up an input physics block, throws an exception if it can not be found. More...
 
Teuchos::RCP< std::vector
< Workset > > 
getWorksets (const WorksetDescriptor &wd)
 Access to volume worksets. More...
 
Teuchos::RCP< std::map
< unsigned, Workset > > 
getSideWorksets (const WorksetDescriptor &desc)
 Access, and construction of side worksets. More...
 
void setGlobalIndexer (const Teuchos::RCP< const panzer::GlobalIndexer > &ugi)
 
void addBasis (const std::string &type, int order, const std::string &rep_field)
 
Teuchos::RCP< const
std::vector
< Intrepid2::Orientation > > 
getOrientations () const
 

Private Types

typedef std::unordered_map
< WorksetDescriptor,
Teuchos::RCP< std::vector
< Workset > > > 
WorksetMap
 
typedef std::unordered_map
< WorksetDescriptor,
Teuchos::RCP< std::map
< unsigned, Workset > > > 
SideMap
 

Private Member Functions

void applyOrientations (const Teuchos::RCP< const panzer::GlobalIndexer > &ugi)
 
void applyOrientations (const std::vector< Intrepid2::Orientation > &orientations, const std::string &eBlock, std::vector< Workset > &worksets) const
 
void applyOrientations (const std::vector< Intrepid2::Orientation > &orientations, const WorksetDescriptor &desc, std::map< unsigned, Workset > &worksets) const
 
void applyOrientations (const std::string &eBlock, std::vector< Workset > &worksets) const
 
void applyOrientations (const WorksetDescriptor &desc, std::map< unsigned, Workset > &worksets) const
 
void setIdentifiers (const WorksetDescriptor &wd, std::vector< Workset > &worksets)
 
void setIdentifiers (const WorksetDescriptor &wd, std::map< unsigned, Workset > &wkstMap)
 
bool hasNeeds () const
 

Private Attributes

Teuchos::RCP< const
WorksetFactoryBase
wkstFactory_
 
std::map< std::string,
WorksetNeeds
ebToNeeds_
 How to construct worksets. More...
 
WorksetMap worksets_
 Maps element blocks to input physics block objects. More...
 
SideMap sideWorksets_
 
std::size_t worksetSize_
 
Teuchos::RCP< const
panzer::GlobalIndexer
globalIndexer_
 
Teuchos::RCP< std::vector
< Intrepid2::Orientation > > 
orientations_
 

Detailed Description

Class that provides access to worksets on each element block and side set.

This class provides access to worksets on each element block and side set. This is done using an optional lazy construction mechnism that builds the worksets in a just in time fashion. Because the specifics of a workset is constructed are based on the type of mesh database, each new implementation must inherit from the WorksetFactoryBase class. This class will then use that one to handle the lazy evaluation.

Definition at line 41 of file Panzer_WorksetContainer.hpp.

Member Typedef Documentation

typedef std::unordered_map<WorksetDescriptor,Teuchos::RCP<std::vector<Workset> > > panzer::WorksetContainer::WorksetMap
private

Definition at line 153 of file Panzer_WorksetContainer.hpp.

typedef std::unordered_map<WorksetDescriptor,Teuchos::RCP<std::map<unsigned,Workset> > > panzer::WorksetContainer::SideMap
private

Definition at line 154 of file Panzer_WorksetContainer.hpp.

Constructor & Destructor Documentation

panzer::WorksetContainer::WorksetContainer ( )

Default contructor, starts with no workset factory objects.

Definition at line 23 of file Panzer_WorksetContainer.cpp.

panzer::WorksetContainer::WorksetContainer ( const Teuchos::RCP< const WorksetFactoryBase > &  factory,
const std::map< std::string, WorksetNeeds > &  needs = {} 
)

Instantiate a workset object with a specified factory and input workset needs map.

Parameters
[in]factoryFactory to be used for constructing worksets
[in]needsWorkset needs mapped from the element blocks (integration rules and basis values for each element block)

Definition at line 26 of file Panzer_WorksetContainer.cpp.

panzer::WorksetContainer::WorksetContainer ( const WorksetContainer wc)

Copies the workset factory, the PhysicsBlock vector, and the workset size, but not constructed worksets.

Copies the workset factory and the workset size, but not constructed worksets.

Definition at line 37 of file Panzer_WorksetContainer.cpp.

Member Function Documentation

void panzer::WorksetContainer::setFactory ( const Teuchos::RCP< const WorksetFactoryBase > &  factory)
inline

Set the workset factory, and as a consequence clear out all previously computed worksets.

Definition at line 64 of file Panzer_WorksetContainer.hpp.

Teuchos::RCP<const WorksetFactoryBase> panzer::WorksetContainer::getFactory ( ) const
inline

Access the workset factory pointer.

Definition at line 68 of file Panzer_WorksetContainer.hpp.

void panzer::WorksetContainer::setWorksetSize ( std::size_t  worksetSize)
inline

set the workset size

Definition at line 72 of file Panzer_WorksetContainer.hpp.

std::size_t panzer::WorksetContainer::getWorksetSize ( ) const
inline

get the workset size

Definition at line 76 of file Panzer_WorksetContainer.hpp.

void panzer::WorksetContainer::setNeeds ( const std::string &  eBlock,
const WorksetNeeds needs 
)

Set the needs for an element block. Note any old needs will be erased, and all worksets will be deleted. This is equivalent to calling clear(); then setNeeds(). This clearing is required in order to for the worksets to remain consistent.

Parameters
[in]eBlockElement block associated with the needs object
[in]needsNeeds for the element block.

Definition at line 63 of file Panzer_WorksetContainer.cpp.

void panzer::WorksetContainer::clear ( )

Clear all allocated worksets, maintain the workset factory and element to physics block map.

Definition at line 46 of file Panzer_WorksetContainer.cpp.

void panzer::WorksetContainer::clearVolumeWorksets ( )

Clear all allocated worksets for the volume assembly, maintain the workset factory, element to physics block map and side worksets. This is meant for cases where volume assembly is needed during setup, but during a run only side worksets are needed to adjust boundary conditions. This allows for significant memory savings.

Definition at line 52 of file Panzer_WorksetContainer.cpp.

void panzer::WorksetContainer::clearSideWorksets ( )

Clear all allocated worksets for the side assembly, maintain the workset factory, element to physics block map and volume worksets.

Definition at line 57 of file Panzer_WorksetContainer.cpp.

const WorksetNeeds & panzer::WorksetContainer::lookupNeeds ( const std::string &  eBlock) const

Look up an input physics block, throws an exception if it can not be found.

Look up an input physics block, throws an exception if it can be found.

Definition at line 70 of file Panzer_WorksetContainer.cpp.

Teuchos::RCP< std::vector< Workset > > panzer::WorksetContainer::getWorksets ( const WorksetDescriptor wd)

Access to volume worksets.

Definition at line 82 of file Panzer_WorksetContainer.cpp.

Teuchos::RCP< std::map< unsigned, Workset > > panzer::WorksetContainer::getSideWorksets ( const WorksetDescriptor desc)

Access, and construction of side worksets.

Definition at line 114 of file Panzer_WorksetContainer.cpp.

void panzer::WorksetContainer::setGlobalIndexer ( const Teuchos::RCP< const panzer::GlobalIndexer > &  ugi)

Set the global indexer. This is used solely for accessing the orientations.

Definition at line 152 of file Panzer_WorksetContainer.cpp.

void panzer::WorksetContainer::addBasis ( const std::string &  type,
int  order,
const std::string &  rep_field 
)

Add a basis to the worksets (if required). If reuqired this will clear the workset reconstructing all the arrays. Add to all element blocks.

Definition at line 159 of file Panzer_WorksetContainer.cpp.

Teuchos::RCP<const std::vector<Intrepid2::Orientation> > panzer::WorksetContainer::getOrientations ( ) const
inline

Get the cell orientations used to build the basis values objects.

Definition at line 130 of file Panzer_WorksetContainer.hpp.

void panzer::WorksetContainer::applyOrientations ( const Teuchos::RCP< const panzer::GlobalIndexer > &  ugi)
private

Set the orientations. Can only be called once, this also sets the internally stored global indexer. If an exception is raised, saying it wasn't null then this method has been previously called.

Definition at line 178 of file Panzer_WorksetContainer.cpp.

void panzer::WorksetContainer::applyOrientations ( const std::vector< Intrepid2::Orientation > &  orientations,
const std::string &  eBlock,
std::vector< Workset > &  worksets 
) const
private

Using the stored global indexer, set the orientations for a volume workset on a specified element block.

void panzer::WorksetContainer::applyOrientations ( const std::vector< Intrepid2::Orientation > &  orientations,
const WorksetDescriptor desc,
std::map< unsigned, Workset > &  worksets 
) const
private

Using the stored global indexer, set the orientations for a side workset.

void panzer::WorksetContainer::applyOrientations ( const std::string &  eBlock,
std::vector< Workset > &  worksets 
) const
private

Using the stored global indexer, set the orientations for a volume workset on a specified element block.

Definition at line 230 of file Panzer_WorksetContainer.cpp.

void panzer::WorksetContainer::applyOrientations ( const WorksetDescriptor desc,
std::map< unsigned, Workset > &  worksets 
) const
private

Using the stored global indexer, set the orientations for a side workset.

Definition at line 352 of file Panzer_WorksetContainer.cpp.

void panzer::WorksetContainer::setIdentifiers ( const WorksetDescriptor wd,
std::vector< Workset > &  worksets 
)
private

Set all the workset identifier in a vector.

Parameters
[in]wdWorkset descriptor, this defines the base point for the identifiers
[in]worksetsSet the unique identifiers on these worksets

Definition at line 209 of file Panzer_WorksetContainer.cpp.

void panzer::WorksetContainer::setIdentifiers ( const WorksetDescriptor wd,
std::map< unsigned, Workset > &  wkstMap 
)
private

Set all the workset identifier in a vector.

Parameters
[in]wdWorkset descriptor, this defines the base point for the identifiers
[in]worksetsSet the unique identifiers on these worksets

Definition at line 217 of file Panzer_WorksetContainer.cpp.

bool panzer::WorksetContainer::hasNeeds ( ) const
inlineprivate

Check if WorksetNeeds have been registered

Returns
True if there are element blocks with required needs objects

Definition at line 183 of file Panzer_WorksetContainer.hpp.

Member Data Documentation

Teuchos::RCP<const WorksetFactoryBase> panzer::WorksetContainer::wkstFactory_
private

Definition at line 186 of file Panzer_WorksetContainer.hpp.

std::map<std::string,WorksetNeeds> panzer::WorksetContainer::ebToNeeds_
private

How to construct worksets.

Definition at line 187 of file Panzer_WorksetContainer.hpp.

WorksetMap panzer::WorksetContainer::worksets_
private

Maps element blocks to input physics block objects.

Definition at line 189 of file Panzer_WorksetContainer.hpp.

SideMap panzer::WorksetContainer::sideWorksets_
private

Definition at line 190 of file Panzer_WorksetContainer.hpp.

std::size_t panzer::WorksetContainer::worksetSize_
private

Definition at line 192 of file Panzer_WorksetContainer.hpp.

Teuchos::RCP<const panzer::GlobalIndexer> panzer::WorksetContainer::globalIndexer_
private

Definition at line 194 of file Panzer_WorksetContainer.hpp.

Teuchos::RCP<std::vector<Intrepid2::Orientation> > panzer::WorksetContainer::orientations_
private

Definition at line 196 of file Panzer_WorksetContainer.hpp.


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