GemaCoreLib
The GeMA Core library
gmNfFileFormat.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 _GM_NF_FILE_FORMAT_H_
25 #define _GM_NF_FILE_FORMAT_H_
26 
27 #include "gmFileFormat.h"
28 
29 #include "gmValueInfo.h"
30 #include <nfr.h>
31 
34 {
35 public:
36  // See comments on the base class
37  virtual const char* formatName() const { return "Neutral file"; }
38 
39  // See comments on the base class
40  virtual bool supportsMultipleIterations() const { return true; }
41 
42  // See comments on the base class
43  virtual bool supportsSplitVectors() const { return true; }
44 
45  // See comments on the base class
46  virtual bool acceptsNodeDimension(int ndim) const { return ndim == 2 || ndim == 3; }
47 
48  // See comments on the base class
49  virtual bool acceptsDataType(const GmValueInfo* info, int nodeDim, int dimFilter = -1) const
50  {
51  // The neutral file format accepts scalar, vector and tensor values
52  Q_UNUSED(info); Q_UNUSED(nodeDim); Q_UNUSED(dimFilter);
53  return true;
54  }
55 
56  // See comments on the base class
57  virtual bool acceptsMultipleGaussProfiles() const { return false; }
58 
59  virtual bool acceptsGaussRuleForElement(GmCellType type, const GmIntegrationRule* ir) const;
60 
61  // See comments on the base class
62  virtual bool acceptsDiscontinuitySet(GmDiscontinuitySet::DiscontinuityType type) const { Q_UNUSED(type); return false; }
63 
64  // TODO
65  virtual int acceptsCellType(GmCellType type) const { Q_UNUSED(type); return 0; }
66  virtual const QVector<int>& cellNumbering(GmCellType type) const { Q_UNUSED(type); static QVector<int> dummy; return dummy; }
67  virtual int fileCellType(GmCellType type) const { Q_UNUSED(type); return 0; }
68  virtual const char* fileCellTypeName(GmCellType type) const { Q_UNUSED(type); return NULL; }
69 
70  // See comments on the base class
71  virtual bool supportsMeshChanges() const { return false; }
72 
73 protected:
74  // Supported element types and file section names
76  {
77  GmCellType type;
78  const char* topoSection;
79  int ndummy1; // Number of dummy values after the material label and before nodes ids
80  bool integrationId; // Should we add an integration aid after the dummy values?
81  int ndummy2; // Number of dummy values after nodes ids
82  };
83 
84  static const SupportedTypesT supportedTypes[];
85  static const int supportedTypesSize;
86 
87  struct nfrType {
88  NfrResultType nfType;
89  GmValueSetKind gmKind;
90  GmDimType gmType;
91  int nfSize;
92  };
93 
94  struct nfrElement {
95  NfrElementType nfEleType;
96  NfrQuadratureType nfQuadType;
97  double nfQuadNatCrd[200];
98  };
99 
100  static const nfrType nfrTypeTable[];
101  static const nfrElement nfrElementTable[];
102 
103  int nf2gmCellNodeIndex(GmCellType type, int nfId);
104  int nf2gmCellGaussIndex(GmCellType type, int ngp, int nfId);
105 
106  unsigned int offset(unsigned int n) { return n == 1 ? 0 : n-1 + offset(n-1); }
107 };
108 
109 
110 #endif // _GM_NF_FILE_FORMAT_H_
Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition: gmValueInfo.h:126
virtual bool supportsMeshChanges() const
Returns true if this writer can cope with mesh changes during the simulation.
Definition: gmNfFileFormat.h:71
virtual const QVector< int > & cellNumbering(GmCellType type) const
Returns the node cell type numbering order in the file format view or an empty vector for unsupported...
Definition: gmNfFileFormat.h:66
GmDimType
Value dimension type.
Definition: gmValueInfo.h:66
Declaration of the GmValueInfo class.
Definition: gmNfFileFormat.h:94
virtual bool acceptsDataType(const GmValueInfo *info, int nodeDim, int dimFilter=-1) const
Returns true if this file format can save node/element data with the specified type (especially its d...
Definition: gmNfFileFormat.h:49
virtual bool acceptsNodeDimension(int ndim) const
Returns true if this file format accepts meshes with nodes of the given dimension.
Definition: gmNfFileFormat.h:46
virtual bool supportsMultipleIterations() const
Returns true if this file type supports multiple iterations (result sets)
Definition: gmNfFileFormat.h:40
GmValueSetKind
Type describing what kind of information is stored by a values set.
Definition: gmValueInfo.h:36
DiscontinuityType
Discontinuity type (defining how the disc. geometry is defined)
Definition: gmDiscontinuitySet.h:52
Integration rule base classe.
Definition: gmIntegrationRule.h:88
virtual bool acceptsMultipleGaussProfiles() const
Does the file supports multiple Gauss points per element type?
Definition: gmNfFileFormat.h:57
virtual bool acceptsGaussRuleForElement(GmCellType type, const GmIntegrationRule *ir) const
Does the file support exporting data at Gauss points for an element of type type with the supplied in...
Definition: gmNfFileFormat.cpp:299
virtual const char * formatName() const
Returns the file format name.
Definition: gmNfFileFormat.h:37
Declaration of the GmFileFormat class (old GmFileDataclass)
virtual const char * fileCellTypeName(GmCellType type) const
Returns the cell type name as seen by the exported file format.
Definition: gmNfFileFormat.h:68
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition: gmCellType.h:30
File format specifications for the "Neutral File" file format.
Definition: gmNfFileFormat.h:33
Basic interface for describing high level file format capabilities.
Definition: gmFileFormat.h:34
virtual int acceptsCellType(GmCellType type) const
Does the file format accepts this cell type? Returns 0 if the cell type is not accepted,...
Definition: gmNfFileFormat.h:65
Definition: gmNfFileFormat.h:75
virtual int fileCellType(GmCellType type) const
Returns the cell type code as seen by the file format. Currently used only by HDF5 based formats.
Definition: gmNfFileFormat.h:67
virtual bool supportsSplitVectors() const
Returns true if this writer prefers to split vector values into scalar values by itself.
Definition: gmNfFileFormat.h:43
Definition: gmNfFileFormat.h:87