forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LSDynaMetaData.h
132 lines (105 loc) · 4.5 KB
/
LSDynaMetaData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*=========================================================================
Program: Visualization Toolkit
Module: LSDynaMetaData.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*----------------------------------------------------------------------------
Copyright (c) Sandia Corporation
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
----------------------------------------------------------------------------*/
// .NAME LSDynaMetaData - Read LS-Dyna databases (d3plot)
// .SECTION Description
// A class to hold metadata about a particular file (such as time steps,
// the start of state information for each time step, the number of
// adaptive remeshes, and the large collection of constants that determine
// the available attributes). It contains an LSDynaFamily instance.
#ifndef __LSDynaMetaData_h
#define __LSDynaMetaData_h
#include "LSDynaFamily.h"
#include <map>
#include <set>
#include <string>
#include <vector>
class LSDynaMetaData
{
public:
LSDynaMetaData();
bool AddPointArray(const std::string& name, int numComponents, int status);
bool AddCellArray(int cellType, const std::string& name, int numComponents, int status);
vtkIdType GetTotalMaterialCount();
void Reset();
/** LS-Dyna cell types.
* These may be used as values for the \a cellType argument in member functions.
* One dataset is created for each cell type so that cells can have different
* attributes (temperature, pressure, etc.) defined over them.
* Note that \a NUM_CELL_TYPES is not a cell type, but an enumerant that
* specifies the total number of cell types. It is used to size arrays.
*/
enum LSDYNA_TYPES
{
PARTICLE = 0,
BEAM = 1,
SHELL = 2,
THICK_SHELL = 3,
SOLID = 4,
RIGID_BODY = 5,
ROAD_SURFACE = 6,
NUM_CELL_TYPES
};
// If this is 0, the rest of the members have undefined
// values (although "derived-value" arrays will be
// initialized to nullptr)
int FileIsValid;
int FileSizeFactor; // scale factor used to compute MaxFileLength
vtkIdType MaxFileLength; // Maximum size of any file (data too big is split into multiple files)
LSDynaFamily Fam; // file family I/O aggregator
char Title[41];
char ReleaseNumber[16];
float CodeVersion;
int Dimensionality;
vtkIdType CurrentState; // time step
vtkIdType NumberOfNodes;
vtkIdType NumberOfCells[LSDynaMetaData::NUM_CELL_TYPES];
int ReadRigidRoadMvmt; // Are some of the quads rigid? (eliminating a lot of state)
int ConnectivityUnpacked; // Is the connectivity packed, 3 to a word?
std::map<std::string, vtkIdType> Dict;
/// List of material IDs that indicate the associated shell element is rigid (and has no state
/// data)
std::set<int> RigidMaterials;
/// List of material IDs that indicate the associated solid element represents an Eulerian or ALE
/// fluid.
std::set<int> FluidMaterials;
std::vector<std::string> PointArrayNames;
std::vector<int> PointArrayComponents;
std::vector<int> PointArrayStatus;
std::map<int, std::vector<std::string>> CellArrayNames;
std::map<int, std::vector<int>> CellArrayComponents;
std::map<int, std::vector<int>> CellArrayStatus;
std::vector<std::string> PartNames;
std::vector<int> PartIds;
std::vector<int> PartMaterials;
std::vector<int> PartStatus;
std::vector<int> MaterialsOrdered;
std::vector<int> MaterialsUnordered;
std::vector<int> MaterialsLookup;
std::vector<vtkIdType> RigidSurfaceSegmentSizes;
std::vector<double> TimeValues;
// For the current time value, what file contains this state (0=d3plot,1=d3plot01, ...)
vtkIdType FileNumberThisState;
// For the current time value, what is the byte offset of the state in file FileNumberThisState?
vtkIdType FileOffsetThisState;
// Size of all data that appears before first state
vtkIdType PreStateSize;
// Number of bytes required to store a single timestep
vtkIdType StateSize;
// Number of words into the state that the element deletion starts at
vtkIdType ElementDeletionOffset;
// Number of words into the state that the SPH state data starts at
vtkIdType SPHStateOffset;
};
#endif // __LSDynaMetaData_h