GemaMesh
The GeMA Mesh Plugin
Loading...
Searching...
No Matches
gmpNodeMeshData.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_NODE_MESH_DATA_H_
25#define _GEMA_PLUGIN_NODE_MESH_DATA_H_
26
27#include "gmpGemaMeshConfig.h"
28
29class GmMesh;
30class GmNodeSet;
31class GmPCR;
32
33class GmValueInfo;
34class GmValueAccessor;
35class GmLogCategory;
36class UnitConverter;
37
38template <template <class> class> class GmpNodeDataDump;
39
51template <template <class> class Vector>
52class GMP_GEMAMESH_API_EXPORT GmpNodeMeshData
53{
54public:
56 template <typename U> using VectorType = Vector<U>;
57
60
61 double* coordBuffer() const { return _coordinates.numDumpBuffers() == 1 ? (double*)_coordinates.dumpBuffer(0) : NULL; }
62 double* ghostBuffer() const { return _ghostCoordinates.numDumpBuffers() == 1 ? (double*)_ghostCoordinates.dumpBuffer(0) : NULL; }
63
64 GmValueAccessor* coordAc(const GmLogCategory& logger, UnitConverter* conv, QString desiredUnit);
65 GmValueAccessor* ghostAc(const GmLogCategory& logger, UnitConverter* conv, QString desiredUnit);
66
67 int addNodes(GmMesh* mesh, bool ghost, int numAddedNodes, bool updateValueSets, GmPCR* pcr);
68
69 bool reorderCoordinates(GmPCR* pcr, bool ghost, const QMap<int, int>& partOrigToLocOrder);
70
71 void clear(GmMesh* mesh);
72 void releaseMemory();
73
74 size_t nodeMemory() const { return _coordinates.usedMemory() + _ghostCoordinates.usedMemory(); }
75 size_t nodeSetsMemory() const;
76
77 void releaseMeshNodes();
78 void releaseGhostNodes();
79
80public:
83 Vector<double> _coordinates;
84
87 Vector<double> _ghostCoordinates;
88
93
95};
96
97#endif
98
A helper class to implement state dump operations for a GmpNodeMeshData<Vector> object.
Definition gmpNodeDataDump.h:40
Auxiliar interface used to share node data between the mesh implementation and GmpMeshLoader....
Definition gmpNodeMeshData.h:53
QMap< QString, GmNodeSet * > _nodeSets
Ghost coordinate vector. Size = _coordInfo->size() * _numGhostNodes. Values stored by node.
Definition gmpNodeMeshData.h:92
bool _ghostEnabled
Are ghost nodes enabled for this mesh?
Definition gmpNodeMeshData.h:85
Vector< U > VectorType
A type identifying which vector type we are using.
Definition gmpNodeMeshData.h:56
int _numGhostNodes
The number of mesh ghost nodes.
Definition gmpNodeMeshData.h:86
GmValueInfo * _coordInfo
Information about node coordinates.
Definition gmpNodeMeshData.h:81
Vector< double > _coordinates
Coordinate vector. Size = _coordInfo->size() * _numNodes. Values stored by node.
Definition gmpNodeMeshData.h:83
GmpNodeDataDump< Vector > * _dumper
The object responsible for state dump operations.
Definition gmpNodeMeshData.h:94
int _numNodes
Number of nodes in the mesh.
Definition gmpNodeMeshData.h:82
Declaration of useful configuration definitions for the plugin library.