GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
gmNfFileReader.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_NF_FILE_READER_H_
25#define _GEMA_NF_FILE_READER_H_
26
27#include "gmFileReader.h"
28#include "gmNfFileFormat.h"
29
30#include "gmValueInfo.h"
31
32class GmValueAccessor;
33class GmGaussAccessor;
34
35struct NfrImport;
36struct NfrFile;
37
38
41{
42public:
43 GmNfFileReader(const GmLogCategory& logger);
44
45 virtual ~GmNfFileReader();
46
47 virtual bool openFiles(QString fileName, int numNodeValues, int numElemValues);
48 virtual bool initializeMesh(GmMesh* mesh, const QStringList& nodeValues, const QList<Unit>& nodeUnits,
49 const QStringList& elementValues, const QList<Unit>& elementUnits);
50 virtual bool readNodeCoordinates(GmMesh* mesh, Unit coordUnit);
51 virtual bool readCellGeometry(GmCellMesh* cellmesh);
52 virtual bool readNodeData(GmMesh* mesh, const QStringList& nodeValues, const QList<Unit>& nodeUnits);
53 virtual bool readCellData(GmCellMesh* cellmesh, const QStringList& elementValues, const QList<Unit>& elementUnits);
54 virtual bool closeFiles();
55
56 virtual GmFileFormat* fileFormat() { return this; }
57
58private:
59 void updateNfStepIds();
60 void updateNfValueIds();
61 void updateNfElementIds(GmCellMesh* cellmesh);
62 void buildGemaMatrix(double* val, GmVector& vec);
63 void buildFielIdsMap(NfrResultType resType, int stepId, QMap<QString, int>& fieldIdsMap);
64
65 int nlin(GmDimType t, int ndim) const { return (t == GM_SCALAR_VALUE ? 1 : ndim); }
66 int ncol(GmDimType t, int ndim) const { return (t != GM_MATRIX_VALUE ? 1 : ndim); }
67
70 int _ndim;
72 bool _dataOnly;
73
74 NfrImport* _imp;
75 NfrFile* _nf;
76 QMap< NfrResultType, QStringList > _nfValuesMap; // Enable value in neutral file
77
78 int _caseId;
79 int _nSteps;
80 QVector<int> _stepIds;
81
84};
85
86#endif
Base interface class for CellMesh type plugins.
Definition gmCellMesh.h:40
Basic interface for describing high level file format capabilities.
Definition gmFileFormat.h:35
Basic interface for file deserializers.
Definition gmFileReader.h:41
The GmGaussAccessor class is a proxy object to a value accessor implementing a more convenient interf...
Definition gmGaussAccessor.h:39
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Base interface class for Mesh type plugins.
Definition gmMesh.h:48
File format specifications for the "Neutral File" file format.
Definition gmNfFileFormat.h:34
A file deserializer for reading data in the "Neutral File" file format.
Definition gmNfFileReader.h:41
virtual bool readNodeCoordinates(GmMesh *mesh, Unit coordUnit)
See comments on the base class.
Definition gmNfFileReader.cpp:349
virtual bool closeFiles()
See comments on the base class.
Definition gmNfFileReader.cpp:707
int _ndim
Input mesh dimension.
Definition gmNfFileReader.h:70
virtual bool readCellData(GmCellMesh *cellmesh, const QStringList &elementValues, const QList< Unit > &elementUnits)
See comments on the base class.
Definition gmNfFileReader.cpp:557
bool _dataOnly
True, if the GeMA mesh to fill already has nodes and cells.
Definition gmNfFileReader.h:72
QVector< int > _elementIds
Correspondence table between nfr and gema element ids.
Definition gmNfFileReader.h:69
QString _nfFileName
The neutral file name.
Definition gmNfFileReader.h:68
void updateNfStepIds()
Obtain step ids from NF file.
Definition gmNfFileReader.cpp:724
virtual bool initializeMesh(GmMesh *mesh, const QStringList &nodeValues, const QList< Unit > &nodeUnits, const QStringList &elementValues, const QList< Unit > &elementUnits)
See comments on the base class.
Definition gmNfFileReader.cpp:98
virtual ~GmNfFileReader()
Destructor.
Definition gmNfFileReader.cpp:45
void updateNfValueIds()
Obtain value ids from NF file.
Definition gmNfFileReader.cpp:741
virtual GmFileFormat * fileFormat()
Returns the file format of the deserializer.
Definition gmNfFileReader.h:56
virtual bool openFiles(QString fileName, int numNodeValues, int numElemValues)
See comments on the base class.
Definition gmNfFileReader.cpp:57
virtual bool readCellGeometry(GmCellMesh *cellmesh)
See comments on the base class.
Definition gmNfFileReader.cpp:386
GmNfFileReader(const GmLogCategory &logger)
Default constructor.
Definition gmNfFileReader.cpp:37
int _ruleSet
Input mesh rule set.
Definition gmNfFileReader.h:71
void updateNfElementIds(GmCellMesh *cellmesh)
Fill correspondence table between nfr and gema element ids.
Definition gmNfFileReader.cpp:765
void buildGemaMatrix(double *val, GmVector &vec)
Transform symetrical NF tensor [6 (3D) values] to Gema matrix [9 (3D) or 4 (2D) values].
Definition gmNfFileReader.cpp:801
virtual bool readNodeData(GmMesh *mesh, const QStringList &nodeValues, const QList< Unit > &nodeUnits)
See comments on the base class.
Definition gmNfFileReader.cpp:431
Interface class for accessing and setting values from an "indexable" collection of values.
Definition gmValueAccessor.h:60
Declaration of the GmFileReader class (old GmFileDataDeserializer class)
Declaration of the GmNfFileFormat class (old GmNeutralFileData class)
Declaration of the GmValueInfo class.
GmDimType
Value dimension type.
Definition gmValueInfo.h:72
@ GM_SCALAR_VALUE
Means that the value is a scalar number.
Definition gmValueInfo.h:73
@ GM_MATRIX_VALUE
Means that the value is a 2D matrix of numbers.
Definition gmValueInfo.h:75
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34