Skip to content

Commit e4a2cfa

Browse files
Add basisType to RCSSurfaceGeometry and update related file handling
1 parent d934ab0 commit e4a2cfa

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/components/RCSSurfaceExporter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ RCSSurfaceExporter::RCSSurfaceExporter(
5454
totalQuadPts += ir->GetNPoints();
5555
}
5656

57-
int32_t header[4] = {
57+
int basisType = fec->GetBasisType();
58+
int32_t header[5] = {
5859
static_cast<int32_t>(spaceDim_),
5960
static_cast<int32_t>(numDofs_),
6061
static_cast<int32_t>(numBdr),
61-
static_cast<int32_t>(totalQuadPts)
62+
static_cast<int32_t>(totalQuadPts),
63+
static_cast<int32_t>(basisType)
6264
};
6365
dataFile_.write(reinterpret_cast<const char*>(header), sizeof(header));
6466

src/components/RCSSurfacePostProcessor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,13 @@ RCSSurfacePostProcessor::readRankData(const std::string& rankPath) const
7979
std::ifstream f(rankPath + "/surface_data.bin", std::ios::binary);
8080
if (!f) throw std::runtime_error("Cannot open " + rankPath + "/surface_data.bin");
8181

82-
int32_t hdr[4];
82+
int32_t hdr[5];
8383
f.read(reinterpret_cast<char*>(hdr), sizeof(hdr));
8484
rd.geometry.spaceDimension = hdr[0];
8585
rd.geometry.numDofs = hdr[1];
8686
rd.geometry.numBdrElements = hdr[2];
8787
rd.geometry.numQuadPoints = hdr[3];
88+
rd.geometry.basisType = hdr[4];
8889

8990
const int nqp = rd.geometry.numQuadPoints;
9091
const int sdim = rd.geometry.spaceDimension;
@@ -309,7 +310,7 @@ void RCSSurfacePostProcessor::computeAndWriteResults(
309310
auto mesh = Mesh::LoadFromFile(rp + "/mesh", 1, 0);
310311
auto pmesh = ParMesh(MPI_COMM_WORLD, mesh);
311312
int order = determineFECOrder(pmesh, nDofs);
312-
DG_FECollection fec(order, pmesh.Dimension());
313+
DG_FECollection fec(order, pmesh.Dimension(), rd.geometry.basisType);
313314
ParFiniteElementSpace fes(&pmesh, &fec);
314315
std::cout << " done. (FEC order: " << order << ")\n";
315316

src/components/RCSSurfacePostProcessor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ struct RCSSurfaceGeometry {
1313
int numDofs;
1414
int numBdrElements;
1515
int numQuadPoints;
16+
int basisType;
1617

1718
std::vector<double> positions; // [numQuadPoints * spaceDimension]
1819
std::vector<double> normals; // [numQuadPoints * 3]

0 commit comments

Comments
 (0)