escript  Revision_
Public Member Functions | Private Attributes | List of all members
weipa::SpeckleyDomain Class Reference

Represents a full Speckley domain including nodes and elements. More...

#include <SpeckleyDomain.h>

Inheritance diagram for weipa::SpeckleyDomain:
weipa::DomainChunk

Public Member Functions

 SpeckleyDomain ()
 
 SpeckleyDomain (const SpeckleyDomain &m)
 
virtual ~SpeckleyDomain ()
 
virtual bool initFromEscript (const escript::AbstractDomain *domain)
 Initialises the domain using an escript domain instance. More...
 
virtual bool initFromFile (const std::string &filename)
 Reads the domain from a dump file. More...
 
virtual bool writeToSilo (DBfile *dbfile, const std::string &pathInSilo, const StringVec &labels, const StringVec &units, bool writeMeshData)
 Writes the domain to a Silo file. More...
 
virtual void reorderGhostZones (int ownIndex)
 Reorders elements so that 'ghost' elements (i.e. those that do not belong to ownIndex) appear last. More...
 
virtual void removeGhostZones (int ownIndex)
 Removes 'ghost' elements and nodes. More...
 
virtual StringVec getMeshNames () const
 Returns the names of all meshes within this domain. More...
 
virtual StringVec getVarNames () const
 Returns the names of all 'special' domain variables. More...
 
virtual ElementData_ptr getElementsByName (const std::string &name) const
 Returns element data with given name. More...
 
virtual NodeData_ptr getMeshByName (const std::string &name) const
 Returns the node mesh with given name. More...
 
virtual DataVar_ptr getDataVarByName (const std::string &name) const
 Creates and returns a variable with domain data. More...
 
virtual Centering getCenteringForFunctionSpace (int fsCode) const
 Returns whether data on given function space is node or cell centered. More...
 
virtual NodeData_ptr getMeshForFunctionSpace (int fsCode) const
 Returns the node mesh for given function space code. More...
 
virtual ElementData_ptr getElementsForFunctionSpace (int fsCode) const
 Returns the element data for given function space code. More...
 
virtual NodeData_ptr getNodes () const
 Returns a pointer to the full nodes. More...
 
virtual std::string getSiloPath () const
 Returns the absolute path within Silo file if writeToSilo() or setSiloPath() was called before, the empty string otherwise. More...
 
virtual void setSiloPath (const std::string &path)
 Sets the silo path to be used when saving to a Silo file. More...
 

Private Attributes

bool initialized
 
SpeckleyNodes_ptr nodes
 
SpeckleyElements_ptr cells
 
SpeckleyElements_ptr faces
 
std::string siloPath
 

Additional Inherited Members

- Protected Member Functions inherited from weipa::DomainChunk
virtual ~DomainChunk ()
 Destructor. More...
 

Detailed Description

Represents a full Speckley domain including nodes and elements.

