weipa/src/RipleyDomain.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2017 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 by Centre for Geoscience Computing (GeoComp)
*
*****************************************************************************/
#ifndef __WEIPA_RIPLEYDOMAIN_H__
#define __WEIPA_RIPLEYDOMAIN_H__
#include <weipa/DomainChunk.h>
#include <weipa/RipleyElements.h>
#include <boost/enable_shared_from_this.hpp>
namespace weipa {
class RipleyDomain : public DomainChunk, public boost::enable_shared_from_this<RipleyDomain>
{
public:
RipleyDomain();
RipleyDomain(const RipleyDomain& m);
virtual ~RipleyDomain() {}
virtual bool initFromEscript(const escript::AbstractDomain* domain);
virtual bool initFromFile(const std::string& filename);
virtual bool writeToSilo(DBfile* dbfile, const std::string& pathInSilo,
const StringVec& labels, const StringVec& units,
bool writeMeshData);
virtual void reorderGhostZones(int ownIndex);
virtual void removeGhostZones(int ownIndex);
virtual StringVec getMeshNames() const;
virtual StringVec getVarNames() const;
virtual ElementData_ptr getElementsByName(const std::string& name) const;
virtual NodeData_ptr getMeshByName(const std::string& name) const;
virtual DataVar_ptr getDataVarByName(const std::string& name) const;
virtual Centering getCenteringForFunctionSpace(int fsCode) const;
virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const;
virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const;
virtual NodeData_ptr getNodes() const { return nodes; }
virtual std::string getSiloPath() const { return siloPath; }
virtual void setSiloPath(const std::string& path) { siloPath = path; }
private:
bool initialized;
RipleyNodes_ptr nodes;
RipleyElements_ptr cells;
RipleyElements_ptr faces;
std::string siloPath;
};
} // namespace weipa
#endif // __WEIPA_RIPLEYDOMAIN_H__
weipa::RipleyDomain::getMeshNames
virtual StringVec getMeshNames() const
Returns the names of all meshes within this domain.
Definition: weipa/src/RipleyDomain.cpp:129
weipa::RipleyNodes_ptr
boost::shared_ptr< RipleyNodes > RipleyNodes_ptr
Definition: RipleyNodes.h:30
weipa::RipleyDomain::setSiloPath
virtual void setSiloPath(const std::string &path)
Sets the silo path to be used when saving to a Silo file.
Definition: weipa/src/RipleyDomain.h:58
weipa::RipleyDomain::getElementsByName
virtual ElementData_ptr getElementsByName(const std::string &name) const
Returns element data with given name.
Definition: weipa/src/RipleyDomain.cpp:192
weipa::RipleyDomain::faces
RipleyElements_ptr faces
Definition: weipa/src/RipleyDomain.h:64
weipa::RipleyDomain::getCenteringForFunctionSpace
virtual Centering getCenteringForFunctionSpace(int fsCode) const
Returns whether data on given function space is node or cell centered.
Definition: weipa/src/RipleyDomain.cpp:76
weipa::RipleyDomain::initFromEscript
virtual bool initFromEscript(const escript::AbstractDomain *domain)
Initialises the domain using an escript domain instance.
Definition: weipa/src/RipleyDomain.cpp:49
weipa::RipleyDomain::reorderGhostZones
virtual void reorderGhostZones(int ownIndex)
Reorders elements so that &#39;ghost&#39; elements (i.e. those that do not belong to ownIndex) appear last...
Definition: weipa/src/RipleyDomain.cpp:215
weipa::RipleyDomain::getVarNames
virtual StringVec getVarNames() const
Returns the names of all &#39;special&#39; domain variables.
Definition: weipa/src/RipleyDomain.cpp:145
weipa::StringVec
std::vector< std::string > StringVec
Definition: weipa.h:60
weipa::RipleyDomain::writeToSilo
virtual bool writeToSilo(DBfile *dbfile, const std::string &pathInSilo, const StringVec &labels, const StringVec &units, bool writeMeshData)
Writes the domain to a Silo file.
Definition: weipa/src/RipleyDomain.cpp:242
weipa
Definition: DataVar.cpp:50
weipa::RipleyDomain::initialized
bool initialized
Definition: weipa/src/RipleyDomain.h:61
weipa::RipleyDomain::initFromFile
virtual bool initFromFile(const std::string &filename)
Reads the domain from a dump file.
Definition: weipa/src/RipleyDomain.cpp:70
weipa::RipleyDomain
Represents a full Ripley domain including nodes and elements.
Definition: weipa/src/RipleyDomain.h:35
weipa::RipleyDomain::getNodes
virtual NodeData_ptr getNodes() const
Returns a pointer to the full nodes.
Definition: weipa/src/RipleyDomain.h:56
weipa::RipleyDomain::RipleyDomain
RipleyDomain()
Definition: weipa/src/RipleyDomain.cpp:35
weipa::DomainChunk
Abstract base class for weipa&#39;s interface to an Escript domain or one chunk thereof if domain decompo...
Definition: DomainChunk.h:45
weipa::RipleyDomain::cells
RipleyElements_ptr cells
Definition: weipa/src/RipleyDomain.h:63
weipa::DataVar_ptr
boost::shared_ptr< DataVar > DataVar_ptr
Definition: weipa.h:64
weipa::RipleyElements_ptr
boost::shared_ptr< RipleyElements > RipleyElements_ptr
Definition: RipleyElements.h:32
weipa::RipleyDomain::nodes
RipleyNodes_ptr nodes
Definition: weipa/src/RipleyDomain.h:62
weipa::RipleyDomain::siloPath
std::string siloPath
Definition: weipa/src/RipleyDomain.h:65
weipa::RipleyDomain::getDataVarByName
virtual DataVar_ptr getDataVarByName(const std::string &name) const
Creates and returns a variable with domain data.
Definition: weipa/src/RipleyDomain.cpp:160
weipa::RipleyDomain::getMeshByName
virtual NodeData_ptr getMeshByName(const std::string &name) const
Returns the node mesh with given name.
Definition: weipa/src/RipleyDomain.cpp:203
weipa::Centering
Centering
Definition: DomainChunk.h:30
weipa::ElementData_ptr
boost::shared_ptr< ElementData > ElementData_ptr
Definition: weipa.h:66
weipa::RipleyDomain::removeGhostZones
virtual void removeGhostZones(int ownIndex)
Removes &#39;ghost&#39; elements and nodes.
Definition: weipa/src/RipleyDomain.cpp:228
escript::AbstractDomain
Base class for all escript domains.
Definition: AbstractDomain.h:45
weipa::RipleyDomain::getMeshForFunctionSpace
virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const
Returns the node mesh for given function space code.
Definition: weipa/src/RipleyDomain.cpp:82
weipa::RipleyDomain::getElementsForFunctionSpace
virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const
Returns the element data for given function space code.
Definition: weipa/src/RipleyDomain.cpp:96
weipa::NodeData_ptr
boost::shared_ptr< NodeData > NodeData_ptr
Definition: weipa.h:68
weipa::RipleyDomain::getSiloPath
virtual std::string getSiloPath() const
Returns the absolute path within Silo file if writeToSilo() or setSiloPath() was called before...
Definition: weipa/src/RipleyDomain.h:57
weipa::RipleyDomain::~RipleyDomain
virtual ~RipleyDomain()
Definition: weipa/src/RipleyDomain.h:40