MmProcess
The GeMA Mesh Mapping Process Plugin
Loading...
Searching...
No Matches
gmpMmMeshMapping.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2015 by Erwan Yann Renaut
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_MM_MESHMAPPING_H_
25#define _GEMA_PLUGIN_MM_MESHMAPPING_H_
26
27#include <gmLog.h>
28#include <gmElement.h>
29#include <gmElementMesh.h>
30
31#include "gmpMmProcessConfig.h"
32
34class GmMesh;
35class GmSpatialIndex;
36class GmValueAccessor;
37class GmGaussAccessor;
38class GmCRVector;
40
44class GmInterpolator;
46
49class GMP_MM_PROCESS_API_EXPORT GmpMmMeshMapping
50{
51public:
52 GmpMmMeshMapping(GmSimulationData* simData, GmMesh* dstMesh, GmSpatialIndex* spatialIndex,
53 const GmDiscontinuitySet* ds, const QStringList& nodeValues, const QStringList& gaussValues,
54 const QVector<bool>& dstGauss, const QMap<QString, QString>& dstTranslationMap,
55 const GmLogCategory& logger, const QVariantMap& options = QVariantMap());
56
57 virtual ~GmpMmMeshMapping();
58
59 bool generate();
60
61protected:
62 void getNoDataValues(QVector<GmVector>& values, int dataSize);
63 void getNodeValues(int srcNodeId, QString valueId, QVector<GmVector>& values);
64 void getOutOfMeshValues(const GmVector& crd, QString valueId, QVector<GmVector>& values);
65
66 GmElementMesh* _srcElementMesh;
67 GmValueAccessor* _srcCrdAcc;
68
69 GmSpatialIndex* _spatialIndex;
70
71 const GmDiscontinuitySet* _ds;
72
73 int _nstates;
74
75 GmInterpolatorType _interpType;
76 QVariant _interpParam;
77
80
81private:
82 void setDstGaussValues();
83 void setDstNodesValues();
84
86 virtual bool acceptSrcGaussValues() const = 0;
87
88 virtual bool checkConsistency();
89 virtual void insertSrcNodeInterp(QString valueId, QVector<const GmValueAccessor*> nodeAccList) {}
90 virtual void insertSrcGaussInterp(QString valueId, QVector<const GmGaussAccessor*> gaussAccList) {}
91 virtual void getValuesFromBI(const GmVector& crd, QString valueId, QVector<GmVector>& values);
92
93 QStringList _srcNodeValues;
94 QStringList _srcGaussValues;
95 QStringList _dstNodeValues;
96 QStringList _dstGaussValues;
97
98 GmSimulationData* _simData;
99 GmMesh* _srcMesh;
100 GmMesh* _dstMesh;
101 GmElementMesh* _dstElementMesh;
102 GmValueAccessor* _dstCrdAcc;
103
106 QMap<QString, QString> _dstTranslationMap;
107
108 bool _noDataMode;
109 double _noDataValue;
110 double _noDataEps;
111 double _tol;
112
113 int _state;
114 bool _activeOnly;
115 bool _info;
116
117 int _nworkers;
118 int _ntasks;
119
121};
122
125class GMP_MM_PROCESS_API_EXPORT GmpMmNodeMeshMapping : public GmpMmMeshMapping
126{
127public:
128 GmpMmNodeMeshMapping(GmSimulationData* simData, GmMesh* dstMesh, GmSpatialIndex* spatialIndex,
129 const GmDiscontinuitySet* ds, const QStringList& nodeValues, const QStringList& gaussValues,
130 const QVector<bool>& dstGauss, const QMap<QString, QString>& dstTranslationMap,
131 const GmLogCategory& logger, const QVariantMap& options = QVariantMap());
132
133 virtual ~GmpMmNodeMeshMapping() {}
134
135private:
136 virtual bool acceptSrcGaussValues() const { return false; }
137};
138
141class GMP_MM_PROCESS_API_EXPORT GmpMmCellMeshMapping : public GmpMmMeshMapping
142{
143public:
144 GmpMmCellMeshMapping(GmSimulationData* simData, GmMesh* dstMesh, GmSpatialIndex* spatialIndex,
145 const GmDiscontinuitySet* ds, const QStringList& nodeValues, const QStringList& gaussValues,
146 const QVector<bool>& dstGauss, const QMap<QString, QString>& dstTranslationMap,
147 const GmLogCategory& logger, const QVariantMap& options = QVariantMap());
148
149 virtual ~GmpMmCellMeshMapping();
150
151private:
152 virtual bool acceptSrcGaussValues() const { return false; }
153
154 virtual void insertSrcNodeInterp(QString valueId, QVector<const GmValueAccessor*> nodeAccList);
155 virtual void getValuesFromBI(const GmVector& crd, QString valueId, QVector<GmVector>& values);
156
157 void getCellInterpolValues(const GmVector& crd, const GmCell* srcCell, QString valueId, QVector<GmVector>& values);
158
160};
161
164class GMP_MM_PROCESS_API_EXPORT GmpMmElementMeshMapping : public GmpMmMeshMapping
165{
166public:
167 GmpMmElementMeshMapping(GmSimulationData* simData, GmMesh* dstMesh, GmSpatialIndex* spatialIndex,
168 const GmDiscontinuitySet* ds, const QStringList& nodeValues, const QStringList& gaussValues,
169 const QVector<bool>& dstGauss, const QMap<QString, QString>& dstTranslationMap,
170 const GmLogCategory& logger, const QVariantMap& options = QVariantMap());
171
172 virtual ~GmpMmElementMeshMapping();
173
174private:
175 virtual bool acceptSrcGaussValues() const { return true; }
176
177 virtual void insertSrcNodeInterp(QString valueId, QVector<const GmValueAccessor*> nodeAccList);
178 virtual void insertSrcGaussInterp(QString valueId, QVector<const GmGaussAccessor*> gaussAccList);
179 virtual void getValuesFromBI(const GmVector& crd, QString valueId, QVector<GmVector>& values);
180
181 void getElementInterpolValues(const GmVector& crd, const GmElement* srcElement, QString valueId, QVector<GmVector>& values);
182
185};
186
187#endif // _GEMA_PLUGIN_MM_MESHMAPPING_H_
Class GmpMmCellMeshMapping.
Definition gmpMmMeshMapping.h:142
virtual bool acceptSrcGaussValues() const
Returns true if the mapping accepts to transfer gauss values in the source meshe.
Definition gmpMmMeshMapping.h:152
Class GmpMmElementMeshMapping.
Definition gmpMmMeshMapping.h:165
virtual bool acceptSrcGaussValues() const
Returns true if the mapping accepts to transfer gauss values in the source meshe.
Definition gmpMmMeshMapping.h:175
Class GmpMmMeshMapping.
Definition gmpMmMeshMapping.h:50
const GmLogCategory & _logger
The logger object used to report errors.
Definition gmpMmMeshMapping.h:120
virtual bool acceptSrcGaussValues() const =0
Returns true if the mapping accepts to transfer gauss values in the source meshe.
Class GmpMmNodeMeshMapping.
Definition gmpMmMeshMapping.h:126
virtual bool acceptSrcGaussValues() const
Returns true if the mapping accepts to transfer gauss values in the source meshe.
Definition gmpMmMeshMapping.h:136
GmInterpolatorType
arma::vec GmVector
Declaration of useful configuration definitions for the plugin library.