DomainChunk.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#ifndef __WEIPA_DOMAINCHUNK_H__
#define __WEIPA_DOMAINCHUNK_H__
#include <weipa/weipa.h>
class DBfile;
namespace escript {
class AbstractDomain;
}
namespace weipa {
typedef enum {
NODE_CENTERED=0,
ZONE_CENTERED
} Centering;
class DomainChunk
{
public:
virtual bool initFromEscript(const escript::AbstractDomain* domain) = 0;
virtual bool initFromFile(const std::string& filename) = 0;
virtual bool writeToSilo(DBfile* dbfile, const std::string& pathInSilo,
const StringVec& labels,
const StringVec& units,
bool writeMeshData) = 0;
virtual void reorderGhostZones(int ownIndex) = 0;
virtual void removeGhostZones(int ownIndex) = 0;
virtual StringVec getMeshNames() const = 0;
virtual StringVec getVarNames() const = 0;
virtual ElementData_ptr getElementsByName(const std::string& name) const=0;
virtual NodeData_ptr getMeshByName(const std::string& name) const = 0;
virtual DataVar_ptr getDataVarByName(const std::string& name) const = 0;
virtual Centering getCenteringForFunctionSpace(int fsCode) const = 0;
virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const = 0;
virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const = 0;
virtual NodeData_ptr getNodes() const = 0;
virtual std::string getSiloPath() const = 0;
virtual void setSiloPath(const std::string& path) = 0;
protected:
virtual ~DomainChunk() {}
};
} // namespace weipa
#endif // __WEIPA_DOMAINCHUNK_H__
weipa::DomainChunk::getVarNames
virtual StringVec getVarNames() const =0
Returns the names of all 'special' domain variables.
weipa::DataVar_ptr
boost::shared_ptr< DataVar > DataVar_ptr
Definition: weipa.h:65
weipa
Definition: DataVar.cpp:51
weipa::DomainChunk
Abstract base class for weipa's interface to an Escript domain or one chunk thereof if domain decompo...
Definition: DomainChunk.h:46
weipa::ZONE_CENTERED
@ ZONE_CENTERED
Definition: DomainChunk.h:33
weipa::DomainChunk::~DomainChunk
virtual ~DomainChunk()
Destructor.
Definition: DomainChunk.h:105
weipa::DomainChunk::getElementsForFunctionSpace
virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const =0
Returns the element data for given function space code.
weipa::DomainChunk::getSiloPath
virtual std::string getSiloPath() const =0
Returns the absolute path within Silo file if writeToSilo() or setSiloPath() was called before,...
weipa::ElementData_ptr
boost::shared_ptr< ElementData > ElementData_ptr
Definition: weipa.h:67
weipa::NODE_CENTERED
@ NODE_CENTERED
Definition: DomainChunk.h:32
weipa::DomainChunk::setSiloPath
virtual void setSiloPath(const std::string &path)=0
Sets the silo path to be used when saving to a Silo file.
weipa::DomainChunk::getElementsByName
virtual ElementData_ptr getElementsByName(const std::string &name) const =0
Returns element data with given name.
weipa::DomainChunk::getDataVarByName
virtual DataVar_ptr getDataVarByName(const std::string &name) const =0
Creates and returns a variable with domain data.
weipa::DomainChunk::getMeshByName
virtual NodeData_ptr getMeshByName(const std::string &name) const =0
Returns the node mesh with given name.
weipa::DomainChunk::initFromFile
virtual bool initFromFile(const std::string &filename)=0
Reads the domain from a dump file.
escript
Definition: AbstractContinuousDomain.cpp:23
weipa::NodeData_ptr
boost::shared_ptr< NodeData > NodeData_ptr
Definition: weipa.h:69
weipa::StringVec
std::vector< std::string > StringVec
Definition: weipa.h:61
weipa::DomainChunk::getNodes
virtual NodeData_ptr getNodes() const =0
Returns a pointer to the full nodes.
weipa::DomainChunk::initFromEscript
virtual bool initFromEscript(const escript::AbstractDomain *domain)=0
Initialises the domain using an escript domain instance.
weipa::DomainChunk::getMeshNames
virtual StringVec getMeshNames() const =0
Returns the names of all meshes within this domain.
escript::AbstractDomain
Base class for all escript domains.
Definition: AbstractDomain.h:64
weipa::DomainChunk::removeGhostZones
virtual void removeGhostZones(int ownIndex)=0
Removes 'ghost' elements and nodes.
weipa::Centering
Centering
Definition: DomainChunk.h:31
weipa::DomainChunk::getCenteringForFunctionSpace
virtual Centering getCenteringForFunctionSpace(int fsCode) const =0
Returns whether data on given function space is node or cell centered.
weipa::DomainChunk::writeToSilo
virtual bool writeToSilo(DBfile *dbfile, const std::string &pathInSilo, const StringVec &labels, const StringVec &units, bool writeMeshData)=0
Writes the domain to a Silo file.
weipa::DomainChunk::getMeshForFunctionSpace
virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const =0
Returns the node mesh for given function space code.
weipa::DomainChunk::reorderGhostZones
virtual void reorderGhostZones(int ownIndex)=0
Reorders elements so that 'ghost' elements (i.e. those that do not belong to ownIndex) appear last.