Commit 216ea917 authored by daniele.corallo's avatar daniele.corallo
Browse files

[403-add-stdist-warnings] rmv if for stDist, fixed communication of Timesteps

parent 6a356742
...@@ -1046,17 +1046,17 @@ void Distribution::DistributeSTMesh(Mesh &mesh) { ...@@ -1046,17 +1046,17 @@ void Distribution::DistributeSTMesh(Mesh &mesh) {
int L0 = rekDepth; int L0 = rekDepth;
for (int i = 0; i < rekDepth; ++i) { for (int i = 0; i < rekDepth; ++i) {
if (L0 == 0) break; if (L0 == 0) break;
if (tL < Slice_Maximum && Slice_Maximum > 0) { if (tL < Slice_Maximum) {
++tL; ++tL;
--L0; --L0;
} }
if (L0 == 0) break; if (L0 == 0) break;
if (xL < X_Maximum && X_Maximum > 0) { if (xL < X_Maximum) {
++xL; ++xL;
--L0; --L0;
} }
if (L0 == 0) break; if (L0 == 0) break;
if (yL < Y_Maximum && Y_Maximum > 0) { if (yL < Y_Maximum) {
++yL; ++yL;
--L0; --L0;
} }
......
...@@ -77,7 +77,7 @@ std::vector<double> CoarseGeometry::refineTimeSteps(const std::vector<double> &t ...@@ -77,7 +77,7 @@ std::vector<double> CoarseGeometry::refineTimeSteps(const std::vector<double> &t
double dt = init_timesteps[S - 1][k + 2] - init_timesteps[S - 1][k + 1]; double dt = init_timesteps[S - 1][k + 2] - init_timesteps[S - 1][k + 1];
for (unsigned int l = 1; l < SF_inv; ++l) for (unsigned int l = 1; l < SF_inv; ++l)
init_timesteps[S][k * SF_inv + l + 1] = init_timesteps[S][k * SF_inv + l + 1] =
init_timesteps[S - 1][k + 1] + dt * 1 / double(SF_inv) * l; init_timesteps[S - 1][k + 1] + dt * 1 / double(SF_inv) * l;
} }
} }
return init_timesteps[refineTimeStepCount]; return init_timesteps[refineTimeStepCount];
...@@ -136,7 +136,7 @@ void CoarseGeometry::CommunicateGeometry() { ...@@ -136,7 +136,7 @@ void CoarseGeometry::CommunicateGeometry() {
ExchangeBuffer exBuffer; ExchangeBuffer exBuffer;
if (PPM->Master()) { if (PPM->Master()) {
for (int q = 1; q < PPM->Size(); ++q) { for (int q = 1; q < PPM->Size(); ++q) {
exBuffer.Send(q) << timeSteps.size(); exBuffer.Send(q) << int(timeSteps.size());
for (double timeStep : timeSteps) { for (double timeStep : timeSteps) {
exBuffer.Send(q) << double(timeStep); exBuffer.Send(q) << double(timeStep);
} }
...@@ -147,8 +147,9 @@ void CoarseGeometry::CommunicateGeometry() { ...@@ -147,8 +147,9 @@ void CoarseGeometry::CommunicateGeometry() {
int m; int m;
exBuffer.Receive(0) >> m; exBuffer.Receive(0) >> m;
timeSteps.resize(m); timeSteps.resize(m);
for (double & timeStep : timeSteps) { for (int i = 0; i < m; i++) {
exBuffer.Receive(0) >> timeStep; exBuffer.Receive(0) >> timeSteps[i];
} }
} }
exBuffer.ClearBuffers(); exBuffer.ClearBuffers();
...@@ -157,7 +158,7 @@ void CoarseGeometry::CommunicateGeometry() { ...@@ -157,7 +158,7 @@ void CoarseGeometry::CommunicateGeometry() {
CoarseGeometry::CoarseGeometry(const MeshPoints &points, const MeshCells &cells, CoarseGeometry::CoarseGeometry(const MeshPoints &points, const MeshCells &cells,
const MeshFaces &faces, const TimeSteps &timeSteps) : const MeshFaces &faces, const TimeSteps &timeSteps) :
timeSteps(timeSteps) { timeSteps(timeSteps) {
for (const auto &point : points) { for (const auto &point : points) {
double z[]{0.0, 0.0, 0.0, 0.0}; double z[]{0.0, 0.0, 0.0, 0.0};
for (int j = 0; j < min(3, int(point.size())); ++j) for (int j = 0; j < min(3, int(point.size())); ++j)
...@@ -175,8 +176,8 @@ void CoarseGeometry::Scale(double scalingFactor) { ...@@ -175,8 +176,8 @@ void CoarseGeometry::Scale(double scalingFactor) {
Logging &operator<<(Logging &s, const CoarseGeometry &M) { Logging &operator<<(Logging &s, const CoarseGeometry &M) {
return s << "POINTS: " << M.coordinates.size() << endl << M.coordinates return s << "POINTS: " << M.coordinates.size() << endl << M.coordinates
<< "CELLS: " << M.cellIds.size() << endl << M.cellIds << "CELLS: " << M.cellIds.size() << endl << M.cellIds
<< "FACES: " << M.faceIds.size() << endl << M.faceIds << "FACES: " << M.faceIds.size() << endl << M.faceIds
#ifdef USE_DATAMESH #ifdef USE_DATAMESH
<< "VDATA: " << M.vdataList.size() << endl << M.vdataList << "VDATA: " << M.vdataList.size() << endl << M.vdataList
<< "CDATA: " << M.cdataList.size() << endl << M.cdataList << "CDATA: " << M.cdataList.size() << endl << M.cdataList
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment