Commit 168b2468 authored by mattijs's avatar mattijs
Browse files

ENH: overset: additional debug. See #810.

parent be96876a
......@@ -53,7 +53,6 @@ mesh.setFluxRequired(p.name());
suppressDict.add("cellMask", true);
suppressDict.add("cellDisplacement", true);
suppressDict.add("interpolatedCells", true);
suppressDict.add("cellInterpolationWeight", true);
}
const_cast<dictionary&>
......
......@@ -1642,6 +1642,7 @@ Foam::cellCellStencils::inverseDistance::inverseDistance
// Protect local fields from interpolation
nonInterpolatedFields_.insert("cellInterpolationWeight");
nonInterpolatedFields_.insert("cellTypes");
nonInterpolatedFields_.insert("maxMagWeight");
// Read zoneID
this->zoneID();
......@@ -2066,6 +2067,9 @@ bool Foam::cellCellStencils::inverseDistance::update()
if (debug&2)
{
// Dump mesh
mesh_.time().write();
// Dump stencil
mkDir(mesh_.time().timePath());
OBJstream str(mesh_.time().timePath()/"injectionStencil.obj");
......@@ -2100,29 +2104,79 @@ bool Foam::cellCellStencils::inverseDistance::update()
cellInterpolationWeight_.instance() = mesh_.time().timeName();
cellInterpolationWeight_.write();
// Dump cell types
volScalarField volTypes
(
IOobject
// Dump max weight
{
volScalarField maxMagWeight
(
"cellTypes",
mesh_.time().timeName(),
IOobject
(
"maxMagWeight",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh_,
dimensionedScalar(dimless, Zero),
zeroGradientFvPatchScalarField::typeName
);
dimensionedScalar(dimless, Zero),
zeroGradientFvPatchScalarField::typeName
);
forAll(cellStencil_, celli)
{
const scalarList& wghts = cellInterpolationWeights_[celli];
forAll(wghts, i)
{
if (mag(wghts[i]) > mag(maxMagWeight[celli]))
{
maxMagWeight[celli] = wghts[i];
}
}
if (mag(maxMagWeight[celli]) > 1)
{
const pointField& cc = mesh_.cellCentres();
Pout<< "cell:" << celli
<< " at:" << cc[celli]
<< " zone:" << zoneID[celli]
<< " donors:" << cellStencil_[celli]
<< " weights:" << wghts
<< " coords:"
<< UIndirectList<point>(cc, cellStencil_[celli])
<< " donorZone:"
<< UIndirectList<label>(zoneID, cellStencil_[celli])
<< endl;
}
}
maxMagWeight.correctBoundaryConditions();
maxMagWeight.write();
}
forAll(volTypes.internalField(), cellI)
// Dump cell types
{
volTypes[cellI] = cellTypes_[cellI];
volScalarField volTypes
(
IOobject
(
"cellTypes",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh_,
dimensionedScalar(dimless, Zero),
zeroGradientFvPatchScalarField::typeName
);
forAll(volTypes.internalField(), cellI)
{
volTypes[cellI] = cellTypes_[cellI];
}
volTypes.correctBoundaryConditions();
volTypes.write();
}
volTypes.correctBoundaryConditions();
volTypes.write();
// Dump stencil
mkDir(mesh_.time().timePath());
......
Supports Markdown
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