Xfem
The Xfem Plugin
xfemGaussValueSet.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_XFEM_GAUSS_VS_H_
25 #define _GEMA_XFEM_GAUSS_VS_H_
26 
27 #include <gmGaussValueSet.h>
28 
29 class XfemGaussAccessor;
30 class XfemElement;
31 
36 {
37 public:
39  virtual ~XfemGaussValueSet();
40 
41  virtual void clear();
42 
43  double* dataPointer(const XfemElement* e, int ip, int stateIndex);
44 
45  int numEnrichedPoints(int cellId) const;
46 
48  void clearEnrichedIntegrationPoints (int cellId);
49  void insertEnrichedIntegrationPoints(int cellId, int firstPoint, int numPoints);
50  void removeEnrichedIntegrationPoints(int cellId, int firstPoint, int numPoints);
51 
53  int stateIndex(int snum) const { return t(snum); }
54 
55  virtual bool saveState(SaveStateMode mode, const GmLogCategory& logger);
56 
57 #if defined ENABLE_TESTS || defined ENABLE_VALUESET_TESTS
58  void validateInternalStructure(bool xfemOnly = false);
59 #endif
60 
61 private:
62  friend class XfemGaussAccessor;
63 
66  {
67  XfemGaussValueData(int n, GmValueInfo* info, int nstates);
69 
70  void addPoints (int index, int n, GmValueInfo* info);
71  void removePoints(int index, int n, GmValueInfo* info);
72 
73  void addState (GmValueInfo* info);
74  void initState(int index, SaveStateMode mode, int oldIndex, GmValueInfo* info);
75 
76  int _nvalues;
77  int _nstored;
79  };
80 
82 };
83 
84 
85 
86 #endif
87 
The XfemGaussAccessor class is a proxy object to a value accesor implementing a more convenient inter...
Definition: xfemGaussAccessor.h:40
void addState(GmValueInfo *info)
Adds a new (history) state to the set, with the same number of points as the other states....
Definition: xfemGaussValueSet.cpp:342
virtual ~XfemGaussValueSet()
Destructor.
Definition: xfemGaussValueSet.cpp:43
XfemGaussValueSet(GmValueInfo *info, GmSimulationData *simData, GmElementMesh *mesh)
Constructor. See base class GmMGaussValueSet.
Definition: xfemGaussValueSet.cpp:37
void removePoints(int index, int n, GmValueInfo *info)
Removes the given number of points from the set. Remaining points are moved to fill the gap.
Definition: xfemGaussValueSet.cpp:317
void clearEnrichedIntegrationPoints()
Removes the complete set of enriched integration points (for all elements)
Definition: xfemGaussValueSet.cpp:84
int _nstored
The number of alocated values in the data vector. Always >= _nvalues.
Definition: xfemGaussValueSet.h:77
int _nvalues
Number of saved values (equal to the number of integration points)
Definition: xfemGaussValueSet.h:76
int numEnrichedPoints(int cellId) const
Returns the number of enriched integration points for the given cell.
Definition: xfemGaussValueSet.cpp:75
GmValueInfo * info() const
int numPoints(int cellId) const
Basic interface for an XFEM element.
Definition: xfemElement.h:43
void initState(int index, SaveStateMode mode, int oldIndex, GmValueInfo *info)
Initializes the values in the state given by index according to the given save mode.
Definition: xfemGaussValueSet.cpp:354
int stateIndex(int snum) const
Translates a state number into the index needed by dataPointer()
Definition: xfemGaussValueSet.h:53
QList< double * > _valuesList
List with a data vector with size equal to _nstored * data dimension, filled with _nvalues * data dim...
Definition: xfemGaussValueSet.h:78
~XfemGaussValueData()
Destructor.
Definition: xfemGaussValueSet.cpp:263
Auxiliar class used to store enriched data for a single element.
Definition: xfemGaussValueSet.h:65
void removeEnrichedIntegrationPoints(int cellId, int firstPoint, int numPoints)
Removes the the given number of integration points, starting at firstPoint, from the given element....
Definition: xfemGaussValueSet.cpp:128
double * dataPointer(const XfemElement *e, int ip, int stateIndex)
Returns a pointer to the area used to store data for the given ENRICHED element integration point,...
Definition: xfemGaussValueSet.cpp:56
Operating in colaboration with the XfemGaussAccessor class this value set extends the normal Gauss va...
Definition: xfemGaussValueSet.h:35
void insertEnrichedIntegrationPoints(int cellId, int firstPoint, int numPoints)
Insertss the given number of points into the specified position (firstPOint) of the set of enriched i...
Definition: xfemGaussValueSet.cpp:105
int t(int index) const
XfemGaussValueData(int n, GmValueInfo *info, int nstates)
Constructor getting as parameter the number of stored values, the information describing the data typ...
Definition: xfemGaussValueSet.cpp:235
QMap< int, XfemGaussValueData * > _enrichedDataMap
Map storing per enriched element data.
Definition: xfemGaussValueSet.h:81
void addPoints(int index, int n, GmValueInfo *info)
Adds the given number of points to the set, initialized with the default value given by info Points a...
Definition: xfemGaussValueSet.cpp:273