From 86ce3da4efe30acced56bef1bd07ac4b6007977e Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 7 Mar 2013 18:51:36 +0000 Subject: [PATCH] [1D] Save and restore grid refinement parameters --- src/oneD/StFlow.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/oneD/StFlow.cpp b/src/oneD/StFlow.cpp index 20eab09ca..e00dc30cf 100644 --- a/src/oneD/StFlow.cpp +++ b/src/oneD/StFlow.cpp @@ -909,6 +909,13 @@ void StFlow::restore(const XML_Node& dom, doublereal* soln, int loglevel) int2str(x.size()) + "but should be length" + int2str(m_nsp)); } + + if (dom.hasChild("refine_criteria")) { + XML_Node& ref = dom.child("refine_criteria"); + refiner().setCriteria(getFloat(ref, "ratio"), getFloat(ref, "slope"), + getFloat(ref, "curve"), getFloat(ref, "prune")); + refiner().setGridMin(getFloat(ref, "grid_min")); + } } @@ -967,6 +974,13 @@ XML_Node& StFlow::save(XML_Node& o, const doublereal* const sol) } addNamedFloatArray(flow, "species_enabled", m_nsp, &values[0]); + XML_Node& ref = flow.addChild("refine_criteria"); + addFloat(ref, "ratio", refiner().maxRatio()); + addFloat(ref, "slope", refiner().maxDelta()); + addFloat(ref, "curve", refiner().maxSlope()); + addFloat(ref, "prune", refiner().prune()); + addFloat(ref, "grid_min", refiner().gridMin()); + return flow; }