RegularGridMesh
The GeMA Regular Grid Mesh Plugin
Loading...
Searching...
No Matches
gmpRegularGridMesh.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_PLUGIN_REGULAR_GRID_MESH_H_
25#define _GEMA_PLUGIN_REGULAR_GRID_MESH_H_
26
27#include <gmRegularGridMesh.h>
28#include <gmLuaMesh.h>
29
31
32
35class GMP_REGULARGRIDMESH_API_EXPORT GmpRegularGridMesh: public GmRegularGridMesh
36{
37public:
38 GmpRegularGridMesh(GmSimulationData* simulation, QString id, QString description, const GmLogCategory& logger);
39 virtual ~GmpRegularGridMesh();
40
41 // Comments on the base class
42 virtual const char* pluginName() const { return "RegularGridMesh"; }
43
44 // Comments on the base class
45 virtual const char* pluginType() const { return "grid"; }
46
47 virtual bool loadPrivateData(LuaTable& table);
48
49 // Comments on the base class
50 virtual bool hasCapability(QString capabilityName) const { return false; }
51
52 // Comments on the base class
53 virtual bool useDualVectors() const { return false; }
54
55 // Comments on the base class
56 virtual void pushProxy(lua_State* L, const GmLogCategory& logger) { LuaProxy::pushObject(L, new GmLuaRegularGridMesh(this, logger)); }
57
58 // Comments on the base class
59 virtual GmValueInfo* nodeCoordInfo() const { return _coordInfo; }
60
61 // Comments on the base class
62 virtual GmValueAccessor* nodeCoordAccessor(Unit desiredUnit, const GmLogCategory& logger) const;
63
64 // See comments on the base interface class
65 virtual int numNodes() const { return _nnodes; }
66
67 // See comments on the base interface class
68 virtual double nodeSpacing(int dim) const { assert(dim >= 0 && dim < _ndim); return _spacing[dim]; }
69
70 // See comments on the base interface class
71 virtual int nodeCount(int dim) const { assert(dim >= 0 && dim < _ndim); return _count[dim]; }
72
73 // See comments on the base interface class
74 virtual bool nodeWrap(int dim) const { assert(dim >= 0 && dim < _ndim); return _wrap[dim]; }
75
76 virtual int nodeFromIndex(int x, int y = -1, int z = -1) const;
77
78 virtual void indexFromNode(int node, int* x, int* y = NULL, int* z = NULL) const;
79
80 virtual int neighbor(int node, int xoffset, int yoffset = 0, int zoffset = 0) const;
81
82 // Comments on the base class
83 virtual const QMap<QString, GmNodeSet*>& nodeSets() const { return _nodeSets; }
84
85 virtual void printParameters(const GmLogCategory& logger);
86
87 // See comments on the base interface class
88 virtual size_t nodeMemory() const { return 0.0; } // No storage is needed per node
89
90 virtual size_t nodeSetsMemory() const;
91
93 virtual GmPCR* pcrObject() const { return _pcr; }
94
95private:
97
98 int _ndim;
99 int _nnodes;
106
111};
112
113
114#endif
115
virtual int numNodes() const=0
virtual void printParameters(const GmLogCategory &logger)
virtual GmValueInfo * nodeCoordInfo() const=0
virtual size_t nodeMemory() const=0
virtual void pushProxy(lua_State *L, const GmLogCategory &logger)=0
virtual bool useDualVectors() const=0
virtual bool hasCapability(QString capabilityName) const=0
virtual size_t nodeSetsMemory() const=0
virtual GmValueAccessor * nodeCoordAccessor(Unit desiredUnit, const GmLogCategory &logger) const=0
virtual const QMap< QString, GmNodeSet * > & nodeSets() const=0
virtual const char * pluginType() const=0
virtual bool loadPrivateData(LuaTable &table)=0
virtual const char * pluginName() const=0
virtual void indexFromNode(int node, int *x, int *y=NULL, int *z=NULL) const=0
virtual int nodeFromIndex(int x, int y=-1, int z=-1) const=0
virtual double nodeSpacing(int dim) const=0
virtual bool nodeWrap(int dim) const=0
virtual int neighbor(int node, int xoffset, int yoffset=0, int zoffset=0) const=0
virtual int nodeCount(int dim) const=0
Auxiliary class implementing an accessor for mesh coordinate values.
Definition gmpRegularGridMeshCoordAccessor.h:36
Simple class implementing the GmRegularGridMesh interface.
Definition gmpRegularGridMesh.h:36
GmValueInfo * _coordInfo
Info object for coordinates.
Definition gmpRegularGridMesh.h:100
QVector< int > _count
Node count in each dimension.
Definition gmpRegularGridMesh.h:103
GmVector _origin
Vector with coordinates of the first mesh node.
Definition gmpRegularGridMesh.h:101
GmPCR * _pcr
The associated default PCR object.
Definition gmpRegularGridMesh.h:105
QVector< bool > _wrap
Does the mesh wraps (last node connected to first) in each dimension?
Definition gmpRegularGridMesh.h:104
QMap< QString, GmNodeSet * > _nodeSets
A map with the definition of each node set associated with the mesh. Map entries are instances of the...
Definition gmpRegularGridMesh.h:110
int _ndim
The mesh dimension.
Definition gmpRegularGridMesh.h:98
GmVector _spacing
Spacing between grid nodes in each dimension.
Definition gmpRegularGridMesh.h:102
virtual GmPCR * pcrObject() const
Returns a default empty PCR object.
Definition gmpRegularGridMesh.h:93
int _nnodes
The total number of nodes in the grid (equal to _count[0] * ... * _count[_ndim-1])
Definition gmpRegularGridMesh.h:99
arma::vec GmVector
Declaration of useful configuration definitions for the plugin library.