escript  Revision_
NodeData.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17 
18 #ifndef __WEIPA_NODEDATA_H__
19 #define __WEIPA_NODEDATA_H__
20 
21 #include <weipa/weipa.h>
22 #include <ostream>
23 
24 namespace weipa {
25 
27 class NodeData
28 {
29 public:
31  virtual void writeCoordinatesVTK(std::ostream& os, int ownIndex) = 0;
32 
34  virtual StringVec getVarNames() const = 0;
35 
37  virtual std::string getName() const = 0;
38 
40  virtual std::string getFullSiloName() const = 0;
41 
43  virtual const IntVec& getNodeIDs() const = 0;
44 
46  virtual const IntVec& getNodeDistribution() const = 0;
47 
49  virtual const IntVec& getGlobalNodeIndices() const = 0;
50 
52  virtual const CoordArray& getCoords() const = 0;
53 
55  virtual int getNumDims() const = 0;
56 
58  virtual int getNumNodes() const = 0;
59 
61  virtual int getGlobalNumNodes() const = 0;
62 
63 protected:
65  virtual ~NodeData() {}
66 };
67 
68 } // namespace weipa
69 
70 #endif // __WEIPA_NODEDATA_H__
71 
weipa::NodeData::getCoords
virtual const CoordArray & getCoords() const =0
Returns the coordinates of the mesh nodes.
paso::util::lsup
double lsup(dim_t n, const double *x, escript::JMPI mpiinfo)
returns the global Lsup of x
Definition: PasoUtil.cpp:495
paso::InputError
@ InputError
Definition: Paso.h:74
weipa
Definition: DataVar.cpp:51
Options.h
weipa::NodeData::getNodeIDs
virtual const IntVec & getNodeIDs() const =0
Returns the node ID array.
paso::Solver_GMRES2
SolverResult Solver_GMRES2(Function *F, const double *f0, const double *x0, double *dx, dim_t *iter, double *tolerance, Performance *pp)
Definition: GMRES2.cpp:39
weipa::NodeData::getNumNodes
virtual int getNumNodes() const =0
Returns the number of mesh nodes.
weipa::NodeData::getNodeDistribution
virtual const IntVec & getNodeDistribution() const =0
Returns the node distribution array.
Solver.h
paso::Breakdown
@ Breakdown
Definition: Paso.h:76
Paso.h
paso::util::update
void update(dim_t n, double a, double *x, double b, const double *y)
Definition: PasoUtil.cpp:368
paso::util::l2
double l2(dim_t n, const double *x, escript::JMPI mpiinfo)
returns the global L2 norm of x
Definition: PasoUtil.cpp:530
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:93
weipa::CoordArray
std::vector< float * > CoordArray
Definition: weipa.h:62
weipa::NodeData::getFullSiloName
virtual std::string getFullSiloName() const =0
Returns full Silo mesh name, e.g. "/block0000/Nodes".
weipa::NodeData::getGlobalNodeIndices
virtual const IntVec & getGlobalNodeIndices() const =0
Returns the global node index array.
paso::SolverResult
SolverResult
Definition: Paso.h:57
paso::MaxIterReached
@ MaxIterReached
Definition: Paso.h:73
weipa::NodeData::getName
virtual std::string getName() const =0
Returns the name of this node mesh.
weipa::NodeData::~NodeData
virtual ~NodeData()
Virtual destructor.
Definition: NodeData.h:93
PasoUtil.h
weipa::StringVec
std::vector< std::string > StringVec
Definition: weipa.h:61
weipa::NodeData::writeCoordinatesVTK
virtual void writeCoordinatesVTK(std::ostream &os, int ownIndex)=0
Writes coordinates to a stream in VTK text format.
paso::Solver_NewtonGMRES
SolverResult Solver_NewtonGMRES(Function *F, double *x, Options *options, Performance *pp)
Definition: NewtonGMRES.cpp:58
weipa::NodeData::getGlobalNumNodes
virtual int getGlobalNumNodes() const =0
Returns the total number of mesh nodes for a distributed mesh.
paso
Definition: BiCGStab.cpp:26
weipa::IntVec
std::vector< int > IntVec
Definition: weipa.h:60
paso::NoError
@ NoError
Definition: Paso.h:72
weipa::NodeData::getNumDims
virtual int getNumDims() const =0
Returns the dimensionality of this mesh (2 or 3).
weipa::NodeData::getVarNames
virtual StringVec getVarNames() const =0
Returns a vector with the mesh variable names.