AMIInterpolation, cyclicAMI: Removed
AMIInterpolation and cyclicAMI have been superseded by patchToPatch and
nonConformalCoupled, respectively.
The motivation behind this change is explained in the following article:
https://cfd.direct/openfoam/free-software/non-conformal-coupling/
Information about how to convert a case which uses cyclicAMI to
nonConformalCoupled can be found here:
https://cfd.direct/openfoam/free-software/using-non-conformal-coupling/
This commit is contained in:
@ -84,13 +84,10 @@ void Foam::conformalVoronoiMesh::selectSeparatedCoupledFaces
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
// Check all coupled. Avoid using .coupled() so we also pick up AMI.
|
||||
if (isA<coupledPolyPatch>(patches[patchi]))
|
||||
{
|
||||
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
||||
(
|
||||
patches[patchi]
|
||||
);
|
||||
const coupledPolyPatch& cpp =
|
||||
refCast<const coupledPolyPatch>(patches[patchi]);
|
||||
|
||||
if (cpp.transform().transformsPosition())
|
||||
{
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
#include "setWriter.H"
|
||||
|
||||
#include "checkTools.H"
|
||||
#include "cyclicAMIPolyPatch.H"
|
||||
#include "Time.H"
|
||||
|
||||
// Find wedge with opposite orientation. Note: does not actually check that
|
||||
@ -479,107 +478,6 @@ bool Foam::checkCoupledPoints
|
||||
}
|
||||
|
||||
|
||||
void Foam::writeAMIWeightsSum
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const primitivePatch& patch,
|
||||
const scalarField& wghtSum,
|
||||
const fileName& file
|
||||
)
|
||||
{
|
||||
// Collect geometry
|
||||
labelList pointToGlobal;
|
||||
labelList uniqueMeshPointLabels;
|
||||
autoPtr<globalIndex> globalPoints;
|
||||
autoPtr<globalIndex> globalFaces;
|
||||
faceList mergedFaces;
|
||||
pointField mergedPoints;
|
||||
Foam::PatchTools::gatherAndMerge
|
||||
(
|
||||
mesh,
|
||||
patch.localFaces(),
|
||||
patch.meshPoints(),
|
||||
patch.meshPointMap(),
|
||||
|
||||
pointToGlobal,
|
||||
uniqueMeshPointLabels,
|
||||
globalPoints,
|
||||
globalFaces,
|
||||
|
||||
mergedFaces,
|
||||
mergedPoints
|
||||
);
|
||||
|
||||
// Collect field
|
||||
scalarField mergedWeights;
|
||||
globalFaces().gather
|
||||
(
|
||||
UPstream::worldComm,
|
||||
labelList(UPstream::procID(UPstream::worldComm)),
|
||||
wghtSum,
|
||||
mergedWeights
|
||||
);
|
||||
|
||||
// Write the surface
|
||||
if (Pstream::master())
|
||||
{
|
||||
vtkSurfaceWriter
|
||||
(
|
||||
mesh.time().writeFormat(),
|
||||
mesh.time().writeCompression()
|
||||
).write
|
||||
(
|
||||
file.path(),
|
||||
"weightsSum_" + file.name(),
|
||||
mergedPoints,
|
||||
mergedFaces,
|
||||
false,
|
||||
"weightsSum",
|
||||
mergedWeights
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::writeAMIWeightsSums(const polyMesh& mesh)
|
||||
{
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
|
||||
const word tmName(mesh.time().timeName());
|
||||
|
||||
forAll(pbm, patchi)
|
||||
{
|
||||
if (isA<cyclicAMIPolyPatch>(pbm[patchi]))
|
||||
{
|
||||
const cyclicAMIPolyPatch& cpp =
|
||||
refCast<const cyclicAMIPolyPatch>(pbm[patchi]);
|
||||
|
||||
if (cpp.owner())
|
||||
{
|
||||
Info<< "Calculating AMI weights between owner patch: "
|
||||
<< cpp.name() << " and neighbour patch: "
|
||||
<< cpp.nbrPatch().name() << endl;
|
||||
|
||||
writeAMIWeightsSum
|
||||
(
|
||||
mesh,
|
||||
cpp,
|
||||
cpp.weightsSum(),
|
||||
fileName("postProcessing") / "src_" + tmName
|
||||
);
|
||||
writeAMIWeightsSum
|
||||
(
|
||||
mesh,
|
||||
cpp.nbrPatch(),
|
||||
cpp.nbrWeightsSum(),
|
||||
fileName("postProcessing") / "tgt_" + tmName
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::checkGeometry
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
@ -1044,10 +942,5 @@ Foam::label Foam::checkGeometry
|
||||
}
|
||||
}
|
||||
|
||||
if (allGeometry)
|
||||
{
|
||||
writeAMIWeightsSums(mesh);
|
||||
}
|
||||
|
||||
return noFailedChecks;
|
||||
}
|
||||
|
||||
@ -23,18 +23,6 @@ namespace Foam
|
||||
//- Check 0th vertex on coupled faces
|
||||
bool checkCoupledPoints(const polyMesh&, const bool report, labelHashSet*);
|
||||
|
||||
//- Write out the weights-sums on all the AMI patches
|
||||
void writeAMIWeightsSums(const polyMesh&);
|
||||
|
||||
//- Write out the weights-sum on the given AMI patch
|
||||
void writeAMIWeightsSum
|
||||
(
|
||||
const polyMesh&,
|
||||
const primitivePatch&,
|
||||
const scalarField&,
|
||||
const fileName&
|
||||
);
|
||||
|
||||
label checkGeometry
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
|
||||
@ -37,7 +37,6 @@ Description
|
||||
#include "fvMesh.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "vtkSurfaceWriter.H"
|
||||
#include "cyclicAMIPolyPatch.H"
|
||||
#include "PatchTools.H"
|
||||
#include "checkGeometry.H"
|
||||
|
||||
@ -48,12 +47,6 @@ using namespace Foam;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "addRegionOption.H"
|
||||
argList::addBoolOption
|
||||
(
|
||||
"checkAMI",
|
||||
"check AMI weights"
|
||||
);
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
@ -84,13 +77,6 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
);
|
||||
|
||||
const bool checkAMI = args.optionFound("checkAMI");
|
||||
|
||||
if (checkAMI)
|
||||
{
|
||||
Info<< "Writing VTK files with weights of AMI patches." << nl << endl;
|
||||
}
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
while (runTime.run())
|
||||
@ -113,11 +99,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
mesh.checkMesh(true);
|
||||
|
||||
if (checkAMI)
|
||||
{
|
||||
writeAMIWeightsSums(mesh);
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
|
||||
Reference in New Issue
Block a user