Skip to content

Commit

Permalink
Merge pull request #583 from xylar/fix-mesh-density-in-converter
Browse files Browse the repository at this point in the history
Add `meshDensity` in mesh conversion if not already present
  • Loading branch information
xylar authored Sep 26, 2024
2 parents 2a46cbe + a9d730f commit 20b3ca4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,14 @@ int readGridInput(const string inputFilename){/*{{{*/

meshDensity.clear();
meshDensity.resize(cells.size());
ncutil::get_var(inputFilename, "meshDensity", &meshDensity[0]);
try {
ncutil::get_var(inputFilename, "meshDensity", &meshDensity[0]);
} catch (...) {
// should be all ones by default
for(int i = 0; i < nCells; i++){
meshDensity[i] = 1.0;
}
}

xCellDistance = fabs(xCellRange[1] - xCellRange[0]);
yCellDistance = fabs(yCellRange[1] - yCellRange[0]);
Expand Down

0 comments on commit 20b3ca4

Please sign in to comment.