mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: sampling: add offsetMode to patchInternalField sampleSurface
This commit is contained in:
@ -58,24 +58,80 @@ Foam::sampledPatchInternalField::sampledPatchInternalField
|
||||
sampledPatch(name, mesh, dict),
|
||||
mappers_(patchIDs().size())
|
||||
{
|
||||
const scalar distance = readScalar(dict.lookup("distance"));
|
||||
|
||||
forAll(patchIDs(), i)
|
||||
mappedPatchBase::offsetMode mode = mappedPatchBase::NORMAL;
|
||||
if (dict.found("offsetMode"))
|
||||
{
|
||||
label patchI = patchIDs()[i];
|
||||
mappers_.set
|
||||
mode = mappedPatchBase::offsetModeNames_.read
|
||||
(
|
||||
i,
|
||||
new mappedPatchBase
|
||||
(
|
||||
mesh.boundaryMesh()[patchI],
|
||||
mesh.name(), // sampleRegion
|
||||
mappedPatchBase::NEARESTCELL, // sampleMode
|
||||
word::null, // samplePatch
|
||||
-distance // sample inside my domain
|
||||
)
|
||||
dict.lookup("offsetMode")
|
||||
);
|
||||
}
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case mappedPatchBase::NORMAL:
|
||||
{
|
||||
const scalar distance = readScalar(dict.lookup("distance"));
|
||||
forAll(patchIDs(), i)
|
||||
{
|
||||
mappers_.set
|
||||
(
|
||||
i,
|
||||
new mappedPatchBase
|
||||
(
|
||||
mesh.boundaryMesh()[patchIDs()[i]],
|
||||
mesh.name(), // sampleRegion
|
||||
mappedPatchBase::NEARESTCELL, // sampleMode
|
||||
word::null, // samplePatch
|
||||
-distance // sample inside my domain
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case mappedPatchBase::UNIFORM:
|
||||
{
|
||||
const point offset(dict.lookup("offset"));
|
||||
forAll(patchIDs(), i)
|
||||
{
|
||||
mappers_.set
|
||||
(
|
||||
i,
|
||||
new mappedPatchBase
|
||||
(
|
||||
mesh.boundaryMesh()[patchIDs()[i]],
|
||||
mesh.name(), // sampleRegion
|
||||
mappedPatchBase::NEARESTCELL, // sampleMode
|
||||
word::null, // samplePatch
|
||||
offset // sample inside my domain
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case mappedPatchBase::NONUNIFORM:
|
||||
{
|
||||
const pointField offsets(dict.lookup("offsets"));
|
||||
forAll(patchIDs(), i)
|
||||
{
|
||||
mappers_.set
|
||||
(
|
||||
i,
|
||||
new mappedPatchBase
|
||||
(
|
||||
mesh.boundaryMesh()[patchIDs()[i]],
|
||||
mesh.name(), // sampleRegion
|
||||
mappedPatchBase::NEARESTCELL, // sampleMode
|
||||
word::null, // samplePatch
|
||||
offsets // sample inside my domain
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user