Skip to content
Snippets Groups Projects
Commit f5310ca4 authored by Cristóbal Ibáñez's avatar Cristóbal Ibáñez Committed by mattijs
Browse files

ENH: cyclicAMI-topoChange: allow restart. Fixes #3265

parent 7f1120f6
1 merge request!722RELEASE: develop branch to master
......@@ -27,6 +27,7 @@ It is likely incomplete...
- Bernhard Gschaider
- Andrew Heather
- David Hill
- Cristbal Ibez
- Yoshiaki Inoue
- Mattijs Janssens
- Andrew Jackson
......
......@@ -31,6 +31,7 @@ License
#include "volFields.H"
#include "surfaceFields.H"
#include "cyclicAMIPolyPatch.H"
#include "cyclicACMIPolyPatch.H"
#include "polyTopoChange.H"
#include "MeshObject.H"
#include "lduMesh.H"
......@@ -83,6 +84,35 @@ bool Foam::dynamicMotionSolverFvMeshAMI::init(const bool doInit)
}
motionPtr_ = motionSolver::New(*this);
// allow restarts during initialization to match patch field values if
// required
const auto& pbm = boundaryMesh();
bool changeRequired = false;
for (label patchi = 0; patchi < pbm.nNonProcessor(); ++patchi)
{
const auto* cycAmiPtr = isA<cyclicAMIPolyPatch>(pbm[patchi]);
if (cycAmiPtr)
{
changeRequired = cycAmiPtr->createAMIFaces() || changeRequired;
}
else
{
const auto* cycAcmiPtr = isA<cyclicACMIPolyPatch>(pbm[patchi]);
if (cycAcmiPtr)
{
changeRequired =
cycAcmiPtr->cyclicAMIPolyPatch::createAMIFaces()
|| changeRequired;
}
}
}
if (returnReduceOr(changeRequired))
{
update();
}
return true;
}
......
......@@ -32,7 +32,7 @@ writeInterval 0.1;
purgeWrite 0;
writeFormat ascii;
writeFormat binary; //ascii;
writePrecision 6;
......
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