weipa/src/FinleyDomain.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_FINLEYDOMAIN_H__
#define __WEIPA_FINLEYDOMAIN_H__
#include <weipa/DomainChunk.h>
#include <weipa/FinleyElements.h>
#include <boost/enable_shared_from_this.hpp>
namespace finley {
class Mesh;
}
namespace weipa {
class FinleyDomain : public DomainChunk, public boost::enable_shared_from_this<FinleyDomain>
{
public:
FinleyDomain();
FinleyDomain(const FinleyDomain& m);
virtual ~FinleyDomain();
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:
void cleanup();
bool initialized;
FinleyNodes_ptr nodes;
FinleyElements_ptr cells;
FinleyElements_ptr faces;
FinleyElements_ptr contacts;
std::string siloPath;
};
} // namespace weipa
#endif // __WEIPA_FINLEYDOMAIN_H__
weipa::FinleyDomain::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/FinleyDomain.cpp:507
weipa::FinleyDomain::~FinleyDomain
virtual ~FinleyDomain()
Definition: weipa/src/FinleyDomain.cpp:79
weipa::FinleyDomain::removeGhostZones
virtual void removeGhostZones(int ownIndex)
Removes 'ghost' elements and nodes.
Definition: weipa/src/FinleyDomain.cpp:488
weipa::FinleyDomain::getElementsForFunctionSpace
virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const
Returns the element data for given function space code.
Definition: weipa/src/FinleyDomain.cpp:253
weipa::FinleyDomain::faces
FinleyElements_ptr faces
Definition: weipa/src/FinleyDomain.h:73
weipa::FinleyDomain::getMeshNames
virtual StringVec getMeshNames() const
Returns the names of all meshes within this domain.
Definition: weipa/src/FinleyDomain.cpp:334
weipa::FinleyDomain::nodes
FinleyNodes_ptr nodes
Definition: weipa/src/FinleyDomain.h:71
weipa::FinleyDomain::getDataVarByName
virtual DataVar_ptr getDataVarByName(const std::string &name) const
Creates and returns a variable with domain data.
Definition: weipa/src/FinleyDomain.cpp:372
weipa::FinleyDomain::reorderGhostZones
virtual void reorderGhostZones(int ownIndex)
Reorders elements so that 'ghost' elements (i.e. those that do not belong to ownIndex) appear last.
Definition: weipa/src/FinleyDomain.cpp:470
weipa::DataVar_ptr
boost::shared_ptr< DataVar > DataVar_ptr
Definition: weipa.h:65
weipa
Definition: DataVar.cpp:51
weipa::FinleyDomain::siloPath
std::string siloPath
Definition: weipa/src/FinleyDomain.h:75
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::FinleyDomain::contacts
FinleyElements_ptr contacts
Definition: weipa/src/FinleyDomain.h:74
weipa::FinleyElements_ptr
boost::shared_ptr< FinleyElements > FinleyElements_ptr
Definition: FinleyElements.h:64
weipa::FinleyDomain::initFromFile
virtual bool initFromFile(const std::string &filename)
Reads the domain from a dump file.
Definition: weipa/src/FinleyDomain.cpp:184
weipa::FinleyDomain::cells
FinleyElements_ptr cells
Definition: weipa/src/FinleyDomain.h:72
weipa::ElementData_ptr
boost::shared_ptr< ElementData > ElementData_ptr
Definition: weipa.h:67
weipa::FinleyDomain::FinleyDomain
FinleyDomain()
Definition: weipa/src/FinleyDomain.cpp:58
weipa::FinleyDomain::cleanup
void cleanup()
Definition: weipa/src/FinleyDomain.cpp:87
weipa::FinleyDomain::getElementsByName
virtual ElementData_ptr getElementsByName(const std::string &name) const
Returns element data with given name.
Definition: weipa/src/FinleyDomain.cpp:433
weipa::FinleyDomain::setSiloPath
virtual void setSiloPath(const std::string &path)
Sets the silo path to be used when saving to a Silo file.
Definition: weipa/src/FinleyDomain.h:65
weipa::FinleyDomain::initialized
bool initialized
Definition: weipa/src/FinleyDomain.h:70
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::FinleyDomain::getVarNames
virtual StringVec getVarNames() const
Returns the names of all 'special' domain variables.
Definition: weipa/src/FinleyDomain.cpp:352
weipa::FinleyDomain::getNodes
virtual NodeData_ptr getNodes() const
Returns a pointer to the full nodes.
Definition: weipa/src/FinleyDomain.h:63
escript::AbstractDomain
Base class for all escript domains.
Definition: AbstractDomain.h:64
weipa::FinleyDomain::getMeshByName
virtual NodeData_ptr getMeshByName(const std::string &name) const
Returns the node mesh with given name.
Definition: weipa/src/FinleyDomain.cpp:455
weipa::FinleyNodes_ptr
boost::shared_ptr< FinleyNodes > FinleyNodes_ptr
Definition: FinleyNodes.h:43
weipa::FinleyDomain::getMeshForFunctionSpace
virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const
Returns the node mesh for given function space code.
Definition: weipa/src/FinleyDomain.cpp:236
weipa::Centering
Centering
Definition: DomainChunk.h:31
finley
A suite of factory methods for creating various finley domains.
Definition: finley/src/Assemble.h:32
weipa::FinleyDomain::initFromEscript
virtual bool initFromEscript(const escript::AbstractDomain *domain)
Initialises the domain using an escript domain instance.
Definition: weipa/src/FinleyDomain.cpp:99
weipa::FinleyDomain::getSiloPath
virtual std::string getSiloPath() const
Returns the absolute path within Silo file if writeToSilo() or setSiloPath() was called before,...
Definition: weipa/src/FinleyDomain.h:64
weipa::FinleyDomain::getCenteringForFunctionSpace
virtual Centering getCenteringForFunctionSpace(int fsCode) const
Returns whether data on given function space is node or cell centered.
Definition: weipa/src/FinleyDomain.cpp:219
weipa::FinleyDomain
Represents a full Finley or Dudley domain including nodes and elements.
Definition: weipa/src/FinleyDomain.h:42