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

Represents a full Finley or Dudley domain including nodes and elements. More...

#include <FinleyDomain.h>

Inheritance diagram for weipa::FinleyDomain:
weipa::DomainChunk

Public Member Functions

 FinleyDomain ()
 
 FinleyDomain (const FinleyDomain &m)
 
virtual ~FinleyDomain ()
 
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 Member Functions

void cleanup ()
 

Private Attributes

bool initialized
 
FinleyNodes_ptr nodes
 
FinleyElements_ptr cells
 
FinleyElements_ptr faces
 
FinleyElements_ptr contacts
 
std::string siloPath
 

Additional Inherited Members

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

Detailed Description

Represents a full Finley or Dudley domain including nodes and elements.

This class represents a Finley or Dudley domain including nodes, cells, and face elements (plus contact elements for Finley). It provides functionality to read a domain from a netCDF file (generated by the domain's dump() method) or directly through an instance of finley::Mesh or Dudley_Mesh.

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

Constructor & Destructor Documentation

◆ FinleyDomain() [1/2]

weipa::FinleyDomain::FinleyDomain ( )

◆ FinleyDomain() [2/2]

weipa::FinleyDomain::FinleyDomain ( const FinleyDomain m)

References cells, contacts, faces, initialized, and nodes.

◆ ~FinleyDomain()

weipa::FinleyDomain::~FinleyDomain ( )
virtual

References cleanup().

Member Function Documentation

◆ cleanup()

void weipa::FinleyDomain::cleanup ( )
private

◆ getCenteringForFunctionSpace()

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

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

Implements weipa::DomainChunk.

References DUDLEY_NODES, FINLEY_NODES, FINLEY_REDUCED_NODES, weipa::NODE_CENTERED, and weipa::ZONE_CENTERED.

◆ getDataVarByName()

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

◆ getElementsByName()

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

Returns element data with given name.

Implements weipa::DomainChunk.

References cells, contacts, and faces.

Referenced by getDataVarByName(), and getMeshByName().

◆ getElementsForFunctionSpace()

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

◆ getMeshByName()

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

Returns the node mesh with given name.

Implements weipa::DomainChunk.

References getElementsByName(), and initialized.

◆ getMeshForFunctionSpace()

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

Returns the node mesh for given function space code.

Implements weipa::DomainChunk.

References getElementsForFunctionSpace(), and initialized.

◆ getMeshNames()

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

Returns the names of all meshes within this domain.

Implements weipa::DomainChunk.

References cells, contacts, faces, and initialized.

◆ getNodes()

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

Returns a pointer to the full nodes.

Implements weipa::DomainChunk.

Referenced by getDataVarByName().

◆ getSiloPath()

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

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

Implements weipa::DomainChunk.

◆ getVarNames()

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

Returns the names of all 'special' domain variables.

Implements weipa::DomainChunk.

References cells, contacts, faces, initialized, and nodes.

◆ initFromEscript()

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

◆ initFromFile()

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

Reads the domain from a dump file.

Implements weipa::DomainChunk.

References cells, cleanup(), contacts, faces, initialized, and nodes.

◆ removeGhostZones()

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

Removes 'ghost' elements and nodes.

Implements weipa::DomainChunk.

References cells, contacts, faces, initialized, and nodes.

◆ reorderGhostZones()

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

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

Implements weipa::DomainChunk.

References cells, contacts, faces, and initialized.

◆ setSiloPath()

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

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

Implements weipa::DomainChunk.

◆ writeToSilo()

bool weipa::FinleyDomain::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, contacts, faces, initialized, and siloPath.

Member Data Documentation

◆ cells

FinleyElements_ptr weipa::FinleyDomain::cells
private

◆ contacts

FinleyElements_ptr weipa::FinleyDomain::contacts
private

◆ faces

FinleyElements_ptr weipa::FinleyDomain::faces
private

◆ initialized

bool weipa::FinleyDomain::initialized
private

◆ nodes

FinleyNodes_ptr weipa::FinleyDomain::nodes
private

◆ siloPath

std::string weipa::FinleyDomain::siloPath
private

Referenced by writeToSilo().


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