GemaCoreLib
The GeMA Core library
gmFileExtraNodes.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_FILE_EXTRA_NODES_H_
25 #define _GEMA_FILE_EXTRA_NODES_H_
26 
27 #include <QVector>
28 #include <assert.h>
29 
30 #include <gmCell.h>
31 
32 class GmCellMesh;
33 class GmCellGroupSet;
34 class GmFileFormat;
35 
36 
45 {
46 public:
47  GmFileExtraNodes(const GmFileFormat* fileFormat, const GmCellMesh* mesh,
48  bool activeOnly, const GmCellGroupSet* group, int numMeshNodes);
49 
51  int numNodes() const { return _extraNodes.size(); }
52 
54  const QPair<int, int>& edgeNodes(int i) const { return _extraNodes[i]; }
55 
58 
62  int nextNodeIndex() { return _currentIndex++; }
63 
65  int lastNodeIndex() const { return _firstIndex + _extraNodes.size() - 1; }
66 
68  static bool transformationExists(GmCellType cellType)
69  {
70  return (cellType == GM_INT2DL6 || cellType == GM_INT2DQ6 || cellType == GM_INT3DL12 || cellType == GM_INT3DQ16);
71  }
72 
73 private:
74  QVector<QPair<int, int> > _extraNodes; // Set of extra nodes created for element transformations
75 
78 };
79 
80 #endif
81 
Interface for helping managing mesh cell groups and returning the elements in their union.
Definition: gmCellGroupSet.h:34
int numNodes() const
Returns the number of extra nodes.
Definition: gmFileExtraNodes.h:51
An auxilliary class for emiting extra mesh nodes needed by standard GeMA element transformations that...
Definition: gmFileExtraNodes.h:44
static bool transformationExists(GmCellType cellType)
Returns true if this class implements a standard transformation for the given type.
Definition: gmFileExtraNodes.h:68
int nextNodeIndex()
Each call returns the next extra node index. The series starts with the exported index for the first ...
Definition: gmFileExtraNodes.h:62
int _firstIndex
The exported index for the first extra node.
Definition: gmFileExtraNodes.h:76
A 3D quadratic interface element with 16 nodes.
Definition: gmCellType.h:55
Base interface class for CellMesh type plugins.
Definition: gmCellMesh.h:39
int _currentIndex
The "current" extra node index returned by nextNodeIndex()
Definition: gmFileExtraNodes.h:77
GmFileExtraNodes(const GmFileFormat *fileFormat, const GmCellMesh *mesh, bool activeOnly, const GmCellGroupSet *group, int numMeshNodes)
Constructor. Gets as parameter the file format object used to define which element types need transfo...
Definition: gmFileExtraNodes.cpp:40
int lastNodeIndex() const
Returns the index of the last valid extra node index.
Definition: gmFileExtraNodes.h:65
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition: gmCellType.h:30
A 2D linear interface element with 6 nodes (2 nodes of pore pressure dof at the middle)
Definition: gmCellType.h:46
A 2D quadratic interface element with 6 nodes.
Definition: gmCellType.h:47
A 3D linear interface element with 12 nodes (4 nodes of pore pressure dof at the middle)
Definition: gmCellType.h:54
Declaration of the GmCell class.
Basic interface for describing high level file format capabilities.
Definition: gmFileFormat.h:34
int size() const const
const QPair< int, int > & edgeNodes(int i) const
Returns the mesh node indices for the endpoints of the edge where the i'th extra node was created.
Definition: gmFileExtraNodes.h:54
void resetNext()
Resets the value that will be returned by nextNodeIndex() to the first extra node index.
Definition: gmFileExtraNodes.h:57