This class represents a Speckley domain including nodes, cells, and face elements. It provides functionality to read a domain from a file (generated by the domain's dump() method) or directly through an instance of SpeckleyDomain.

Once initialised, the domain can be saved to a Silo file or its nodes and elements accessed through the respective methods.

Constructor & Destructor Documentation

◆ SpeckleyDomain() [1/2]

weipa::SpeckleyDomain::SpeckleyDomain ( )

◆ SpeckleyDomain() [2/2]

weipa::SpeckleyDomain::SpeckleyDomain ( const SpeckleyDomain m)

References cells, faces, initialized, and nodes.

◆ ~SpeckleyDomain()

virtual weipa::SpeckleyDomain::~SpeckleyDomain ( )
inlinevirtual

Member Function Documentation

◆ getCenteringForFunctionSpace()

Centering weipa::SpeckleyDomain::getCenteringForFunctionSpace ( int  fsCode) const
virtual

Returns whether data on given function space is node or cell centered.

Implements weipa::DomainChunk.

References weipa::NODE_CENTERED, speckley::Nodes, speckley::ReducedNodes, and weipa::ZONE_CENTERED.

Referenced by ~SpeckleyDomain().

◆ getDataVarByName()

DataVar_ptr weipa::SpeckleyDomain::getDataVarByName ( const std::string &  name) const
virtual

◆ getElementsByName()

ElementData_ptr weipa::SpeckleyDomain::getElementsByName ( const std::string &  name) const
virtual

Returns element data with given name.

Implements weipa::DomainChunk.

References cells, and faces.

Referenced by getDataVarByName(), getMeshByName(), and ~SpeckleyDomain().

◆ getElementsForFunctionSpace()

ElementData_ptr weipa::SpeckleyDomain::getElementsForFunctionSpace ( int  fsCode) const
virtual

Returns the element data for given function space code.

Implements weipa::DomainChunk.

References cells, initialized, and speckley::Nodes.

Referenced by getMeshForFunctionSpace(), and ~SpeckleyDomain().

◆ getMeshByName()

NodeData_ptr weipa::SpeckleyDomain::getMeshByName ( const std::string &  name) const
virtual

Returns the node mesh with given name.

Implements weipa::DomainChunk.

References getElementsByName(), and initialized.

Referenced by ~SpeckleyDomain().

◆ getMeshForFunctionSpace()

NodeData_ptr weipa::SpeckleyDomain::getMeshForFunctionSpace ( int  fsCode) const
virtual

Returns the node mesh for given function space code.

Implements weipa::DomainChunk.

References getElementsForFunctionSpace(), and initialized.

Referenced by ~SpeckleyDomain().

◆ getMeshNames()

StringVec weipa::SpeckleyDomain::getMeshNames ( ) const
virtual

Returns the names of all meshes within this domain.

Implements weipa::DomainChunk.

References cells, faces, and initialized.

Referenced by ~SpeckleyDomain().

◆ getNodes()

virtual NodeData_ptr weipa::SpeckleyDomain::getNodes ( ) const
inlinevirtual

Returns a pointer to the full nodes.

Implements weipa::DomainChunk.

References nodes.

Referenced by getDataVarByName().

◆ getSiloPath()

virtual std::string weipa::SpeckleyDomain::getSiloPath ( ) const
inlinevirtual

Returns the absolute path within Silo file if writeToSilo() or setSiloPath() was called before, the empty string otherwise.

Implements weipa::DomainChunk.

References siloPath.

◆ getVarNames()

StringVec weipa::SpeckleyDomain::getVarNames ( ) const
virtual

Returns the names of all 'special' domain variables.

Implements weipa::DomainChunk.

References cells, faces, initialized, and nodes.

Referenced by ~SpeckleyDomain().

◆ initFromEscript()

bool weipa::SpeckleyDomain::initFromEscript ( const escript::AbstractDomain domain)
virtual

Initialises the domain using an escript domain instance.

Implements weipa::DomainChunk.

References cells, speckley::Elements, faces, initialized, and nodes.

Referenced by ~SpeckleyDomain().

◆ initFromFile()

bool weipa::SpeckleyDomain::initFromFile ( const std::string &  filename)
virtual

Reads the domain from a dump file.

Implements weipa::DomainChunk.

Referenced by ~SpeckleyDomain().

◆ removeGhostZones()

void weipa::SpeckleyDomain::removeGhostZones ( int  ownIndex)
virtual

Removes 'ghost' elements and nodes.

Implements weipa::DomainChunk.

Referenced by ~SpeckleyDomain().

◆ reorderGhostZones()

void weipa::SpeckleyDomain::reorderGhostZones ( int  ownIndex)
virtual

Reorders elements so that 'ghost' elements (i.e. those that do not belong to ownIndex) appear last.

Implements weipa::DomainChunk.

Referenced by ~SpeckleyDomain().

◆ setSiloPath()

virtual void weipa::SpeckleyDomain::setSiloPath ( const std::string &  path)
inlinevirtual

Sets the silo path to be used when saving to a Silo file.

Implements weipa::DomainChunk.

References siloPath.

◆ writeToSilo()

bool weipa::SpeckleyDomain::writeToSilo ( DBfile *  dbfile,
const std::string &  pathInSilo,
const StringVec labels,
const StringVec units,
bool  writeMeshData 
)
virtual

Writes the domain to a Silo file.

Implements weipa::DomainChunk.

References cells, faces, initialized, and siloPath.

Referenced by ~SpeckleyDomain().

Member Data Documentation

◆ cells

SpeckleyElements_ptr weipa::SpeckleyDomain::cells
private

◆ faces

SpeckleyElements_ptr weipa::SpeckleyDomain::faces
private

◆ initialized

bool weipa::SpeckleyDomain::initialized
private

◆ nodes

SpeckleyNodes_ptr weipa::SpeckleyDomain::nodes
private

◆ siloPath

std::string weipa::SpeckleyDomain::siloPath
private

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