RipleyNodes.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_RIPLEYNODES_H__
#define __WEIPA_RIPLEYNODES_H__
#include <weipa/NodeData.h>
class DBfile;
namespace ripley {
class RipleyDomain;
}
namespace weipa {
class RipleyNodes;
typedef boost::shared_ptr<RipleyNodes> RipleyNodes_ptr;
class RipleyNodes : public NodeData
{
public:
RipleyNodes(const std::string& meshName);
RipleyNodes(RipleyNodes_ptr fullNodes, IntVec& requiredNodes,
const std::string& meshName);
RipleyNodes(const RipleyNodes& m);
virtual ~RipleyNodes();
bool initFromRipley(const ripley::RipleyDomain* ripleyDomain);
bool writeToSilo(DBfile* dbfile);
virtual void writeCoordinatesVTK(std::ostream& os, int ownIndex);
void setSiloPath(const std::string& path) { siloPath = path; }
const IntVec& getVarDataByName(const std::string& name) const;
virtual StringVec getVarNames() const;
virtual std::string getName() const { return name; }
std::string getFullSiloName() const;
virtual const IntVec& getNodeIDs() const { return nodeID; }
virtual const IntVec& getNodeDistribution() const { return nodeDist; }
virtual const IntVec& getGlobalNodeIndices() const { return nodeID; }
virtual const CoordArray& getCoords() const { return coords; }
virtual int getNumDims() const { return numDims; }
virtual int getNumNodes() const { return numNodes; }
virtual int getGlobalNumNodes() const { return globalNumNodes; }
protected:
CoordArray coords;
int numDims;
int numNodes;
int globalNumNodes;
IntVec nodeID;
IntVec nodeTag;
IntVec nodeDist;
std::string name;
std::string siloPath;
};
inline std::string RipleyNodes::getFullSiloName() const
{
std::string result(siloPath);
if (result.length() == 0 || *result.rbegin() != '/')
result += '/';
result += name;
return result;
}
} // namespace weipa
#endif // __WEIPA_RIPLEYNODES_H__
ripley::RipleyDomain
RipleyDomain extends the AbstractContinuousDomain interface for the Ripley library and is the base cl...
Definition: ripley/src/RipleyDomain.h:103
weipa::NodeData
Definition: NodeData.h:28
weipa::RipleyNodes
Stores and manipulates ripley mesh nodes.
Definition: RipleyNodes.h:40
weipa::RipleyNodes::getVarNames
virtual StringVec getVarNames() const
Returns a vector with the mesh variable names.
Definition: RipleyNodes.cpp:194
weipa::RipleyNodes::getNodeIDs
virtual const IntVec & getNodeIDs() const
Returns the node ID array.
Definition: RipleyNodes.h:81
weipa::RipleyNodes::getFullSiloName
std::string getFullSiloName() const
Returns full Silo mesh name, e.g. "/block0000/Nodes".
Definition: RipleyNodes.h:114
weipa::RipleyNodes::coords
CoordArray coords
Definition: RipleyNodes.h:102
weipa::RipleyNodes::nodeTag
IntVec nodeTag
node IDs
Definition: RipleyNodes.h:107
weipa::RipleyNodes::writeCoordinatesVTK
virtual void writeCoordinatesVTK(std::ostream &os, int ownIndex)
Writes coordinates to a stream in VTK text format.
Definition: RipleyNodes.cpp:205
weipa::RipleyNodes::nodeDist
IntVec nodeDist
node tags
Definition: RipleyNodes.h:108
weipa::RipleyNodes::writeToSilo
bool writeToSilo(DBfile *dbfile)
Writes node data to a Silo file.
Definition: RipleyNodes.cpp:226
weipa::RipleyNodes::globalNumNodes
int globalNumNodes
number of nodes
Definition: RipleyNodes.h:105
weipa::RipleyNodes::setSiloPath
void setSiloPath(const std::string &path)
Sets the silo path to be used when saving.
Definition: RipleyNodes.h:64
weipa::RipleyNodes::name
std::string name
node distribution
Definition: RipleyNodes.h:109
weipa::RipleyNodes::RipleyNodes
RipleyNodes(const std::string &meshName)
Constructor with mesh name.
Definition: RipleyNodes.cpp:39
weipa::RipleyNodes::~RipleyNodes
virtual ~RipleyNodes()
Virtual destructor.
Definition: RipleyNodes.cpp:110
weipa::RipleyNodes::numNodes
int numNodes
dimensionality (2 or 3)
Definition: RipleyNodes.h:104
weipa::RipleyNodes::initFromRipley
bool initFromRipley(const ripley::RipleyDomain *ripleyDomain)
Initialises with ripley domain.
Definition: RipleyNodes.cpp:120
weipa::RipleyNodes::getGlobalNumNodes
virtual int getGlobalNumNodes() const
Returns the total number of mesh nodes for a distributed mesh.
Definition: RipleyNodes.h:99
weipa::RipleyNodes::getNumDims
virtual int getNumDims() const
Returns the dimensionality of this mesh (2 or 3).
Definition: RipleyNodes.h:93
weipa::RipleyNodes::getGlobalNodeIndices
virtual const IntVec & getGlobalNodeIndices() const
Returns the global node index array.
Definition: RipleyNodes.h:87
weipa::RipleyNodes::getVarDataByName
const IntVec & getVarDataByName(const std::string &name) const
Returns an array of nodal data by the given name.
Definition: RipleyNodes.cpp:181
weipa::RipleyNodes::siloPath
std::string siloPath
the name of this node mesh
Definition: RipleyNodes.h:110
weipa::RipleyNodes::getNumNodes
virtual int getNumNodes() const
Returns the number of mesh nodes.
Definition: RipleyNodes.h:96
weipa::RipleyNodes::getName
virtual std::string getName() const
Returns the name of this node mesh.
Definition: RipleyNodes.h:75
weipa::RipleyNodes::numDims
int numDims
x, y[, z] coordinates of nodes
Definition: RipleyNodes.h:103
weipa::RipleyNodes::getCoords
virtual const CoordArray & getCoords() const
Returns the coordinates of the mesh nodes.
Definition: RipleyNodes.h:90
weipa::RipleyNodes::nodeID
IntVec nodeID
global number of nodes
Definition: RipleyNodes.h:106
weipa::RipleyNodes::getNodeDistribution
virtual const IntVec & getNodeDistribution() const
Returns the node distribution array.
Definition: RipleyNodes.h:84
ripley
Definition: ripley/src/AbstractAssembler.h:26
weipa
Definition: DataVar.cpp:51
weipa::StringVec
std::vector< std::string > StringVec
Definition: weipa.h:61
weipa::IntVec
std::vector< int > IntVec
Definition: weipa.h:60
weipa::CoordArray
std::vector< float * > CoordArray
Definition: weipa.h:62
weipa::RipleyNodes_ptr
boost::shared_ptr< RipleyNodes > RipleyNodes_ptr
Definition: RipleyNodes.h:31