39 #include <vtkDataSet.h> 40 #include <vtkFeatureEdges.h> 41 #include <vtkIdList.h> 43 #include <vtkModelMetadata.h> 44 #include <vtkPointLocator.h> 45 #include <vtkPoints.h> 46 #include <vtkPolyData.h> 47 #include <vtkVersion.h> 51 #include <NodalDataManager.h> 54 #include <gmsh/GModel.h> 61 std::string edgeSidesetName, std::string exoMeshFName,
62 bool _lowOrder,
bool bndryConst)
111 std::cout <<
"Checking 2d cell node order" << std::endl;
114 std::cout <<
"2d node ordering right-hand rule: +z" << std::endl;
116 std::cout <<
"2d node ordering right-hand rule: -z" << std::endl;
121 std::cout <<
"Removing quad elements (converting to tris) for refinement" 127 std::cout <<
"Checking 2d cell node order" << std::endl;
130 std::cout <<
"2d node ordering right-hand rule: +z" << std::endl;
132 std::cout <<
"2d node ordering right-hand rule: -z" << std::endl;
136 std::cout <<
"Writing meshBase to file" << std::endl;
140 std::cout <<
"Performing solution transfer" << std::endl;
143 myMeshBase, myMeshBaseNoQuads,
"Consistent Interpolation");
151 myMeshBaseNoQuads->
refineMesh(
"uniform", 0.5,
"refined.vtu",
true,
158 myMeshBaseNoQuads->
write();
166 std::cout <<
"Checking 2d cell node order" << std::endl;
169 std::cout <<
"2d node ordering right-hand rule: +z" << std::endl;
171 std::cout <<
"2d node ordering right-hand rule: -z" << std::endl;
183 vtkSmartPointer<vtkIdList> sidesetElementIdList =
185 vtkSmartPointer<vtkIdList> sidesetSideIdList =
196 vtkSmartPointer<vtkModelMetadata> sidesetData =
198 vtkSmartPointer<vtkStringArray> sidesetNames =
201 sidesetNames->InsertNextValue(edgeSidesetName);
202 sidesetData->SetSideSetNames(sidesetNames);
205 std::vector<int> _sidesetElementIdList;
206 for (
int iId = 0; iId < sidesetElementIdList->GetNumberOfIds(); iId++) {
207 _sidesetElementIdList.push_back(sidesetElementIdList->GetId(iId));
210 std::vector<int> _sidesetSideIdList;
211 for (
int iId = 0; iId < sidesetSideIdList->GetNumberOfIds(); iId++) {
212 _sidesetSideIdList.push_back(sidesetSideIdList->GetId(iId));
216 sidesetData->SetSideSetElementList(_sidesetElementIdList.data());
217 sidesetData->SetSideSetSideList(_sidesetSideIdList.data());
218 int sidesetSizes[1] = {
219 static_cast<int>(sidesetElementIdList->GetNumberOfIds())};
221 sidesetData->SetSideSetSize(sidesetSizes);
222 sidesetData->SetNumberOfSideSets(1);
225 refinedMeshBase->
write();
227 std::vector<meshBase *> mbVec;
228 mbVec.push_back(refinedMeshBase);
229 std::string exoName = exoMeshFName;
240 std::cout <<
"Reading in PROTEUS control data..." << std::endl;
243 H5std_string dsetName(
"CONTROL");
245 std::vector<int> buffer(bufSize, 0);
258 std::cout <<
" Number of Blocks: " <<
numBlocks << std::endl;
259 std::cout <<
" Number of Dimensions: " <<
numDimensions << std::endl;
260 std::cout <<
" Number of Vertex Vectors: " <<
numVertexVectors << std::endl;
268 std::vector<std::string> &stringVector,
270 std::cout <<
"Reading in PROTEUS " << name <<
"..." << std::endl;
273 H5std_string dsetName(name);
281 std::string tmp =
"";
282 std::string buf =
"";
285 while (iChar <= bufSize) {
287 buf += buffer[iChar];
288 if (!(iCharCnt < charStringLength)) {
289 stringVector.push_back(std::string(tmp));
293 if (buf.compare(
" ") != 0) {
294 tmp += buffer[iChar];
301 std::cout <<
"Found " << name <<
":" << std::endl;
302 for (
auto nameItr = stringVector.begin(); nameItr != stringVector.end();
304 std::cout <<
" " << *nameItr << std::endl;
309 std::cout <<
"Reading in PROTEUS block data..." << std::endl;
311 for (
int iBlock = 0; iBlock <
numBlocks; iBlock++) {
313 std::string blockName =
"BLOCK";
314 std::string numStr = std::to_string(iBlock + 1);
315 while (numStr.length() < 12) {
316 numStr.insert(0,
"0");
319 std::cout <<
"Reading in " + blockName +
"..." << std::endl;
348 std::cout <<
"Finished reading PROTEUS block data..." << std::endl;
352 std::cout <<
"Merging PROTEUS block data..." << std::endl;
355 int numGlobalVertices = 0;
358 int numGlobalElements = 0;
359 int maxNumVerticesPerElement = 0;
362 std::vector<int> elementTypesList;
363 std::vector<int> originalElementTypesList;
368 int localMaxVertexId = *std::max_element((*blockItr).loc2Glob.begin(),
369 (*blockItr).loc2Glob.end());
370 if (localMaxVertexId > numGlobalVertices) {
371 numGlobalVertices = localMaxVertexId;
375 numGlobalElements += (*blockItr).numElements;
378 if ((*blockItr).numVerticesPerElement > maxNumVerticesPerElement) {
379 maxNumVerticesPerElement = (*blockItr).numVerticesPerElement;
382 if (std::find(originalElementTypesList.begin(),
383 originalElementTypesList.end(),
384 (*blockItr).originalVtkElementType) ==
385 originalElementTypesList.end()) {
386 originalElementTypesList.push_back((*blockItr).originalVtkElementType);
387 elementTypesList.push_back((*blockItr).vtkElementType);
398 std::cout <<
" Found " << numGlobalVertices <<
" global vertices" 400 std::cout <<
" Found " << numGlobalElements <<
" global elements" 404 std::vector<std::vector<double>> coordinates(
408 std::vector<std::vector<int>> elements(
409 numGlobalElements, std::vector<int>(maxNumVerticesPerElement, 0));
412 std::vector<int> elementTypes(numGlobalElements);
415 std::vector<std::vector<double>> vertexData(
419 std::vector<std::vector<double>> elementData(
423 int locVertId, globElemId, locElemId;
424 int lId, gId, vertNo, dimNo, origId;
428 std::cout <<
" Accumulating mesh information from each block..." 432 std::cout <<
" " << (*blockItr).blockName <<
":" << std::endl;
436 for (
auto elemItr = (*blockItr).vertices.begin();
437 elemItr != (*blockItr).vertices.end(); elemItr++) {
440 for (
auto dimItr = (*elemItr).begin(); dimItr != (*elemItr).end();
443 dimNo = distance((*elemItr).begin(), dimItr);
445 for (
auto vertItr = (*dimItr).begin(); vertItr != (*dimItr).end();
447 vertNo = distance((*dimItr).begin(), vertItr);
448 elements[globElemId][vertNo] = (*blockItr).loc2Glob[locVertId];
449 coordinates[(*blockItr).loc2Glob[locVertId]][dimNo] = *vertItr;
452 elementTypes[globElemId] = (*blockItr).vtkElementType;
457 elementData[iElemData][globElemId] =
458 (*blockItr).elementData[iElemData][locElemId];
466 for (
auto vertItr = (*blockItr).loc2Glob.begin();
467 vertItr != (*blockItr).loc2Glob.end(); vertItr++) {
468 lId = distance((*blockItr).loc2Glob.begin(), vertItr);
471 vertexData[iVertData][gId] = (*blockItr).vertexData[iVertData][lId];
475 std::cout <<
" " << (*blockItr).vertices.size() <<
" vertices" 477 std::cout <<
" " << (*blockItr).numElements <<
" elements" 487 std::cout <<
" Separating coordinate arrays into individual dimension " 490 for (
auto vertItr = coordinates.begin(); vertItr != coordinates.end();
506 std::cout <<
" Sorting element connectivities by element type..." 512 auto origTypeItr = originalElementTypesList.begin();
513 while (origTypeItr != originalElementTypesList.end()) {
515 std::map<int, std::vector<int>> tmpElementConnectivity;
519 auto elemItr = elements.begin();
520 auto elemTypeItr = elementTypes.begin();
521 while (elemItr != elements.end() || elemTypeItr != elementTypes.end()) {
523 elemId = distance(elements.begin(), elemItr);
525 for (
auto vertItr = (*elemItr).begin(); vertItr != (*elemItr).end();
528 vertNum = distance((*elemItr).begin(), vertItr);
530 if (*elemTypeItr == VTK_QUAD) {
533 #if VTK_MAJOR_VERSION > 8 || (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) 534 if (*origTypeItr == VTK_LAGRANGE_QUADRILATERAL) {
535 if (vertNum == 0 || vertNum == 3 || vertNum == 12 ||
537 tmpElementConnectivity[elemId].push_back(*vertItr);
540 tmpElementConnectivity[elemId].push_back(*vertItr);
543 if (*origTypeItr == -1)
546 if (vertNum == 0 || vertNum == 3 || vertNum == 12 ||
548 tmpElementConnectivity[elemId].push_back(*vertItr);
551 tmpElementConnectivity[elemId].push_back(*vertItr);
555 #if VTK_MAJOR_VERSION > 8 || (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) 556 else if (*elemTypeItr == VTK_LAGRANGE_QUADRILATERAL) {
557 tmpElementConnectivity[elemId].push_back(*vertItr);
560 else if (*elemTypeItr == VTK_TRIANGLE) {
561 tmpElementConnectivity[elemId].push_back(*vertItr);
566 if (elemItr != elements.end()) {
569 if (elemTypeItr != elementTypes.end()) {
576 elementConnectivity.push_back(tmpElementConnectivity);
578 if (origTypeItr != originalElementTypesList.end()) {
584 std::cout <<
" Re-ordering element vertices per VTK convention..." 587 int swapVert1 = -1, swapVert2 = -1;
591 std::find(elementTypesList.begin(), elementTypesList.end(), VTK_QUAD);
592 if (testIt != elementTypesList.end()) {
593 std::cout <<
" Re-ordering VTK_QUAD element vertices..." 595 connId = distance(elementTypesList.begin(), testIt);
596 for (
auto elemIt = elementConnectivity[connId].begin();
597 elemIt != elementConnectivity[connId].end(); elemIt++) {
599 for (
int i = 0; i < (elemIt->second).size(); i++) {
600 if (vertCount == 2) {
601 swapVert1 = (elemIt->second)[i];
603 if (vertCount == 3) {
604 swapVert2 = (elemIt->second)[i];
605 (elemIt->second)[i] = swapVert1;
606 (elemIt->second)[i - 1] = swapVert2;
644 std::cout <<
" Setting mesh data in PROTEUS superblock..." << std::endl;
654 std::cout <<
"Finished merging PROTEUS block data..." << std::endl;
659 std::vector<int> buffer(bufSize, 0);
662 std::vector<int> tmpVec;
663 for (
int iBuf = 0; iBuf < bufSize; iBuf++) {
664 tmpVec.push_back(buffer[iBuf]);
673 if (tmpVec[2] == 162) {
675 #if VTK_MAJOR_VERSION > 8 || (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) 683 #if VTK_MAJOR_VERSION > 8 || (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) 689 std::cout <<
"Warning: VTK version " << vtkVersion::GetVTKSourceVersion()
690 <<
" does not support Lagrange Quadrilateral cells." 694 }
else if (tmpVec[2] == 160) {
702 else if (tmpVec[2] == 110) {
706 std::cerr <<
"Element type not supported: " << tmpVec[2] << std::endl;
711 std::cout <<
" Info:" << std::endl;
712 std::cout <<
" Number of elements: " << tmpVec[0] << std::endl;
713 std::cout <<
" Number of vertices per element: " 723 std::vector<float> buffer(bufSize, 0);
729 std::cout <<
" Coordinate info:" << std::endl;
730 std::cout <<
" Read in " << bufSize <<
" vertex coordinates" 734 <<
" in dimension " << iDim << std::endl;
739 std::vector<std::vector<std::vector<double>>> tmpVec(
741 std::vector<std::vector<double>>(
745 for (
int iElem = 0; iElem < myBlock.
numElements; iElem++) {
748 tmpVec[iElem][iDim][iVert] = double(buffer[tmpInd]);
761 std::vector<int> buffer(bufSize, 0);
767 std::cout <<
" Global ID info:" << std::endl;
768 std::cout <<
" Read in " 770 <<
" global IDs" << std::endl;
773 std::vector<int> tmpVec;
774 for (
int iBuf = 0; iBuf < bufSize; iBuf++) {
775 tmpVec.push_back(buffer[iBuf]);
786 int bufDimFlat = bufDim1 * bufDim2;
789 std::vector<float> flatBuffer(bufDimFlat, 0.0);
792 std::vector<std::vector<double>> buffer(bufDim1,
793 std::vector<double>(bufDim2, 0.0));
799 std::vector<double> doubleFlatBuffer(flatBuffer.begin(), flatBuffer.end());
807 std::cout <<
" Element Data info:" << std::endl;
809 <<
" element data:" << std::endl;
812 std::cout <<
" " << *edItr << std::endl;
823 int bufDimFlat = bufDim1 * bufDim2;
826 std::vector<float> flatBuffer(bufDimFlat, 0.0);
829 std::vector<std::vector<double>> buffer(bufDim1,
830 std::vector<double>(bufDim2, 0.0));
836 std::vector<double> doubleFlatBuffer(flatBuffer.begin(), flatBuffer.end());
842 std::cout <<
" Vertex Data info:" << std::endl;
844 <<
" vertex data:" << std::endl;
847 std::cout <<
" " << *vdItr << std::endl;
925 vtkSmartPointer<vtkPoints> endPts) {
927 std::cerr <<
"Error: Sidesets only supports for 2D meshes" << std::endl;
931 MAd::pGModel tmpMdl = NULL;
932 MAd::GM_create(&tmpMdl,
"");
933 MAd::pMesh refinedMadMesh = MAd::M_new(tmpMdl);
934 MAd::M_load(refinedMadMesh,
"refined.msh");
936 MAd::GM_create(&tmpMdl,
"");
937 MAd::pMesh skinnedMadMesh = MAd::M_new(tmpMdl);
939 std::vector<int> regIds;
940 refinedMadMesh->skin_me(skinnedMadMesh, regIds);
942 MAd::EIter eit = MAd::M_edgeIter(skinnedMadMesh);
946 while ((pe = MAd::EIter_next(eit))) {
947 MAd::pVertex v = MAd::E_vertex(pe, 0);
951 startPts->InsertPoint(edgeId, coord);
953 v = MAd::E_vertex(pe, 1);
957 endPts->InsertPoint(edgeId, coord);
965 vtkSmartPointer<vtkPoints> endPts,
966 vtkSmartPointer<vtkIdList> sidesetElementIdList,
967 vtkSmartPointer<vtkIdList> sidesetSideIdList) {
969 vtkSmartPointer<vtkPointLocator> pointLocator =
971 pointLocator->SetDataSet(myMeshBase->
getDataSet());
972 pointLocator->BuildLocator();
979 vtkSmartPointer<vtkIdList> edgeIdListCompare =
981 vtkSmartPointer<vtkIdList> edgeIdListOriginal =
983 vtkSmartPointer<vtkIdList> edgeIdListIntersection =
985 for (
int iBndEdge = 0; iBndEdge < startPts->GetNumberOfPoints(); iBndEdge++) {
987 edgeIdListOriginal->Reset();
989 id1 = pointLocator->FindClosestPoint(startPts->GetPoint(iBndEdge));
990 id2 = pointLocator->FindClosestPoint(endPts->GetPoint(iBndEdge));
992 edgeIdListOriginal->InsertNextId(id1);
993 edgeIdListOriginal->InsertNextId(id2);
995 myMeshBase->
getDataSet()->GetPointCells(id1, cellList1);
996 myMeshBase->
getDataSet()->GetPointCells(id2, cellList2);
998 cellList1->IntersectWith(cellList2);
999 if (cellList1->GetNumberOfIds() != 1) {
1000 std::cerr <<
"Error: found multiple cells for boundary edge in a 2d mesh" 1004 sidesetElementIdList->InsertNextId(cellList1->GetId(0));
1006 foundCell = myMeshBase->
getDataSet()->GetCell(cellList1->GetId(0));
1008 myMeshBase->
getDataSet()->GetCellPoints(cellList1->GetId(0), cellPts);
1009 for (
int ipt = 0; ipt < cellPts->GetNumberOfIds(); ipt++) {
1011 myMeshBase->
getDataSet()->GetPoint(cellPts->GetId(ipt), position);
1018 for (
int iCellEdge = 0; iCellEdge < foundCell->GetNumberOfEdges();
1020 edgeIdListCompare = foundCell->GetEdge(iCellEdge)->GetPointIds();
1023 edgeIdListIntersection->Reset();
1024 for (
int iId = 0; iId < edgeIdListOriginal->GetNumberOfIds(); iId++) {
1025 for (
int jId = 0; jId < edgeIdListCompare->GetNumberOfIds(); jId++) {
1026 if (edgeIdListOriginal->GetId(iId) == edgeIdListCompare->GetId(jId)) {
1027 edgeIdListIntersection->InsertNextId(
1028 edgeIdListOriginal->GetId(iId));
1033 if (edgeIdListIntersection->GetNumberOfIds() == 2) {
1034 sidesetSideIdList->InsertNextId(iCellEdge);
1038 if (iCellEdge == foundCell->GetNumberOfEdges() - 1) {
1039 std::cout <<
"Couldn't find a matching side!" << std::endl;
1056 std::map<int, bool> rhr;
1057 for (
int iCell = 0; iCell < myMeshBase->
getDataSet()->GetNumberOfCells();
1060 vtkSmartPointer<vtkCell> testCell =
1062 vtkSmartPointer<vtkPoints> cellPts = testCell->GetPoints();
1069 double zNorm[3] = {0, 0, 1};
1071 if (testCell->GetCellType() == VTK_TRIANGLE) {
1072 cellPts->GetPoint(0, pt0);
1073 cellPts->GetPoint(1, pt1);
1074 cellPts->GetPoint(2, pt2);
1075 vtkMath::Subtract(pt1, pt0, vc0);
1076 vtkMath::Subtract(pt2, pt0, vc1);
1077 }
else if (testCell->GetCellType() == VTK_QUAD) {
1078 cellPts->GetPoint(0, pt0);
1079 cellPts->GetPoint(1, pt1);
1080 cellPts->GetPoint(2, pt2);
1081 vtkMath::Subtract(pt1, pt0, vc0);
1082 vtkMath::Subtract(pt2, pt0, vc1);
1083 }
else if (testCell->GetCellType() != VTK_QUAD &&
1084 testCell->GetCellType() != VTK_TRIANGLE) {
1085 std::cerr <<
"Only triangular and quadrilateral elements supported." 1091 vtkMath::Cross(vc0, vc1, vc2);
1092 res = vtkMath::Dot(vc2, zNorm);
1100 if ((testCell->GetCellType() == VTK_QUAD &&
1101 rhr.find(VTK_QUAD) == rhr.end()) ||
1102 (testCell->GetCellType() == VTK_TRIANGLE &&
1103 rhr.find(VTK_TRIANGLE) == rhr.end())) {
1104 rhr[testCell->GetCellType()] = ans;
1106 if (rhr[testCell->GetCellType()] != ans) {
1107 std::cout <<
"Mismatched ordering for type " << testCell->GetCellType()
1108 <<
", cell number " << iCell << std::endl;
1113 for (
auto itr = rhr.begin(); itr != rhr.end(); itr++) {
1114 if (itr == rhr.begin()) {
1117 if (conv != itr->second) {
1118 std::cerr <<
"Error: Mesh contains multiple element types with " 1119 "different node ordering."
int numElementVectors
number of element vector fields in Proteus file
bool lowOrder
Boolean converting high order cells to low order (useful for visualization)
std::vector< std::vector< double > > coordinates
coordinates[vertex id][dim] = coordinate
void setNumberOfVertices(int numVertices)
Set number of vertices in meshBase.
std::vector< std::vector< double > > elementData
elementData[field no][element id] = data
int originalVtkElementType
original VTK element type.
std::vector< double > yCrd
void refineMesh(const std::string &method, int arrayID, double dev_mult, bool maxIsmin, double edge_scale, const std::string &ofname, bool transferData, double sizeFactor=1., bool constrainBoundary=false)
perform sizefield-based h-refinement.
std::vector< int > elementTypes
void mergeBlocks()
Merge Proteus block together.
void setElementTypesList(std::vector< int > vtkElementTypesList)
Set list of each unique type of VTK element in mesh.
void unflattenBuffer2d(std::vector< T > flatBuffer, std::vector< std::vector< T >> &originalBuffer)
Unflatten 2d data buffer.
std::vector< int > originalElementTypesList
list of original element types, ordered by type according to elements vector
std::vector< std::string > elementVectorNames
vector containing names of element vectors
void setElementTypes(std::vector< int > vtkElementTypes)
Set VTK element types for each element.
A brief description of meshBase.
void exportToVTKMesh()
Export to VTK format.
std::vector< std::vector< double > > elementData
element field data
void getBlocks()
Read Proteus blocks.
geoMeshBase * New(MeshType meshType)
Create a new mesh object.
void getVectorNames(std::string name, std::vector< std::string > &stringVector, int numVectors)
Get names of Proteus vector fields.
void getBlockVertexData(Group &group, proteusBlock &myBlock)
Get vertex data for block.
std::vector< std::map< int, std::vector< int > > > elementConnectivity
element connectivity table
int getNumDimensions() const
Get number of spatial dimensions in Proteus file.
int vtkElementType
VTK element type.
int closeFile()
Close HDF5 file.
meshBase * getMeshBase()
Get meshBase object.
static meshBase * Create(const std::string &fname)
Construct vtkMesh from filename.
bool get2dCellNodeOrder(meshBase *myMeshBase)
Get normal vector for 2d meshes.
int readGroup(std::string groupName, Group &group)
Read existing HDF5 Group.
std::vector< double > zCrd
coordinates separated out into x,y,z coordinates
int getCharStringLength() const
Get character string length of names in Proteus file.
std::vector< std::vector< double > > vertexData
vertex field data
void getControlInformation()
Read Proteus control information.
proteusSuperBlock mySuperBlock
global block structure for entire Proteus mesh
std::string blockName
block name
void getBoundarySideSets(meshBase *myMeshBase, vtkSmartPointer< vtkPoints > startPts, vtkSmartPointer< vtkPoints > endPts, vtkSmartPointer< vtkIdList > sidesetElementIdList, vtkSmartPointer< vtkIdList > sidesetSideIdList)
Get boundary sidesets of mesh.
int numVerticesPerElement
number of vertices per element (only one element type allowed per block)
int numDimensions
number of spatial dimensions
int numElements
global number of elements
vtkSmartPointer< vtkDataSet > getDataSet() const
get this meshes' dataSet
void getBlockInfo(Group &group, proteusBlock &myBlock)
Read information for each Proteus block.
proteusHdf5(std::string fname, std::string outputFname, std::string edgeSidesetName, std::string exoMeshFName, bool lowOrder=false, bool bndryConst=true)
Construct Proteus HDF5 object.
void setConnectivities(std::vector< std::map< int, std::vector< int >>> elementConnectivity)
Set meshBase element connectivity table.
int numBlocks
number of Proteus blocks
int getNumElementVectors() const
Get number of element vectors in Proteus file.
virtual void write() const
write the mesh to file named after the private var 'filename'.
void getBlockGlobalID(Group &group, proteusBlock &myBlock)
Get global coordinates of Proteus block.
meshBase * convertQuads()
int readTopDataSet(std::string dsetName, std::string &buffer)
Read string data from top level HDF5 DataSet.
void setFields(meshBase *myMeshBase, std::vector< std::string > dataNames, std::vector< std::vector< double >> data, int pointOrCell)
Set meshBase field data.
void getBlockElementData(Group &group, proteusBlock &myBlock)
Get element data for block.
std::vector< proteusBlock > proteusBlocks
vector of all individual Proteus-style blocks
void getBoundaryEdgePts(vtkSmartPointer< vtkPoints > startPts, vtkSmartPointer< vtkPoints > endPts)
Write boundary condition information to json file.
void exportToMeshBase()
Export HDF5 mesh to meshBase object.
std::vector< int > loc2Glob
map between local and global IDs
meshBase * myMeshBase
meshBase object
int numElements
number of elements in block
int numVertexVectors
number of vertex vector fields in Proteus file
void getBlockXYZ(Group &group, proteusBlock &myBlock)
Get coordinates of Proteus block.
int maxNumVerticesPerElement
maximum number of vertices for all element types
std::vector< std::vector< std::vector< double > > > vertices
vertices
int numVertices
global number of vertices
void setNumberOfDimensions(int numDimensions)
Set number of spatial dimensions in meshBase.
std::vector< std::vector< double > > vertexData
cellData[field no][vertex id] = data
std::vector< double > xCrd
static std::shared_ptr< TransferBase > CreateTransferObject(meshBase *srcmsh, meshBase *trgmsh, const std::string &method)
int readGroupDataSet(std::string dsetName, Group &group, std::vector< T > &buffer)
Read numeric data from HDF5 group.
void setCoordinates(std::vector< double > xCrd)
Set meshBase 1d coordinate data.
std::vector< std::map< int, std::vector< int > > > vtkConnectivity
connectivity array for all element types by VTK convention, vtkConnectivity[element type][global elem...
std::vector< std::string > vertexVectorNames
vector containing names of vertex vectors
void setNumberOfElements(int numElements)
Set number of elements in meshBase.
Class for reading data from HDF5 files.
int getNumVertexVectors() const
Get number of vertex vectors in Proteus file.
void setMetadata(vtkSmartPointer< vtkModelMetadata > _metadata)
std::vector< int > elementTypesList
list of element types, ordered by type according to elements vector
int openFile()
Open HDF5 file.
std::vector< std::vector< int > > elements
connectivity info, elements[id][vertex no] = vertex id
static void genExo(std::vector< meshBase *> meshes, const std::string &fname)
stores information for each block of Proteus data
int charStringLength
string length of each Proteus variable name
int getNumBlocks() const
Get number of blocks in Proteus file.