mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of develop.openfoam.com:Development/OpenFOAM-plus into feature-shared-file
Conflicts: applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/pointFile/pointFile.C applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundary.C applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/vtkPV4Foam/vtkPV4FoamUpdateInfo.C applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C applications/utilities/postProcessing/velocityField/Co/Co.C applications/utilities/postProcessing/velocityField/Pe/Pe.C applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C applications/utilities/preProcessing/changeDictionary/changeDictionary.C applications/utilities/preProcessing/setFields/setFields.C applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C applications/utilities/surface/surfaceRedistributePar/surfaceRedistributePar.C src/OpenFOAM/db/IOobject/IOobject.C src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C src/OpenFOAM/db/IOobjects/IOField/IOField.C src/OpenFOAM/db/IOobjects/IOList/IOList.C src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C src/OpenFOAM/db/Time/findInstance.C src/OpenFOAM/db/regIOobject/regIOobject.C src/OpenFOAM/db/regIOobject/regIOobjectI.H src/OpenFOAM/db/regIOobject/regIOobjectRead.C src/OpenFOAM/db/regIOobject/regIOobjectWrite.C src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/IOmapDistribute.C src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C src/dynamicMesh/fvMeshDistribute/IOmapDistributePolyMesh.C src/dynamicMesh/motionSolver/componentDisplacement/componentDisplacementMotionSolver.C src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8Data.C src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C src/edgeMesh/edgeMeshFormats/edgeMesh/edgeMeshFormat.C src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormat.C src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C src/fvMotionSolver/pointPatchFields/derived/uniformInterpolatedDisplacement/uniformInterpolatedDisplacementPointPatchVectorField.C src/lagrangian/basic/Cloud/CloudIO.C src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C src/postProcessing/foamCalcFunctions/basic/addSubtract/addSubtract.C src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C src/triSurface/triSurface/surfacePatch/surfacePatchIOList.C
This commit is contained in:
@ -43,7 +43,6 @@ surfWriters = sampledSurface/writers
|
||||
$(surfWriters)/surfaceWriter.C
|
||||
$(surfWriters)/dx/dxSurfaceWriter.C
|
||||
$(surfWriters)/ensight/ensightSurfaceWriter.C
|
||||
$(surfWriters)/ensight/ensightPTraits.C
|
||||
$(surfWriters)/foamFile/foamFileSurfaceWriter.C
|
||||
$(surfWriters)/nastran/nastranSurfaceWriter.C
|
||||
$(surfWriters)/proxy/proxySurfaceWriter.C
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -203,7 +203,7 @@ bool Foam::cuttingPlane::walkCell
|
||||
if (nextEdgeI == -1)
|
||||
{
|
||||
// Did not find another cut edge on faceI. Do what?
|
||||
WarningIn("Foam::cuttingPlane::walkCell")
|
||||
WarningInFunction
|
||||
<< "Did not find closed walk along surface of cell " << cellI
|
||||
<< " starting from edge " << startEdgeI
|
||||
<< " in " << nIter << " iterations." << nl
|
||||
@ -219,7 +219,7 @@ bool Foam::cuttingPlane::walkCell
|
||||
|
||||
if (nIter > 1000)
|
||||
{
|
||||
WarningIn("Foam::cuttingPlane::walkCell")
|
||||
WarningInFunction
|
||||
<< "Did not find closed walk along surface of cell " << cellI
|
||||
<< " starting from edge " << startEdgeI
|
||||
<< " in " << nIter << " iterations." << nl
|
||||
@ -237,7 +237,7 @@ bool Foam::cuttingPlane::walkCell
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn("Foam::cuttingPlane::walkCell")
|
||||
WarningInFunction
|
||||
<< "Did not find closed walk along surface of cell " << cellI
|
||||
<< " starting from edge " << startEdgeI << nl
|
||||
<< "Collected cutPoints so far:" << faceVerts
|
||||
@ -287,7 +287,7 @@ void Foam::cuttingPlane::walkCellCuts
|
||||
// Check for the unexpected ...
|
||||
if (startEdgeI == -1)
|
||||
{
|
||||
FatalErrorIn("Foam::cuttingPlane::walkCellCuts(..)")
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find cut edge for cut cell " << cellI
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -413,7 +413,7 @@ void Foam::cuttingPlane::operator=(const cuttingPlane& rhs)
|
||||
// Check for assignment to self
|
||||
if (this == &rhs)
|
||||
{
|
||||
FatalErrorIn ("Foam::cuttingPlane::operator=(const cuttingPlane&)")
|
||||
FatalErrorInFunction
|
||||
<< "Attempted assignment to self"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ void Foam::cellVolumeWeightMethod::calculateAddressing
|
||||
|
||||
if (mag(srcVol) > ROOTVSMALL && mag((tgtVol-srcVol)/srcVol) > 1e-6)
|
||||
{
|
||||
WarningIn("cellVolumeWeightMethod::calculateAddressing(..)")
|
||||
WarningInFunction
|
||||
<< "At cell " << cellI << " cc:"
|
||||
<< src_.cellCentres()[cellI]
|
||||
<< " vol:" << srcVol
|
||||
@ -215,7 +215,7 @@ void Foam::cellVolumeWeightMethod::calculateAddressing
|
||||
|
||||
if (mag(tgtVol) > ROOTVSMALL && mag((srcVol-tgtVol)/tgtVol) > 1e-6)
|
||||
{
|
||||
WarningIn("cellVolumeWeightMethod::calculateAddressing(..)")
|
||||
WarningInFunction
|
||||
<< "At cell " << cellI << " cc:"
|
||||
<< tgt_.cellCentres()[cellI]
|
||||
<< " vol:" << tgtVol
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -164,10 +164,8 @@ void Foam::correctedCellVolumeWeightMethod::calculateAddressing
|
||||
|
||||
if (mag(srcVol) > ROOTVSMALL && mag((tgtVol-srcVol)/srcVol) > 1e-6)
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"correctedCellVolumeWeightMethod::calculateAddressing(..)"
|
||||
) << "At cell " << cellI << " cc:"
|
||||
WarningInFunction
|
||||
<< "At cell " << cellI << " cc:"
|
||||
<< src_.cellCentres()[cellI]
|
||||
<< " vol:" << srcVol
|
||||
<< " total overlap volume:" << tgtVol
|
||||
@ -182,10 +180,8 @@ void Foam::correctedCellVolumeWeightMethod::calculateAddressing
|
||||
|
||||
if (mag(tgtVol) > ROOTVSMALL && mag((srcVol-tgtVol)/tgtVol) > 1e-6)
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"correctedCellVolumeWeightMethod::calculateAddressing(..)"
|
||||
) << "At cell " << cellI << " cc:"
|
||||
WarningInFunction
|
||||
<< "At cell " << cellI << " cc:"
|
||||
<< tgt_.cellCentres()[cellI]
|
||||
<< " vol:" << tgtVol
|
||||
<< " total overlap volume:" << srcVol
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -69,17 +69,7 @@ bool Foam::mapNearestMethod::findInitialSeeds
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"bool Foam::mapNearestMethod::findInitialSeeds"
|
||||
"("
|
||||
"const labelList&, "
|
||||
"const boolList&, "
|
||||
"const label, "
|
||||
"label&, "
|
||||
"label&"
|
||||
") const"
|
||||
)
|
||||
FatalErrorInFunction
|
||||
<< "Unable to find nearest target cell"
|
||||
<< " for source cell " << srcI
|
||||
<< " with centre " << srcCc
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -44,15 +44,8 @@ Foam::autoPtr<Foam::meshToMeshMethod> Foam::meshToMeshMethod::New
|
||||
|
||||
if (cstrIter == componentsConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::autoPtr<Foam::meshToMeshMethod> Foam::meshToMeshMethod::New"
|
||||
"("
|
||||
"const word&, "
|
||||
"const polyMesh&, "
|
||||
"const polyMesh&"
|
||||
")"
|
||||
) << "Unknown meshToMesh type "
|
||||
FatalErrorInFunction
|
||||
<< "Unknown meshToMesh type "
|
||||
<< methodName << nl << nl
|
||||
<< "Valid meshToMesh types are:" << nl
|
||||
<< componentsConstructorTablePtr_->sortedToc() << exit(FatalError);
|
||||
|
||||
@ -87,11 +87,8 @@ public:
|
||||
|
||||
if ((singlePatchProc_ == -1) != (distMapPtr_ != NULL))
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"distributedWeightedFvPatchFieldMapper::"
|
||||
"distributedWeightedFvPatchFieldMapper(..)"
|
||||
) << "Supply a mapDistributeBase if and only if "
|
||||
FatalErrorInFunction
|
||||
<< "Supply a mapDistributeBase if and only if "
|
||||
<< "singlePatchProc is -1"
|
||||
<< " singlePatchProc_:" << singlePatchProc_
|
||||
<< " distMapPtr_:" << (distMapPtr_ != NULL)
|
||||
@ -132,11 +129,8 @@ public:
|
||||
{
|
||||
if (!distMapPtr_)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"distributedWeightedFvPatchFieldMapper::"
|
||||
"distributeMap()"
|
||||
) << "Cannot ask for distributeMap on a non-distributed"
|
||||
FatalErrorInFunction
|
||||
<< "Cannot ask for distributeMap on a non-distributed"
|
||||
<< " mapper" << exit(FatalError);
|
||||
}
|
||||
return *distMapPtr_;
|
||||
|
||||
@ -640,14 +640,7 @@ Foam::meshToMesh::interpolationMethodAMI(const interpolationMethod method)
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::AMIPatchToPatchInterpolation::interpolationMethod"
|
||||
"Foam::meshToMesh::interpolationMethodAMI"
|
||||
"("
|
||||
"const interpolationMethod method"
|
||||
") const"
|
||||
)
|
||||
FatalErrorInFunction
|
||||
<< "Unhandled enumeration " << method
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -661,7 +654,7 @@ void Foam::meshToMesh::calculatePatchAMIs(const word& AMIMethodName)
|
||||
{
|
||||
if (!patchAMIs_.empty())
|
||||
{
|
||||
FatalErrorIn("meshToMesh::calculatePatchAMIs()")
|
||||
FatalErrorInFunction
|
||||
<< "patch AMI already calculated"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -732,16 +725,8 @@ void Foam::meshToMesh::constructNoCuttingPatches
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::meshToMesh::meshToMesh"
|
||||
"("
|
||||
"const polyMesh&, "
|
||||
"const polyMesh&, "
|
||||
"const interpolationMethod&, "
|
||||
"bool"
|
||||
")"
|
||||
) << "Source patch " << pp.name()
|
||||
FatalErrorInFunction
|
||||
<< "Source patch " << pp.name()
|
||||
<< " not found in target mesh. "
|
||||
<< "Available target patches are " << tgtBM.names()
|
||||
<< exit(FatalError);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -794,21 +794,7 @@ void Foam::meshToMesh::distributeAndMergeCells
|
||||
|
||||
if (tgtFaceI == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::meshToMesh::"
|
||||
"distributeAndMergeCells"
|
||||
"("
|
||||
"const mapDistribute&, "
|
||||
"const polyMesh&, "
|
||||
"const globalIndex&, "
|
||||
"pointField&, "
|
||||
"faceList&, "
|
||||
"labelList&, "
|
||||
"labelList&, "
|
||||
"labelList&"
|
||||
") const"
|
||||
)
|
||||
FatalErrorInFunction
|
||||
<< "Unvisited " << key
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -88,15 +88,8 @@ void Foam::meshToMesh::mapSrcToTgt
|
||||
{
|
||||
if (result.size() != tgtToSrcCellAddr_.size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::meshToMesh::mapSrcToTgt"
|
||||
"("
|
||||
"const UList<Type>&, "
|
||||
"const CombineOp&, "
|
||||
"List<Type>&"
|
||||
") const"
|
||||
) << "Supplied field size is not equal to target mesh size" << nl
|
||||
FatalErrorInFunction
|
||||
<< "Supplied field size is not equal to target mesh size" << nl
|
||||
<< " source mesh = " << srcToTgtCellAddr_.size() << nl
|
||||
<< " target mesh = " << tgtToSrcCellAddr_.size() << nl
|
||||
<< " supplied field = " << result.size()
|
||||
@ -162,16 +155,8 @@ void Foam::meshToMesh::mapSrcToTgt
|
||||
{
|
||||
if (result.size() != tgtToSrcCellAddr_.size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::meshToMesh::mapSrcToTgt"
|
||||
"("
|
||||
"const UList<Type>&, "
|
||||
"const UList<typename outerProduct<vector, Type>::type>&, "
|
||||
"const CombineOp&, "
|
||||
"List<Type>&"
|
||||
") const"
|
||||
) << "Supplied field size is not equal to target mesh size" << nl
|
||||
FatalErrorInFunction
|
||||
<< "Supplied field size is not equal to target mesh size" << nl
|
||||
<< " source mesh = " << srcToTgtCellAddr_.size() << nl
|
||||
<< " target mesh = " << tgtToSrcCellAddr_.size() << nl
|
||||
<< " supplied field = " << result.size()
|
||||
@ -316,15 +301,8 @@ void Foam::meshToMesh::mapTgtToSrc
|
||||
{
|
||||
if (result.size() != srcToTgtCellAddr_.size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::meshToMesh::mapTgtToSrc"
|
||||
"("
|
||||
"const UList<Type>&, "
|
||||
"const CombineOp&, "
|
||||
"List<Type>&"
|
||||
") const"
|
||||
) << "Supplied field size is not equal to source mesh size" << nl
|
||||
FatalErrorInFunction
|
||||
<< "Supplied field size is not equal to source mesh size" << nl
|
||||
<< " source mesh = " << srcToTgtCellAddr_.size() << nl
|
||||
<< " target mesh = " << tgtToSrcCellAddr_.size() << nl
|
||||
<< " supplied field = " << result.size()
|
||||
@ -390,16 +368,8 @@ void Foam::meshToMesh::mapTgtToSrc
|
||||
{
|
||||
if (result.size() != srcToTgtCellAddr_.size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::meshToMesh::mapTgtToSrc"
|
||||
"("
|
||||
"const UList<Type>&, "
|
||||
"const UList<typename outerProduct<vector, Type>::type>&, "
|
||||
"const CombineOp&, "
|
||||
"List<Type>&"
|
||||
") const"
|
||||
) << "Supplied field size is not equal to source mesh size" << nl
|
||||
FatalErrorInFunction
|
||||
<< "Supplied field size is not equal to source mesh size" << nl
|
||||
<< " source mesh = " << srcToTgtCellAddr_.size() << nl
|
||||
<< " target mesh = " << tgtToSrcCellAddr_.size() << nl
|
||||
<< " supplied field = " << result.size()
|
||||
|
||||
@ -153,7 +153,7 @@ void Foam::meshToMesh0::calcAddressing()
|
||||
|
||||
if (fromPatch.empty())
|
||||
{
|
||||
WarningIn("meshToMesh0::calcAddressing()")
|
||||
WarningInFunction
|
||||
<< "Source patch " << fromPatch.name()
|
||||
<< " has no faces. Not performing mapping for it."
|
||||
<< endl;
|
||||
|
||||
@ -38,7 +38,7 @@ void Foam::meshToMesh0::calculateInverseDistanceWeights() const
|
||||
|
||||
if (inverseDistanceWeightsPtr_)
|
||||
{
|
||||
FatalErrorIn("meshToMesh0::calculateInverseDistanceWeights()")
|
||||
FatalErrorInFunction
|
||||
<< "weighting factors already calculated"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -140,7 +140,7 @@ void Foam::meshToMesh0::calculateInverseVolumeWeights() const
|
||||
|
||||
if (inverseVolumeWeightsPtr_)
|
||||
{
|
||||
FatalErrorIn("meshToMesh0::calculateInverseVolumeWeights()")
|
||||
FatalErrorInFunction
|
||||
<< "weighting factors already calculated"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -203,7 +203,7 @@ void Foam::meshToMesh0::calculateCellToCellAddressing() const
|
||||
|
||||
if (cellToCellAddressingPtr_)
|
||||
{
|
||||
FatalErrorIn("meshToMesh0::calculateCellToCellAddressing()")
|
||||
FatalErrorInFunction
|
||||
<< "addressing already calculated"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -87,13 +87,8 @@ Foam::meshToMesh0::meshToMesh0
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"meshToMesh0::meshToMesh0"
|
||||
"(const fvMesh& meshFrom, const fvMesh& meshTo,"
|
||||
"const HashTable<word>& patchMap,"
|
||||
"const wordList& cuttingPatchNames)"
|
||||
) << "Cannot find cutting-patch " << cuttingPatchNames[i]
|
||||
WarningInFunction
|
||||
<< "Cannot find cutting-patch " << cuttingPatchNames[i]
|
||||
<< " in destination mesh" << endl;
|
||||
}
|
||||
}
|
||||
@ -134,11 +129,8 @@ Foam::meshToMesh0::meshToMesh0
|
||||
// of boundary patches
|
||||
if (fromMesh_.boundary().size() != toMesh_.boundary().size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"meshToMesh0::meshToMesh0"
|
||||
"(const fvMesh& meshFrom, const fvMesh& meshTo)"
|
||||
) << "Incompatible meshes: different number of patches, "
|
||||
FatalErrorInFunction
|
||||
<< "Incompatible meshes: different number of patches, "
|
||||
<< "fromMesh = " << fromMesh_.boundary().size()
|
||||
<< ", toMesh = " << toMesh_.boundary().size()
|
||||
<< exit(FatalError);
|
||||
@ -152,11 +144,8 @@ Foam::meshToMesh0::meshToMesh0
|
||||
!= toMesh_.boundaryMesh()[patchi].name()
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"meshToMesh0::meshToMesh0"
|
||||
"(const fvMesh& meshFrom, const fvMesh& meshTo)"
|
||||
) << "Incompatible meshes: different patch names for patch "
|
||||
FatalErrorInFunction
|
||||
<< "Incompatible meshes: different patch names for patch "
|
||||
<< patchi
|
||||
<< ", fromMesh = " << fromMesh_.boundary()[patchi].name()
|
||||
<< ", toMesh = " << toMesh_.boundary()[patchi].name()
|
||||
@ -169,11 +158,8 @@ Foam::meshToMesh0::meshToMesh0
|
||||
!= toMesh_.boundaryMesh()[patchi].type()
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"meshToMesh0::meshToMesh0"
|
||||
"(const fvMesh& meshFrom, const fvMesh& meshTo)"
|
||||
) << "Incompatible meshes: different patch types for patch "
|
||||
FatalErrorInFunction
|
||||
<< "Incompatible meshes: different patch types for patch "
|
||||
<< patchi
|
||||
<< ", fromMesh = " << fromMesh_.boundary()[patchi].type()
|
||||
<< ", toMesh = " << toMesh_.boundary()[patchi].type()
|
||||
|
||||
@ -158,12 +158,8 @@ void Foam::meshToMesh0::interpolateInternalField
|
||||
{
|
||||
if (fromVf.mesh() != fromMesh_)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"meshToMesh0::interpolateInternalField(Field<Type>&, "
|
||||
"const GeometricField<Type, fvPatchField, volMesh>&, "
|
||||
"meshToMesh0::order, const CombineOp&) const"
|
||||
) << "the argument field does not correspond to the right mesh. "
|
||||
FatalErrorInFunction
|
||||
<< "the argument field does not correspond to the right mesh. "
|
||||
<< "Field size: " << fromVf.size()
|
||||
<< " mesh size: " << fromMesh_.nCells()
|
||||
<< exit(FatalError);
|
||||
@ -171,12 +167,8 @@ void Foam::meshToMesh0::interpolateInternalField
|
||||
|
||||
if (toF.size() != toMesh_.nCells())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"meshToMesh0::interpolateInternalField(Field<Type>&, "
|
||||
"const GeometricField<Type, fvPatchField, volMesh>&, "
|
||||
"meshToMesh0::order, const CombineOp&) const"
|
||||
) << "the argument field does not correspond to the right mesh. "
|
||||
FatalErrorInFunction
|
||||
<< "the argument field does not correspond to the right mesh. "
|
||||
<< "Field size: " << toF.size()
|
||||
<< " mesh size: " << toMesh_.nCells()
|
||||
<< exit(FatalError);
|
||||
@ -229,12 +221,8 @@ void Foam::meshToMesh0::interpolateInternalField
|
||||
break;
|
||||
}
|
||||
default:
|
||||
FatalErrorIn
|
||||
(
|
||||
"meshToMesh0::interpolateInternalField(Field<Type>&, "
|
||||
"const GeometricField<Type, fvPatchField, volMesh>&, "
|
||||
"meshToMesh0::order, const CombineOp&) const"
|
||||
) << "unknown interpolation scheme " << ord
|
||||
FatalErrorInFunction
|
||||
<< "unknown interpolation scheme " << ord
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
@ -317,13 +305,8 @@ void Foam::meshToMesh0::interpolate
|
||||
}
|
||||
|
||||
default:
|
||||
FatalErrorIn
|
||||
(
|
||||
"meshToMesh0::interpolate("
|
||||
"GeometricField<Type, fvPatchField, volMesh>&, "
|
||||
"const GeometricField<Type, fvPatchField, volMesh>&, "
|
||||
"meshToMesh0::order, const CombineOp&) const"
|
||||
) << "unknown interpolation scheme " << ord
|
||||
FatalErrorInFunction
|
||||
<< "unknown interpolation scheme " << ord
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -398,12 +381,8 @@ Foam::meshToMesh0::interpolate
|
||||
// of boundary patches
|
||||
if (fromMesh_.boundary().size() != toMesh_.boundary().size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"meshToMesh0::interpolate"
|
||||
"(const GeometricField<Type, fvPatchField, volMesh>&,"
|
||||
"meshToMesh0::order, const CombineOp&) const"
|
||||
) << "Incompatible meshes: different number of boundaries, "
|
||||
FatalErrorInFunction
|
||||
<< "Incompatible meshes: different number of boundaries, "
|
||||
"only internal field may be interpolated"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,32 +46,40 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
|
||||
const polyBoundaryMesh& bm = mesh.boundaryMesh();
|
||||
|
||||
label patchI = bm.findPatchID(patchName_);
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
" Foam::patchProbes::findElements(const fvMesh&)"
|
||||
) << " Unknown patch name "
|
||||
<< patchName_ << endl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
// All the info for nearest. Construct to miss
|
||||
// All the info for nearest. Construct to miss
|
||||
List<mappedPatchBase::nearInfo> nearest(this->size());
|
||||
|
||||
const polyPatch& pp = bm[patchI];
|
||||
const labelList patchIDs(bm.patchSet(patchNames_).sortedToc());
|
||||
|
||||
if (pp.size() > 0)
|
||||
label nFaces = 0;
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
labelList bndFaces(pp.size());
|
||||
forAll(bndFaces, i)
|
||||
nFaces += bm[patchIDs[i]].size();
|
||||
}
|
||||
|
||||
if (nFaces > 0)
|
||||
{
|
||||
// Collect mesh faces and bounding box
|
||||
labelList bndFaces(nFaces);
|
||||
treeBoundBox overallBb(treeBoundBox::invertedBox);
|
||||
|
||||
nFaces = 0;
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
bndFaces[i] = pp.start() + i;
|
||||
const polyPatch& pp = bm[patchIDs[i]];
|
||||
forAll(pp, i)
|
||||
{
|
||||
bndFaces[nFaces++] = pp.start()+i;
|
||||
const face& f = pp[i];
|
||||
forAll(f, fp)
|
||||
{
|
||||
const point& pt = pp.points()[f[fp]];
|
||||
overallBb.min() = min(overallBb.min(), pt);
|
||||
overallBb.max() = max(overallBb.max(), pt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
treeBoundBox overallBb(pp.points());
|
||||
Random rndGen(123456);
|
||||
overallBb = overallBb.extend(rndGen, 1e-4);
|
||||
overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
@ -106,11 +114,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
|
||||
if (!info.hit())
|
||||
{
|
||||
info = boundaryTree.findNearest
|
||||
(
|
||||
sample,
|
||||
Foam::sqr(GREAT)
|
||||
);
|
||||
info = boundaryTree.findNearest(sample, Foam::sqr(GREAT));
|
||||
}
|
||||
|
||||
label faceI = boundaryTree.shapes().faceLabels()[info.index()];
|
||||
@ -119,30 +123,33 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
|
||||
if (isA<emptyPolyPatch>(bm[patchi]))
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
" Foam::patchProbes::findElements(const fvMesh&)"
|
||||
)
|
||||
WarningInFunction
|
||||
<< " The sample point: " << sample
|
||||
<< " belongs to " << patchi
|
||||
<< " which is an empty patch. This is not permitted. "
|
||||
<< " This sample will not be included "
|
||||
<< endl;
|
||||
}
|
||||
else
|
||||
else if (info.hit())
|
||||
{
|
||||
const point& fc = mesh.faceCentres()[faceI];
|
||||
// Note: do we store the face centre or the actual nearest?
|
||||
// We interpolate using the faceI only though (no
|
||||
// interpolation) so it does not actually matter much, just for
|
||||
// the location written to the header.
|
||||
|
||||
//const point& facePt = mesh.faceCentres()[faceI];
|
||||
const point& facePt = info.hitPoint();
|
||||
|
||||
mappedPatchBase::nearInfo sampleInfo;
|
||||
|
||||
sampleInfo.first() = pointIndexHit
|
||||
(
|
||||
true,
|
||||
fc,
|
||||
facePt,
|
||||
faceI
|
||||
);
|
||||
|
||||
sampleInfo.second().first() = magSqr(fc-sample);
|
||||
sampleInfo.second().first() = magSqr(facePt-sample);
|
||||
sampleInfo.second().second() = Pstream::myProcNo();
|
||||
|
||||
nearest[probeI]= sampleInfo;
|
||||
@ -155,6 +162,14 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
Pstream::listCombineGather(nearest, mappedPatchBase::nearestEqOp());
|
||||
Pstream::listCombineScatter(nearest);
|
||||
|
||||
|
||||
// Update actual probe locations
|
||||
forAll(nearest, sampleI)
|
||||
{
|
||||
operator[](sampleI) = nearest[sampleI].first().rawPoint();
|
||||
}
|
||||
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "patchProbes::findElements" << " : " << endl;
|
||||
@ -165,26 +180,41 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
|
||||
Info<< " " << sampleI << " coord:"<< operator[](sampleI)
|
||||
<< " found on processor:" << procI
|
||||
<< " in local cell/face:" << localI
|
||||
<< " with fc:" << nearest[sampleI].first().rawPoint() << endl;
|
||||
<< " in local face:" << localI
|
||||
<< " with location:" << nearest[sampleI].first().rawPoint()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Extract any local faces to sample
|
||||
elementList_.setSize(nearest.size(), -1);
|
||||
elementList_.setSize(nearest.size());
|
||||
elementList_ = -1;
|
||||
faceList_.setSize(nearest.size());
|
||||
faceList_ = -1;
|
||||
|
||||
forAll(nearest, sampleI)
|
||||
{
|
||||
if (nearest[sampleI].second().second() == Pstream::myProcNo())
|
||||
{
|
||||
// Store the face to sample
|
||||
elementList_[sampleI] = nearest[sampleI].first().index();
|
||||
faceList_[sampleI] = nearest[sampleI].first().index();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::patchProbes::readDict(const dictionary& dict)
|
||||
{
|
||||
if (!dict.readIfPresent("patches", patchNames_))
|
||||
{
|
||||
word patchName(dict.lookup("patchName"));
|
||||
patchNames_ = wordReList(1, wordRe(patchName));
|
||||
}
|
||||
probes::readDict(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::patchProbes::patchProbes
|
||||
@ -192,19 +222,22 @@ Foam::patchProbes::patchProbes
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict,
|
||||
const bool loadFromFiles
|
||||
const bool loadFromFiles,
|
||||
const bool doFindElements
|
||||
)
|
||||
:
|
||||
probes(name, obr, dict, loadFromFiles)
|
||||
probes(name, obr, dict, loadFromFiles, false)
|
||||
{
|
||||
// When constructing probes above it will have called the
|
||||
// probes::findElements (since the virtual mechanism not yet operating).
|
||||
// Not easy to workaround (apart from feeding through flag into constructor)
|
||||
// so clear out any cells found for now.
|
||||
elementList_.clear();
|
||||
faceList_.clear();
|
||||
readDict(dict);
|
||||
|
||||
read(dict);
|
||||
if (doFindElements)
|
||||
{
|
||||
// Find the elements
|
||||
findElements(mesh_);
|
||||
|
||||
// Open the probe streams
|
||||
prepare();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -232,10 +265,16 @@ void Foam::patchProbes::write()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::patchProbes::read(const dictionary& dict)
|
||||
{
|
||||
dict.lookup("patchName") >> patchName_;
|
||||
probes::read(dict);
|
||||
readDict(dict);
|
||||
|
||||
// Find the elements
|
||||
findElements(mesh_);
|
||||
|
||||
// Open the probe streams
|
||||
prepare();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -25,9 +25,45 @@ Class
|
||||
Foam::patchProbes
|
||||
|
||||
Description
|
||||
Set of locations to sample.at patches
|
||||
Set of locations to sample at patches
|
||||
|
||||
Call write() to sample and write files.
|
||||
- find nearest location on nearest face
|
||||
- update *this with location (so header contains 'snapped' locations
|
||||
- use *this as the sampling location
|
||||
|
||||
Example of function object specification:
|
||||
\verbatim
|
||||
patchProbes
|
||||
{
|
||||
type patchProbes;
|
||||
functionObjectLibs ( "libsampling.so" );
|
||||
|
||||
// Name of the directory for probe data
|
||||
name patchProbes;
|
||||
|
||||
// Patches to sample (wildcards allowed)
|
||||
patches (".*inl.*");
|
||||
|
||||
// Write at same frequency as fields
|
||||
outputControl outputTime;
|
||||
outputInterval 1;
|
||||
|
||||
// Fields to be probed
|
||||
fields
|
||||
(
|
||||
p U
|
||||
);
|
||||
|
||||
// Locations to probe. These get snapped onto the nearest point
|
||||
// on the selected patches
|
||||
probeLocations
|
||||
(
|
||||
( -100 0 0.01 ) // at inlet
|
||||
);
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
|
||||
SourceFiles
|
||||
patchProbes.C
|
||||
@ -58,13 +94,15 @@ class patchProbes
|
||||
:
|
||||
public probes
|
||||
{
|
||||
// Private data
|
||||
protected:
|
||||
|
||||
//- Patch name
|
||||
word patchName_;
|
||||
// Protected data
|
||||
|
||||
//- Patches to sample
|
||||
wordReList patchNames_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
// Protected Member Functions
|
||||
|
||||
//- Sample and write a particular volume field
|
||||
template<class Type>
|
||||
@ -73,7 +111,6 @@ class patchProbes
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
|
||||
//- Sample and write a particular surface field
|
||||
template<class Type>
|
||||
void sampleAndWrite
|
||||
@ -81,17 +118,14 @@ class patchProbes
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>&
|
||||
);
|
||||
|
||||
|
||||
//- Sample and write all the fields of the given type
|
||||
template<class Type>
|
||||
void sampleAndWrite(const fieldGroup<Type>&);
|
||||
|
||||
|
||||
//- Sample and write all the surface fields of the given type
|
||||
template<class Type>
|
||||
void sampleAndWriteSurfaceFields(const fieldGroup<Type>&);
|
||||
|
||||
|
||||
//- Sample a volume field at all locations
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample
|
||||
@ -99,7 +133,6 @@ class patchProbes
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
) const;
|
||||
|
||||
|
||||
//- Sample a surface field at all locations
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample
|
||||
@ -107,11 +140,18 @@ class patchProbes
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>&
|
||||
) const;
|
||||
|
||||
|
||||
//- Sample a single field on all sample locations
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample(const word& fieldName) const;
|
||||
|
||||
//- Find elements containing patchProbes
|
||||
virtual void findElements(const fvMesh&);
|
||||
|
||||
//- Read dictionary settings
|
||||
void readDict(const dictionary& dict);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
patchProbes(const patchProbes&);
|
||||
@ -135,7 +175,8 @@ public:
|
||||
const word& name,
|
||||
const objectRegistry&,
|
||||
const dictionary&,
|
||||
const bool loadFromFiles = false
|
||||
const bool loadFromFiles = false,
|
||||
const bool findElements = true
|
||||
);
|
||||
|
||||
|
||||
@ -149,9 +190,6 @@ public:
|
||||
|
||||
//- Read
|
||||
virtual void read(const dictionary&);
|
||||
|
||||
//- Find elements containing patchProbes
|
||||
virtual void findElements(const fvMesh&);
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -208,7 +208,7 @@ Foam::patchProbes::sample
|
||||
|
||||
forAll(*this, probeI)
|
||||
{
|
||||
label faceI = elementList_[probeI];
|
||||
label faceI = faceList_[probeI];
|
||||
|
||||
if (faceI >= 0)
|
||||
{
|
||||
@ -259,7 +259,7 @@ Foam::patchProbes::sample
|
||||
|
||||
forAll(*this, probeI)
|
||||
{
|
||||
label faceI = elementList_[probeI];
|
||||
label faceI = faceList_[probeI];
|
||||
|
||||
if (faceI >= 0)
|
||||
{
|
||||
@ -274,4 +274,6 @@ Foam::patchProbes::sample
|
||||
|
||||
return tValues;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -108,7 +108,7 @@ void Foam::probes::findElements(const fvMesh& mesh)
|
||||
{
|
||||
if (Pstream::master())
|
||||
{
|
||||
WarningIn("findElements::findElements(const fvMesh&)")
|
||||
WarningInFunction
|
||||
<< "Did not find location " << location
|
||||
<< " in any cell. Skipping location." << endl;
|
||||
}
|
||||
@ -117,7 +117,7 @@ void Foam::probes::findElements(const fvMesh& mesh)
|
||||
{
|
||||
if (Pstream::master())
|
||||
{
|
||||
WarningIn("probes::findElements(const fvMesh&)")
|
||||
WarningInFunction
|
||||
<< "Did not find location " << location
|
||||
<< " in any face. Skipping location." << endl;
|
||||
}
|
||||
@ -127,13 +127,12 @@ void Foam::probes::findElements(const fvMesh& mesh)
|
||||
// Make sure location not on two domains.
|
||||
if (elementList_[probeI] != -1 && elementList_[probeI] != cellI)
|
||||
{
|
||||
WarningIn("probes::findElements(const fvMesh&)")
|
||||
WarningInFunction
|
||||
<< "Location " << location
|
||||
<< " seems to be on multiple domains:"
|
||||
<< " cell " << elementList_[probeI]
|
||||
<< " on my domain " << Pstream::myProcNo()
|
||||
<< " and cell " << cellI << " on some other domain."
|
||||
<< endl
|
||||
<< " and cell " << cellI << " on some other domain." << endl
|
||||
<< "This might happen if the probe location is on"
|
||||
<< " a processor patch. Change the location slightly"
|
||||
<< " to prevent this." << endl;
|
||||
@ -141,13 +140,12 @@ void Foam::probes::findElements(const fvMesh& mesh)
|
||||
|
||||
if (faceList_[probeI] != -1 && faceList_[probeI] != faceI)
|
||||
{
|
||||
WarningIn("probes::findElements(const fvMesh&)")
|
||||
WarningInFunction
|
||||
<< "Location " << location
|
||||
<< " seems to be on multiple domains:"
|
||||
<< " cell " << faceList_[probeI]
|
||||
<< " on my domain " << Pstream::myProcNo()
|
||||
<< " and face " << faceI << " on some other domain."
|
||||
<< endl
|
||||
<< " and face " << faceI << " on some other domain." << endl
|
||||
<< "This might happen if the probe location is on"
|
||||
<< " a processor patch. Change the location slightly"
|
||||
<< " to prevent this." << endl;
|
||||
@ -265,6 +263,25 @@ Foam::label Foam::probes::prepare()
|
||||
}
|
||||
|
||||
|
||||
void Foam::probes::readDict(const dictionary& dict)
|
||||
{
|
||||
dict.lookup("probeLocations") >> *this;
|
||||
dict.lookup("fields") >> fieldSelection_;
|
||||
|
||||
dict.readIfPresent("fixedLocations", fixedLocations_);
|
||||
if (dict.readIfPresent("interpolationScheme", interpolationScheme_))
|
||||
{
|
||||
if (!fixedLocations_ && interpolationScheme_ != "cell")
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Only cell interpolation can be applied when "
|
||||
<< "not using fixedLocations. InterpolationScheme "
|
||||
<< "entry will be ignored";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::probes::probes
|
||||
@ -272,7 +289,8 @@ Foam::probes::probes
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict,
|
||||
const bool loadFromFiles
|
||||
const bool loadFromFiles,
|
||||
const bool doFindElements
|
||||
)
|
||||
:
|
||||
pointField(0),
|
||||
@ -283,7 +301,18 @@ Foam::probes::probes
|
||||
fixedLocations_(true),
|
||||
interpolationScheme_("cell")
|
||||
{
|
||||
read(dict);
|
||||
// Read dictionary (but do not search for elements)
|
||||
readDict(dict);
|
||||
|
||||
// Optionally find elements in constructor
|
||||
if (doFindElements)
|
||||
{
|
||||
// Find the elements
|
||||
findElements(mesh_);
|
||||
|
||||
// Open the probe streams
|
||||
prepare();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -334,15 +363,15 @@ void Foam::probes::write()
|
||||
|
||||
void Foam::probes::read(const dictionary& dict)
|
||||
{
|
||||
dict.lookup("probeLocations") >> *this;
|
||||
dict.lookup("fields") >> fieldSelection_;
|
||||
readDict(dict);
|
||||
|
||||
// Find the elements
|
||||
dict.readIfPresent("fixedLocations", fixedLocations_);
|
||||
if (dict.readIfPresent("interpolationScheme", interpolationScheme_))
|
||||
{
|
||||
if (!fixedLocations_ && interpolationScheme_ != "cell")
|
||||
{
|
||||
WarningIn("void Foam::probes::read(const dictionary&)")
|
||||
WarningInFunction
|
||||
<< "Only cell interpolation can be applied when "
|
||||
<< "not using fixedLocations. InterpolationScheme "
|
||||
<< "entry will be ignored";
|
||||
@ -352,6 +381,7 @@ void Foam::probes::read(const dictionary& dict)
|
||||
// Initialise cells to sample from supplied locations
|
||||
findElements(mesh_);
|
||||
|
||||
// Open the probe streams
|
||||
prepare();
|
||||
}
|
||||
|
||||
@ -382,20 +412,28 @@ void Foam::probes::updateMesh(const mapPolyMesh& mpm)
|
||||
forAll(elementList_, i)
|
||||
{
|
||||
label cellI = elementList_[i];
|
||||
label newCellI = reverseMap[cellI];
|
||||
if (newCellI == -1)
|
||||
if (cellI != -1)
|
||||
{
|
||||
// cell removed
|
||||
}
|
||||
else if (newCellI < -1)
|
||||
{
|
||||
// cell merged
|
||||
elems.append(-newCellI - 2);
|
||||
label newCellI = reverseMap[cellI];
|
||||
if (newCellI == -1)
|
||||
{
|
||||
// cell removed
|
||||
}
|
||||
else if (newCellI < -1)
|
||||
{
|
||||
// cell merged
|
||||
elems.append(-newCellI - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// valid new cell
|
||||
elems.append(newCellI);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// valid new cell
|
||||
elems.append(newCellI);
|
||||
// Keep -1 elements so the size stays the same
|
||||
elems.append(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -410,20 +448,28 @@ void Foam::probes::updateMesh(const mapPolyMesh& mpm)
|
||||
forAll(faceList_, i)
|
||||
{
|
||||
label faceI = faceList_[i];
|
||||
label newFaceI = reverseMap[faceI];
|
||||
if (newFaceI == -1)
|
||||
if (faceI != -1)
|
||||
{
|
||||
// face removed
|
||||
}
|
||||
else if (newFaceI < -1)
|
||||
{
|
||||
// face merged
|
||||
elems.append(-newFaceI - 2);
|
||||
label newFaceI = reverseMap[faceI];
|
||||
if (newFaceI == -1)
|
||||
{
|
||||
// face removed
|
||||
}
|
||||
else if (newFaceI < -1)
|
||||
{
|
||||
// face merged
|
||||
elems.append(-newFaceI - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// valid new face
|
||||
elems.append(newFaceI);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// valid new face
|
||||
elems.append(newFaceI);
|
||||
// Keep -1 elements
|
||||
elems.append(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -32,6 +32,42 @@ Description
|
||||
|
||||
Call write() to sample and write files.
|
||||
|
||||
Example of function object specification:
|
||||
\verbatim
|
||||
probes
|
||||
{
|
||||
type probes;
|
||||
functionObjectLibs ( "libsampling.so" );
|
||||
|
||||
// Name of the directory for probe data
|
||||
name probes;
|
||||
|
||||
// Write at same frequency as fields
|
||||
outputControl outputTime;
|
||||
outputInterval 1;
|
||||
|
||||
// Fields to be probed
|
||||
fields
|
||||
(
|
||||
p U
|
||||
);
|
||||
|
||||
// Optional: do not recalculate cells if mesh moves
|
||||
fixedLocations false;
|
||||
|
||||
// Optional: interpolation scheme to use (default is cell)
|
||||
interpolationScheme cellPoint;
|
||||
|
||||
probeLocations
|
||||
(
|
||||
( 1e-06 0 0.01 ) // at inlet
|
||||
(0.21 -0.20999 0.01) // at outlet1
|
||||
(0.21 0.20999 0.01) // at outlet2
|
||||
(0.21 0 0.01) // at central block
|
||||
);
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
probes.C
|
||||
|
||||
@ -91,13 +127,13 @@ protected:
|
||||
|
||||
//- Name of this set of probes,
|
||||
// Also used as the name of the probes directory.
|
||||
word name_;
|
||||
const word name_;
|
||||
|
||||
//- Const reference to fvMesh
|
||||
const fvMesh& mesh_;
|
||||
|
||||
//- Load fields from files (not from objectRegistry)
|
||||
bool loadFromFiles_;
|
||||
const bool loadFromFiles_;
|
||||
|
||||
|
||||
// Read from dictonary
|
||||
@ -106,7 +142,7 @@ protected:
|
||||
wordReList fieldSelection_;
|
||||
|
||||
//- Fixed locations, default = yes
|
||||
// Note: set to false for moving mesh calations where locations
|
||||
// Note: set to false for moving mesh calculations where locations
|
||||
// should move with the mesh
|
||||
bool fixedLocations_;
|
||||
|
||||
@ -141,7 +177,7 @@ protected:
|
||||
HashPtrTable<OFstream> probeFilePtrs_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
// Protected Member Functions
|
||||
|
||||
//- Clear old field groups
|
||||
void clearFieldGroups();
|
||||
@ -159,6 +195,8 @@ protected:
|
||||
// returns number of fields to sample
|
||||
label prepare();
|
||||
|
||||
//- Read dictionary settings
|
||||
void readDict(const dictionary& dict);
|
||||
|
||||
private:
|
||||
|
||||
@ -207,7 +245,8 @@ public:
|
||||
const word& name,
|
||||
const objectRegistry&,
|
||||
const dictionary&,
|
||||
const bool loadFromFiles = false
|
||||
const bool loadFromFiles = false,
|
||||
const bool findElements = true
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,7 +76,7 @@ void Foam::circleSet::calcSamples
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn(funcName)
|
||||
WarningInFunction
|
||||
<< "Unable to find cell at point id " << 0
|
||||
<< " at location " << startPoint_ << endl;
|
||||
}
|
||||
@ -92,7 +92,7 @@ void Foam::circleSet::calcSamples
|
||||
|
||||
if (mag(axis1 & circleAxis_) > SMALL)
|
||||
{
|
||||
WarningIn(funcName)
|
||||
WarningInFunction
|
||||
<< "Vector defined by (startPoint - origin) not orthogonal to "
|
||||
<< "circleAxis:" << nl
|
||||
<< " startPoint - origin = " << axis1 << nl
|
||||
@ -118,13 +118,16 @@ void Foam::circleSet::calcSamples
|
||||
samplingCells.append(cellI);
|
||||
samplingFaces.append(-1);
|
||||
samplingSegments.append(nPoint);
|
||||
samplingCurveDist.append(mag(pt - startPoint_));
|
||||
samplingCurveDist.append
|
||||
(
|
||||
radius*constant::mathematical::pi/180.0*theta
|
||||
);
|
||||
|
||||
nPoint++;
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn(funcName)
|
||||
WarningInFunction
|
||||
<< "Unable to find cell at point id " << nPoint
|
||||
<< " at location " << pt << endl;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -102,7 +102,7 @@ void Foam::faceOnlySet::calcSamples
|
||||
// distance vector between sampling points
|
||||
if (mag(end_ - start_) < SMALL)
|
||||
{
|
||||
FatalErrorIn("faceOnlySet::calcSamples()")
|
||||
FatalErrorInFunction
|
||||
<< "Incorrect sample specification :"
|
||||
<< " start equals end point." << endl
|
||||
<< " start:" << start_
|
||||
@ -169,6 +169,7 @@ void Foam::faceOnlySet::calcSamples
|
||||
// Set points and cell/face labels to empty lists
|
||||
//Info<< "calcSamples : Both start_ and end_ outside domain"
|
||||
// << endl;
|
||||
const_cast<polyMesh&>(mesh()).moving(oldMoving);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -68,8 +68,7 @@ void Foam::midPointSet::genSamples()
|
||||
|
||||
if (cell1 != cell2)
|
||||
{
|
||||
FatalErrorIn("midPointSet::genSamples()")
|
||||
<< " sampleI:" << sampleI
|
||||
FatalErrorInFunction
|
||||
<< " midI:" << midI
|
||||
<< " sampleI:" << sampleI
|
||||
<< " pts[sampleI]:" << operator[](sampleI)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -81,8 +81,7 @@ void Foam::midPointAndFaceSet::genSamples()
|
||||
|
||||
if (cell1 != cell2)
|
||||
{
|
||||
FatalErrorIn("midPointAndFaceSet::genSamples()")
|
||||
<< " sampleI:" << sampleI
|
||||
FatalErrorInFunction
|
||||
<< " newSampleI:" << newSampleI
|
||||
<< " pts[sampleI]:" << operator[](sampleI)
|
||||
<< " face[sampleI]:" << faces_[sampleI]
|
||||
|
||||
@ -30,9 +30,8 @@ License
|
||||
#include "treeDataFace.H"
|
||||
#include "Time.H"
|
||||
#include "meshTools.H"
|
||||
//#include "Random.H"
|
||||
// For 'facePoint' helper function only
|
||||
#include "mappedPatchBase.H"
|
||||
#include "indirectPrimitivePatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -85,19 +84,145 @@ void Foam::patchSeedSet::calcSamples
|
||||
}
|
||||
|
||||
|
||||
label totalSize = returnReduce(sz, sumOp<label>());
|
||||
if (!rndGenPtr_.valid())
|
||||
{
|
||||
rndGenPtr_.reset(new Random(0));
|
||||
}
|
||||
Random& rndGen = rndGenPtr_();
|
||||
|
||||
|
||||
if (selectedLocations_.size())
|
||||
{
|
||||
DynamicList<label> newPatchFaces(patchFaces.size());
|
||||
|
||||
// Find the nearest patch face
|
||||
{
|
||||
// 1. All processors find nearest local patch face for all
|
||||
// selectedLocations
|
||||
|
||||
// All the info for nearest. Construct to miss
|
||||
List<mappedPatchBase::nearInfo> nearest(selectedLocations_.size());
|
||||
|
||||
const indirectPrimitivePatch pp
|
||||
(
|
||||
IndirectList<face>(mesh().faces(), patchFaces),
|
||||
mesh().points()
|
||||
);
|
||||
|
||||
treeBoundBox patchBb
|
||||
(
|
||||
treeBoundBox(pp.points(), pp.meshPoints()).extend
|
||||
(
|
||||
rndGen,
|
||||
1e-4
|
||||
)
|
||||
);
|
||||
patchBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
patchBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
|
||||
indexedOctree<treeDataFace> boundaryTree
|
||||
(
|
||||
treeDataFace // all information needed to search faces
|
||||
(
|
||||
false, // do not cache bb
|
||||
mesh(),
|
||||
patchFaces // boundary faces only
|
||||
),
|
||||
patchBb, // overall search domain
|
||||
8, // maxLevel
|
||||
10, // leafsize
|
||||
3.0 // duplicity
|
||||
);
|
||||
|
||||
// Get some global dimension so all points are equally likely
|
||||
// to be found
|
||||
const scalar globalDistSqr
|
||||
(
|
||||
//magSqr
|
||||
//(
|
||||
// boundBox
|
||||
// (
|
||||
// pp.points(),
|
||||
// pp.meshPoints(),
|
||||
// true
|
||||
// ).span()
|
||||
//)
|
||||
GREAT
|
||||
);
|
||||
|
||||
forAll(selectedLocations_, sampleI)
|
||||
{
|
||||
const point& sample = selectedLocations_[sampleI];
|
||||
|
||||
pointIndexHit& nearInfo = nearest[sampleI].first();
|
||||
nearInfo = boundaryTree.findNearest
|
||||
(
|
||||
sample,
|
||||
globalDistSqr
|
||||
);
|
||||
|
||||
if (!nearInfo.hit())
|
||||
{
|
||||
nearest[sampleI].second().first() = Foam::sqr(GREAT);
|
||||
nearest[sampleI].second().second() =
|
||||
Pstream::myProcNo();
|
||||
}
|
||||
else
|
||||
{
|
||||
point fc(pp[nearInfo.index()].centre(pp.points()));
|
||||
nearInfo.setPoint(fc);
|
||||
nearest[sampleI].second().first() = magSqr(fc-sample);
|
||||
nearest[sampleI].second().second() =
|
||||
Pstream::myProcNo();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 2. Reduce on master. Select nearest processor.
|
||||
|
||||
// Find nearest. Combine on master.
|
||||
Pstream::listCombineGather(nearest, mappedPatchBase::nearestEqOp());
|
||||
Pstream::listCombineScatter(nearest);
|
||||
|
||||
|
||||
// 3. Pick up my local faces that have won
|
||||
|
||||
forAll(nearest, sampleI)
|
||||
{
|
||||
if (nearest[sampleI].first().hit())
|
||||
{
|
||||
label procI = nearest[sampleI].second().second();
|
||||
label index = nearest[sampleI].first().index();
|
||||
|
||||
if (procI == Pstream::myProcNo())
|
||||
{
|
||||
newPatchFaces.append(pp.addressing()[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Found " << newPatchFaces.size()
|
||||
<< " out of " << selectedLocations_.size()
|
||||
<< " on local processor" << endl;
|
||||
}
|
||||
|
||||
patchFaces.transfer(newPatchFaces);
|
||||
}
|
||||
|
||||
|
||||
// Shuffle and truncate if in random mode
|
||||
label totalSize = returnReduce(patchFaces.size(), sumOp<label>());
|
||||
|
||||
if (maxPoints_ < totalSize)
|
||||
{
|
||||
// Check what fraction of maxPoints_ I need to generate locally.
|
||||
label myMaxPoints = label(scalar(sz)/totalSize*maxPoints_);
|
||||
label myMaxPoints =
|
||||
label(scalar(patchFaces.size())/totalSize*maxPoints_);
|
||||
|
||||
rndGenPtr_.reset(new Random(123456));
|
||||
Random& rndGen = rndGenPtr_();
|
||||
|
||||
labelList subset = identity(sz);
|
||||
labelList subset = identity(patchFaces.size());
|
||||
for (label iter = 0; iter < 4; iter++)
|
||||
{
|
||||
forAll(subset, i)
|
||||
@ -115,7 +240,7 @@ void Foam::patchSeedSet::calcSamples
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "In random mode : selected " << patchFaces.size()
|
||||
<< " faces out of " << sz << endl;
|
||||
<< " faces out of " << patchFaces.size() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -135,6 +260,9 @@ void Foam::patchSeedSet::calcSamples
|
||||
forAll(patchFaces, i)
|
||||
{
|
||||
label faceI = patchFaces[i];
|
||||
|
||||
// Slightly shift point in since on warped face face-diagonal
|
||||
// decomposition might be outside cell for face-centre decomposition!
|
||||
pointIndexHit info = mappedPatchBase::facePoint
|
||||
(
|
||||
mesh(),
|
||||
@ -217,9 +345,15 @@ Foam::patchSeedSet::patchSeedSet
|
||||
wordReList(dict.lookup("patches"))
|
||||
)
|
||||
),
|
||||
//searchDist_(readScalar(dict.lookup("maxDistance"))),
|
||||
//offsetDist_(readScalar(dict.lookup("offsetDist"))),
|
||||
maxPoints_(readLabel(dict.lookup("maxPoints")))
|
||||
maxPoints_(readLabel(dict.lookup("maxPoints"))),
|
||||
selectedLocations_
|
||||
(
|
||||
dict.lookupOrDefault<pointField>
|
||||
(
|
||||
"points",
|
||||
pointField(0)
|
||||
)
|
||||
)
|
||||
{
|
||||
genSamples();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,18 +58,15 @@ class patchSeedSet
|
||||
//- Patches to sample
|
||||
const labelHashSet patchSet_;
|
||||
|
||||
// //- Maximum distance to look for nearest
|
||||
// const scalar searchDist_;
|
||||
//
|
||||
// //- Offset distance
|
||||
// const scalar offsetDist_;
|
||||
|
||||
//- Maximum number of patch faces to seed
|
||||
//- Maximum number of patch faces to seed (if in random subset mode)
|
||||
const label maxPoints_;
|
||||
|
||||
//- Random number generator (if maxPoints < num patch faces)
|
||||
autoPtr<Random> rndGenPtr_;
|
||||
|
||||
//- Patch faces to seed selected based on nearness to supplied points
|
||||
const pointField selectedLocations_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -137,7 +137,7 @@ void Foam::polyLineSet::calcSamples
|
||||
// Check sampling points
|
||||
if (sampleCoords_.size() < 2)
|
||||
{
|
||||
FatalErrorIn("polyLineSet::calcSamples()")
|
||||
FatalErrorInFunction
|
||||
<< "Incorrect sample specification. Too few points:"
|
||||
<< sampleCoords_ << exit(FatalError);
|
||||
}
|
||||
@ -146,7 +146,7 @@ void Foam::polyLineSet::calcSamples
|
||||
{
|
||||
if (mag(sampleCoords_[sampleI] - oldPoint) < SMALL)
|
||||
{
|
||||
FatalErrorIn("polyLineSet::calcSamples()")
|
||||
FatalErrorInFunction
|
||||
<< "Incorrect sample specification."
|
||||
<< " Point " << sampleCoords_[sampleI-1]
|
||||
<< " at position " << sampleI-1
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -57,10 +57,8 @@ Foam::label Foam::sampledSet::getCell
|
||||
{
|
||||
if (faceI == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"sampledSet::getCell(const label, const point&)"
|
||||
) << "Illegal face label " << faceI
|
||||
FatalErrorInFunction
|
||||
<< "Illegal face label " << faceI
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -70,10 +68,8 @@ Foam::label Foam::sampledSet::getCell
|
||||
|
||||
if (!mesh().pointInCell(sample, cellI, searchEngine_.decompMode()))
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"sampledSet::getCell(const label, const point&)"
|
||||
) << "Found cell " << cellI << " using face " << faceI
|
||||
FatalErrorInFunction
|
||||
<< "Found cell " << cellI << " using face " << faceI
|
||||
<< ". But cell does not contain point " << sample
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -99,10 +95,8 @@ Foam::label Foam::sampledSet::getCell
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"sampledSet::getCell(const label, const point&)"
|
||||
) << "None of the neighbours of face "
|
||||
FatalErrorInFunction
|
||||
<< "None of the neighbours of face "
|
||||
<< faceI << " contains point " << sample
|
||||
<< abort(FatalError);
|
||||
|
||||
@ -220,10 +214,8 @@ Foam::point Foam::sampledSet::pushIn
|
||||
|
||||
if (tetFaceI == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"sampledSet::pushIn(const point&, const label)"
|
||||
) << "After pushing " << facePt << " to " << newPosition
|
||||
FatalErrorInFunction
|
||||
<< "After pushing " << facePt << " to " << newPosition
|
||||
<< " it is still outside face " << faceI
|
||||
<< " at " << mesh().faceCentres()[faceI]
|
||||
<< " of cell " << cellI
|
||||
@ -378,7 +370,7 @@ void Foam::sampledSet::setSamples
|
||||
|| (curveDist_.size() != size())
|
||||
)
|
||||
{
|
||||
FatalErrorIn("sampledSet::setSamples()")
|
||||
FatalErrorInFunction
|
||||
<< "sizes not equal : "
|
||||
<< " points:" << size()
|
||||
<< " cells:" << cells_.size()
|
||||
@ -459,12 +451,8 @@ Foam::autoPtr<Foam::sampledSet> Foam::sampledSet::New
|
||||
|
||||
if (cstrIter == wordConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"sampledSet::New"
|
||||
"(const word&, const polyMesh&, const meshSearch&"
|
||||
", const dictionary&)"
|
||||
) << "Unknown sample type "
|
||||
FatalErrorInFunction
|
||||
<< "Unknown sample type "
|
||||
<< sampleType << nl << nl
|
||||
<< "Valid sample types : " << endl
|
||||
<< wordConstructorTablePtr_->sortedToc()
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -223,7 +223,7 @@ public:
|
||||
//- Clone
|
||||
autoPtr<sampledSet> clone() const
|
||||
{
|
||||
notImplemented("autoPtr<sampledSet> clone() const");
|
||||
NotImplemented;
|
||||
return autoPtr<sampledSet>(NULL);
|
||||
}
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -35,8 +35,8 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(sampledSets, 0);
|
||||
bool sampledSets::verbose_ = false;
|
||||
defineTypeNameAndDebug(sampledSets, 0);
|
||||
bool sampledSets::verbose_ = false;
|
||||
}
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ void Foam::sampledSets::combineSampledSets
|
||||
|
||||
if (Pstream::master() && allCurveDist.size() == 0)
|
||||
{
|
||||
WarningIn("sampledSets::combineSampledSets(..)")
|
||||
WarningInFunction
|
||||
<< "Sample set " << samplePts.name()
|
||||
<< " has zero points." << endl;
|
||||
}
|
||||
@ -119,7 +119,7 @@ void Foam::sampledSets::combineSampledSets
|
||||
samplePts.name(),
|
||||
samplePts.axis(),
|
||||
List<point>(UIndirectList<point>(allPts, indexSets[setI])),
|
||||
allCurveDist
|
||||
sortedDist
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -106,7 +106,7 @@ Foam::label Foam::sampledSets::classifyFields()
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn("sampledSets::classifyFields()")
|
||||
WarningInFunction
|
||||
<< "Cannot find field file matching "
|
||||
<< fieldSelection_[i] << endl;
|
||||
}
|
||||
@ -137,7 +137,7 @@ Foam::label Foam::sampledSets::classifyFields()
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn("sampledSets::classifyFields()")
|
||||
WarningInFunction
|
||||
<< "Cannot find registered field matching "
|
||||
<< fieldSelection_[i] << endl;
|
||||
}
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -166,17 +166,8 @@ void Foam::sampledSets::writeSampleFile
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"void Foam::sampledSets::writeSampleFile"
|
||||
"("
|
||||
"const coordSet&, "
|
||||
"const PtrList<volFieldSampler<Type> >&, "
|
||||
"const label, "
|
||||
"const fileName&, "
|
||||
"const writer<Type>&"
|
||||
")"
|
||||
) << "File " << ofs.name() << " could not be opened. "
|
||||
WarningInFunction
|
||||
<< "File " << ofs.name() << " could not be opened. "
|
||||
<< "No data will be written" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -217,7 +217,7 @@ void Foam::uniformSet::calcSamples
|
||||
// distance vector between sampling points
|
||||
if ((nPoints_ < 2) || (mag(end_ - start_) < SMALL))
|
||||
{
|
||||
FatalErrorIn("uniformSet::calcSamples()")
|
||||
FatalErrorInFunction
|
||||
<< "Incorrect sample specification. Either too few points or"
|
||||
<< " start equals end point." << endl
|
||||
<< "nPoints:" << nPoints_
|
||||
@ -276,6 +276,8 @@ void Foam::uniformSet::calcSamples
|
||||
// (or is along edge)
|
||||
// Set points and cell/face labels to empty lists
|
||||
|
||||
const_cast<polyMesh&>(mesh()).moving(oldMoving);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -113,10 +113,8 @@ void Foam::distanceSurface::createGeometry()
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::distanceSurface::createGeometry()"
|
||||
) << "getVolumeType failure, neither INSIDE or OUTSIDE"
|
||||
FatalErrorInFunction
|
||||
<< "getVolumeType failure, neither INSIDE or OUTSIDE"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
@ -165,10 +163,8 @@ void Foam::distanceSurface::createGeometry()
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::distanceSurface::createGeometry()"
|
||||
) << "getVolumeType failure, "
|
||||
FatalErrorInFunction
|
||||
<< "getVolumeType failure, "
|
||||
<< "neither INSIDE or OUTSIDE"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -224,10 +220,8 @@ void Foam::distanceSurface::createGeometry()
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::distanceSurface::createGeometry()"
|
||||
) << "getVolumeType failure, neither INSIDE or OUTSIDE"
|
||||
FatalErrorInFunction
|
||||
<< "getVolumeType failure, neither INSIDE or OUTSIDE"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
@ -278,7 +272,8 @@ void Foam::distanceSurface::createGeometry()
|
||||
cellDistance,
|
||||
pointDistance_,
|
||||
distance_,
|
||||
regularise_
|
||||
regularise_,
|
||||
bounds_
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -291,7 +286,8 @@ void Foam::distanceSurface::createGeometry()
|
||||
cellDistance,
|
||||
pointDistance_,
|
||||
distance_,
|
||||
regularise_
|
||||
regularise_,
|
||||
bounds_
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -336,6 +332,7 @@ Foam::distanceSurface::distanceSurface
|
||||
cell_(dict.lookupOrDefault("cell", true)),
|
||||
regularise_(dict.lookupOrDefault("regularise", true)),
|
||||
average_(dict.lookupOrDefault("average", false)),
|
||||
bounds_(dict.lookupOrDefault("bounds", boundBox::greatBox)),
|
||||
zoneKey_(keyType::null),
|
||||
needsUpdate_(true),
|
||||
isoSurfCellPtr_(NULL),
|
||||
@ -364,7 +361,8 @@ Foam::distanceSurface::distanceSurface
|
||||
const bool signedDistance,
|
||||
const bool cell,
|
||||
const Switch regularise,
|
||||
const Switch average
|
||||
const Switch average,
|
||||
const boundBox& bounds
|
||||
)
|
||||
:
|
||||
sampledSurface(name, mesh, interpolate),
|
||||
@ -390,6 +388,7 @@ Foam::distanceSurface::distanceSurface
|
||||
cell_(cell),
|
||||
regularise_(regularise),
|
||||
average_(average),
|
||||
bounds_(bounds),
|
||||
zoneKey_(keyType::null),
|
||||
needsUpdate_(true),
|
||||
isoSurfCellPtr_(NULL),
|
||||
|
||||
@ -75,6 +75,9 @@ class distanceSurface
|
||||
//- Whether to recalculate cell values as average of point values
|
||||
const Switch average_;
|
||||
|
||||
//- Optional bounding box to trim triangles against
|
||||
const boundBox bounds_;
|
||||
|
||||
//- If restricted to zones, name of this zone or a regular expression
|
||||
keyType zoneKey_;
|
||||
|
||||
@ -144,7 +147,8 @@ public:
|
||||
const bool signedDistance,
|
||||
const bool cell,
|
||||
const Switch regularise,
|
||||
const Switch average
|
||||
const Switch average,
|
||||
const boundBox& bounds = boundBox::greatBox
|
||||
);
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,6 +76,8 @@ namespace Foam
|
||||
{
|
||||
|
||||
class fvMesh;
|
||||
class plane;
|
||||
class treeBoundBox;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class isoSurface Declaration
|
||||
@ -116,10 +118,12 @@ class isoSurface
|
||||
//- Regularise?
|
||||
const Switch regularise_;
|
||||
|
||||
//- Optional bounds
|
||||
const boundBox bounds_;
|
||||
|
||||
//- When to merge points
|
||||
const scalar mergeDistance_;
|
||||
|
||||
|
||||
//- Whether face might be cut
|
||||
List<cellCutType> faceCutType_;
|
||||
|
||||
@ -135,6 +139,15 @@ class isoSurface
|
||||
//- For every unmerged triangle point the point in the triSurface
|
||||
labelList triPointMergeMap_;
|
||||
|
||||
//- triSurface points that have weighted interpolation
|
||||
DynamicList<label> interpolatedPoints_;
|
||||
|
||||
//- corresponding original, unmerged points
|
||||
DynamicList<FixedList<label, 3> > interpolatedOldPoints_;
|
||||
|
||||
//- corresponding weights
|
||||
DynamicList<FixedList<scalar, 3> > interpolationWeights_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
@ -193,20 +206,8 @@ class isoSurface
|
||||
const scalarField& pVals
|
||||
);
|
||||
|
||||
static labelPair findCommonPoints
|
||||
(
|
||||
const labelledTri&,
|
||||
const labelledTri&
|
||||
);
|
||||
|
||||
static point calcCentre(const triSurface&);
|
||||
|
||||
static pointIndexHit collapseSurface
|
||||
(
|
||||
pointField& localPoints,
|
||||
DynamicList<labelledTri, 64>& localTris
|
||||
);
|
||||
|
||||
//- Determine per cc whether all near cuts can be snapped to single
|
||||
// point.
|
||||
void calcSnappedCc
|
||||
@ -323,6 +324,17 @@ class isoSurface
|
||||
DynamicList<label>& triMeshCells
|
||||
) const;
|
||||
|
||||
template<class Type>
|
||||
static tmp<Field<Type> > interpolate
|
||||
(
|
||||
const label nPoints,
|
||||
const labelList& triPointMergeMap,
|
||||
const labelList& interpolatedPoints,
|
||||
const List<FixedList<label, 3> >& interpolatedOldPoints,
|
||||
const List<FixedList<scalar, 3> >& interpolationWeights,
|
||||
const DynamicList<Type>& unmergedValues
|
||||
);
|
||||
|
||||
triSurface stitchTriPoints
|
||||
(
|
||||
const bool checkDuplicates,
|
||||
@ -331,57 +343,38 @@ class isoSurface
|
||||
labelList& triMap // merged to unmerged triangle
|
||||
) const;
|
||||
|
||||
//- Trim triangle to planes
|
||||
static void trimToPlanes
|
||||
(
|
||||
const PtrList<plane>& planes,
|
||||
const triPointRef& tri,
|
||||
DynamicList<point>& newTriPoints
|
||||
);
|
||||
|
||||
//- Trim all triangles to box
|
||||
static void trimToBox
|
||||
(
|
||||
const treeBoundBox& bb,
|
||||
DynamicList<point>& triPoints,
|
||||
DynamicList<label>& triMeshCells
|
||||
);
|
||||
|
||||
//- Trim all triangles to box. Determine interpolation
|
||||
// for existing and new points
|
||||
static void trimToBox
|
||||
(
|
||||
const treeBoundBox& bb,
|
||||
DynamicList<point>& triPoints,
|
||||
DynamicList<label>& triMap,
|
||||
labelList& triPointMap,
|
||||
labelList& interpolatedPoints,
|
||||
List<FixedList<label, 3> >& interpolatedOldPoints,
|
||||
List<FixedList<scalar, 3> >& interpolationWeights
|
||||
);
|
||||
|
||||
//- Check single triangle for (topological) validity
|
||||
static bool validTri(const triSurface&, const label);
|
||||
|
||||
//- Determine edge-face addressing
|
||||
void calcAddressing
|
||||
(
|
||||
const triSurface& surf,
|
||||
List<FixedList<label, 3> >& faceEdges,
|
||||
labelList& edgeFace0,
|
||||
labelList& edgeFace1,
|
||||
Map<labelList>& edgeFacesRest
|
||||
) const;
|
||||
|
||||
//- Determine orientation
|
||||
static void walkOrientation
|
||||
(
|
||||
const triSurface& surf,
|
||||
const List<FixedList<label, 3> >& faceEdges,
|
||||
const labelList& edgeFace0,
|
||||
const labelList& edgeFace1,
|
||||
const label seedTriI,
|
||||
labelList& flipState
|
||||
);
|
||||
|
||||
//- Orient surface
|
||||
static void orientSurface
|
||||
(
|
||||
triSurface&,
|
||||
const List<FixedList<label, 3> >& faceEdges,
|
||||
const labelList& edgeFace0,
|
||||
const labelList& edgeFace1,
|
||||
const Map<labelList>& edgeFacesRest
|
||||
);
|
||||
|
||||
//- Is triangle (given by 3 edges) not fully connected?
|
||||
static bool danglingTriangle
|
||||
(
|
||||
const FixedList<label, 3>& fEdges,
|
||||
const labelList& edgeFace1
|
||||
);
|
||||
|
||||
//- Mark all non-fully connected triangles
|
||||
static label markDanglingTriangles
|
||||
(
|
||||
const List<FixedList<label, 3> >& faceEdges,
|
||||
const labelList& edgeFace0,
|
||||
const labelList& edgeFace1,
|
||||
const Map<labelList>& edgeFacesRest,
|
||||
boolList& keepTriangles
|
||||
);
|
||||
|
||||
static triSurface subsetMesh
|
||||
(
|
||||
const triSurface& s,
|
||||
@ -392,6 +385,10 @@ class isoSurface
|
||||
|
||||
public:
|
||||
|
||||
//- Declare friendship with isoSurfaceCell to share some functionality
|
||||
friend class isoSurfaceCell;
|
||||
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("isoSurface");
|
||||
|
||||
@ -407,24 +404,19 @@ public:
|
||||
const scalarField& pointIsoVals,
|
||||
const scalar iso,
|
||||
const bool regularise,
|
||||
const boundBox& bounds = boundBox::greatBox,
|
||||
const scalar mergeTol = 1e-6 // fraction of bounding box
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- For every face original cell in mesh
|
||||
//- For every triangle the original cell in mesh
|
||||
const labelList& meshCells() const
|
||||
{
|
||||
return meshCells_;
|
||||
}
|
||||
|
||||
//- For every unmerged triangle point the point in the triSurface
|
||||
const labelList& triPointMergeMap() const
|
||||
{
|
||||
return triPointMergeMap_;
|
||||
}
|
||||
|
||||
//- Interpolates cCoords,pCoords. Uses the references to the original
|
||||
// fields used to create the iso surface.
|
||||
template<class Type>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,6 +30,9 @@ License
|
||||
#include "tetMatcher.H"
|
||||
#include "syncTools.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "Time.H"
|
||||
#include "triPoints.H"
|
||||
#include "isoSurface.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -917,7 +920,7 @@ Foam::triSurface Foam::isoSurfaceCell::stitchTriPoints
|
||||
|
||||
if ((triPoints.size() % 3) != 0)
|
||||
{
|
||||
FatalErrorIn("isoSurfaceCell::stitchTriPoints(..)")
|
||||
FatalErrorInFunction
|
||||
<< "Problem: number of points " << triPoints.size()
|
||||
<< " not a multiple of 3." << abort(FatalError);
|
||||
}
|
||||
@ -951,7 +954,7 @@ Foam::triSurface Foam::isoSurfaceCell::stitchTriPoints
|
||||
|
||||
if (hasMerged)
|
||||
{
|
||||
FatalErrorIn("isoSurfaceCell::stitchTriPoints(..)")
|
||||
FatalErrorInFunction
|
||||
<< "Merged points contain duplicates"
|
||||
<< " when merging with distance " << mergeDistance_ << endl
|
||||
<< "merged:" << newPoints.size() << " re-merged:"
|
||||
@ -1064,7 +1067,7 @@ bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI)
|
||||
{
|
||||
if (f[fp] < 0 || f[fp] >= surf.points().size())
|
||||
{
|
||||
WarningIn("validTri(const triSurface&, const label)")
|
||||
WarningInFunction
|
||||
<< "triangle " << faceI << " vertices " << f
|
||||
<< " uses point indices outside point range 0.."
|
||||
<< surf.points().size()-1 << endl;
|
||||
@ -1075,7 +1078,7 @@ bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI)
|
||||
|
||||
if ((f[0] == f[1]) || (f[0] == f[2]) || (f[1] == f[2]))
|
||||
{
|
||||
WarningIn("validTri(const triSurface&, const label)")
|
||||
WarningInFunction
|
||||
<< "triangle " << faceI
|
||||
<< " uses non-unique vertices " << f
|
||||
<< endl;
|
||||
@ -1107,7 +1110,7 @@ bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI)
|
||||
&& ((f[2] == nbrF[0]) || (f[2] == nbrF[1]) || (f[2] == nbrF[2]))
|
||||
)
|
||||
{
|
||||
WarningIn("validTri(const triSurface&, const label)")
|
||||
WarningInFunction
|
||||
<< "triangle " << faceI << " vertices " << f
|
||||
<< " coords:" << f.points(surf.points())
|
||||
<< " has the same vertices as triangle " << nbrFaceI
|
||||
@ -1199,7 +1202,7 @@ void Foam::isoSurfaceCell::calcAddressing
|
||||
}
|
||||
else
|
||||
{
|
||||
//WarningIn("orientSurface(triSurface&)")
|
||||
//WarningInFunction
|
||||
// << "Edge " << edgeI << " with centre " << mergedCentres[edgeI]
|
||||
// << " used by more than two triangles: " << edgeFace0[edgeI]
|
||||
// << ", "
|
||||
@ -1222,144 +1225,6 @@ void Foam::isoSurfaceCell::calcAddressing
|
||||
}
|
||||
|
||||
|
||||
//void Foam::isoSurfaceCell::walkOrientation
|
||||
//(
|
||||
// const triSurface& surf,
|
||||
// const List<FixedList<label, 3> >& faceEdges,
|
||||
// const labelList& edgeFace0,
|
||||
// const labelList& edgeFace1,
|
||||
// const label seedTriI,
|
||||
// labelList& flipState
|
||||
//)
|
||||
//{
|
||||
// // Do walk for consistent orientation.
|
||||
// DynamicList<label> changedFaces(surf.size());
|
||||
//
|
||||
// changedFaces.append(seedTriI);
|
||||
//
|
||||
// while (changedFaces.size())
|
||||
// {
|
||||
// DynamicList<label> newChangedFaces(changedFaces.size());
|
||||
//
|
||||
// forAll(changedFaces, i)
|
||||
// {
|
||||
// label triI = changedFaces[i];
|
||||
// const labelledTri& tri = surf[triI];
|
||||
// const FixedList<label, 3>& fEdges = faceEdges[triI];
|
||||
//
|
||||
// forAll(fEdges, fp)
|
||||
// {
|
||||
// label edgeI = fEdges[fp];
|
||||
//
|
||||
// // my points:
|
||||
// label p0 = tri[fp];
|
||||
// label p1 = tri[tri.fcIndex(fp)];
|
||||
//
|
||||
// label nbrI =
|
||||
// (
|
||||
// edgeFace0[edgeI] != triI
|
||||
// ? edgeFace0[edgeI]
|
||||
// : edgeFace1[edgeI]
|
||||
// );
|
||||
//
|
||||
// if (nbrI != -1 && flipState[nbrI] == -1)
|
||||
// {
|
||||
// const labelledTri& nbrTri = surf[nbrI];
|
||||
//
|
||||
// // nbr points
|
||||
// label nbrFp = findIndex(nbrTri, p0);
|
||||
// label nbrP1 = nbrTri[nbrTri.rcIndex(nbrFp)];
|
||||
//
|
||||
// bool sameOrientation = (p1 == nbrP1);
|
||||
//
|
||||
// if (flipState[triI] == 0)
|
||||
// {
|
||||
// flipState[nbrI] = (sameOrientation ? 0 : 1);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// flipState[nbrI] = (sameOrientation ? 1 : 0);
|
||||
// }
|
||||
// newChangedFaces.append(nbrI);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// changedFaces.transfer(newChangedFaces);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//
|
||||
//void Foam::isoSurfaceCell::orientSurface
|
||||
//(
|
||||
// triSurface& surf,
|
||||
// const List<FixedList<label, 3> >& faceEdges,
|
||||
// const labelList& edgeFace0,
|
||||
// const labelList& edgeFace1,
|
||||
// const Map<labelList>& edgeFacesRest
|
||||
//)
|
||||
//{
|
||||
// // -1 : unvisited
|
||||
// // 0 : leave as is
|
||||
// // 1 : flip
|
||||
// labelList flipState(surf.size(), -1);
|
||||
//
|
||||
// label seedTriI = 0;
|
||||
//
|
||||
// while (true)
|
||||
// {
|
||||
// // Find first unvisited triangle
|
||||
// for
|
||||
// (
|
||||
// ;
|
||||
// seedTriI < surf.size() && flipState[seedTriI] != -1;
|
||||
// seedTriI++
|
||||
// )
|
||||
// {}
|
||||
//
|
||||
// if (seedTriI == surf.size())
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// // Note: Determine orientation of seedTriI?
|
||||
// // for now assume it is ok
|
||||
// flipState[seedTriI] = 0;
|
||||
//
|
||||
// walkOrientation
|
||||
// (
|
||||
// surf,
|
||||
// faceEdges,
|
||||
// edgeFace0,
|
||||
// edgeFace1,
|
||||
// seedTriI,
|
||||
// flipState
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// // Do actual flipping
|
||||
// surf.clearOut();
|
||||
// forAll(surf, triI)
|
||||
// {
|
||||
// if (flipState[triI] == 1)
|
||||
// {
|
||||
// labelledTri tri(surf[triI]);
|
||||
//
|
||||
// surf[triI][0] = tri[0];
|
||||
// surf[triI][1] = tri[2];
|
||||
// surf[triI][2] = tri[1];
|
||||
// }
|
||||
// else if (flipState[triI] == -1)
|
||||
// {
|
||||
// FatalErrorIn
|
||||
// (
|
||||
// "isoSurfaceCell::orientSurface(triSurface&, const label)"
|
||||
// ) << "problem" << abort(FatalError);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
// Checks if triangle is connected through edgeI only.
|
||||
bool Foam::isoSurfaceCell::danglingTriangle
|
||||
(
|
||||
@ -1517,6 +1382,7 @@ Foam::isoSurfaceCell::isoSurfaceCell
|
||||
const scalarField& pVals,
|
||||
const scalar iso,
|
||||
const bool regularise,
|
||||
const boundBox& bounds,
|
||||
const scalar mergeTol
|
||||
)
|
||||
:
|
||||
@ -1524,6 +1390,7 @@ Foam::isoSurfaceCell::isoSurfaceCell
|
||||
cVals_(cVals),
|
||||
pVals_(pVals),
|
||||
iso_(iso),
|
||||
bounds_(bounds),
|
||||
mergeDistance_(mergeTol*mesh.bounds().mag())
|
||||
{
|
||||
if (debug)
|
||||
@ -1607,56 +1474,104 @@ Foam::isoSurfaceCell::isoSurfaceCell
|
||||
}
|
||||
|
||||
|
||||
|
||||
DynamicList<point> triPoints(nCutCells_);
|
||||
DynamicList<label> triMeshCells(nCutCells_);
|
||||
|
||||
generateTriPoints
|
||||
(
|
||||
cVals,
|
||||
pVals,
|
||||
|
||||
mesh_.cellCentres(),
|
||||
mesh_.points(),
|
||||
|
||||
snappedPoints,
|
||||
snappedCc,
|
||||
snappedPoint,
|
||||
|
||||
triPoints,
|
||||
triMeshCells
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "isoSurfaceCell : generated " << triMeshCells.size()
|
||||
<< " unmerged triangles." << endl;
|
||||
}
|
||||
DynamicList<point> triPoints(nCutCells_);
|
||||
DynamicList<label> triMeshCells(nCutCells_);
|
||||
|
||||
// Merge points and compact out non-valid triangles
|
||||
labelList triMap; // merged to unmerged triangle
|
||||
triSurface::operator=
|
||||
(
|
||||
stitchTriPoints
|
||||
generateTriPoints
|
||||
(
|
||||
regularise, // check for duplicate tris
|
||||
cVals,
|
||||
pVals,
|
||||
|
||||
mesh_.cellCentres(),
|
||||
mesh_.points(),
|
||||
|
||||
snappedPoints,
|
||||
snappedCc,
|
||||
snappedPoint,
|
||||
|
||||
triPoints,
|
||||
triPointMergeMap_, // unmerged to merged point
|
||||
triMap
|
||||
)
|
||||
);
|
||||
triMeshCells
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "isoSurfaceCell : generated " << triMap.size()
|
||||
<< " merged triangles." << endl;
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "isoSurfaceCell : generated " << triMeshCells.size()
|
||||
<< " unmerged triangles." << endl;
|
||||
}
|
||||
|
||||
|
||||
label nOldPoints = triPoints.size();
|
||||
|
||||
// Trimmed to original triangle
|
||||
DynamicList<label> trimTriMap;
|
||||
// Trimmed to original point
|
||||
labelList trimTriPointMap;
|
||||
if (bounds_ != boundBox::greatBox)
|
||||
{
|
||||
isoSurface::trimToBox
|
||||
(
|
||||
treeBoundBox(bounds_),
|
||||
triPoints, // new points
|
||||
trimTriMap, // map from (new) triangle to original
|
||||
trimTriPointMap, // map from (new) point to original
|
||||
interpolatedPoints_, // labels of newly introduced points
|
||||
interpolatedOldPoints_, // and their interpolation
|
||||
interpolationWeights_
|
||||
);
|
||||
triMeshCells = labelField(triMeshCells, trimTriMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Merge points and compact out non-valid triangles
|
||||
labelList triMap;
|
||||
triSurface::operator=
|
||||
(
|
||||
stitchTriPoints
|
||||
(
|
||||
regularise, // check for duplicate tris
|
||||
triPoints,
|
||||
triPointMergeMap_, // unmerged to merged point
|
||||
triMap // merged to unmerged triangle
|
||||
)
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "isoSurfaceCell : generated " << triMap.size()
|
||||
<< " merged triangles." << endl;
|
||||
}
|
||||
|
||||
if (bounds_ != boundBox::greatBox)
|
||||
{
|
||||
// Adjust interpolatedPoints_
|
||||
inplaceRenumber(triPointMergeMap_, interpolatedPoints_);
|
||||
|
||||
// Adjust triPointMergeMap_
|
||||
labelList newTriPointMergeMap(nOldPoints, -1);
|
||||
forAll(trimTriPointMap, trimPointI)
|
||||
{
|
||||
label oldPointI = trimTriPointMap[trimPointI];
|
||||
if (oldPointI >= 0)
|
||||
{
|
||||
label pointI = triPointMergeMap_[trimPointI];
|
||||
if (pointI >= 0)
|
||||
{
|
||||
newTriPointMergeMap[oldPointI] = pointI;
|
||||
}
|
||||
}
|
||||
}
|
||||
triPointMergeMap_.transfer(newTriPointMergeMap);
|
||||
}
|
||||
|
||||
meshCells_.setSize(triMap.size());
|
||||
forAll(triMap, i)
|
||||
{
|
||||
meshCells_[i] = triMeshCells[triMap[i]];
|
||||
}
|
||||
}
|
||||
|
||||
meshCells_.setSize(triMap.size());
|
||||
forAll(triMap, i)
|
||||
{
|
||||
meshCells_[i] = triMeshCells[triMap[i]];
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
@ -1730,8 +1645,6 @@ Foam::isoSurfaceCell::isoSurfaceCell
|
||||
meshCells_ = labelField(meshCells_, subsetTriMap);
|
||||
inplaceRenumber(reversePointMap, triPointMergeMap_);
|
||||
}
|
||||
|
||||
//orientSurface(*this, faceEdges, edgeFace0, edgeFace1, edgeFacesRest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -48,6 +48,7 @@ SourceFiles
|
||||
#include "labelPair.H"
|
||||
#include "pointIndexHit.H"
|
||||
#include "PackedBoolList.H"
|
||||
#include "boundBox.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -55,6 +56,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
class polyMesh;
|
||||
class plane;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class isoSurfaceCell Declaration
|
||||
@ -91,6 +93,9 @@ class isoSurfaceCell
|
||||
//- isoSurfaceCell value
|
||||
const scalar iso_;
|
||||
|
||||
//- Optional bounds
|
||||
const boundBox bounds_;
|
||||
|
||||
//- When to merge points
|
||||
const scalar mergeDistance_;
|
||||
|
||||
@ -106,6 +111,15 @@ class isoSurfaceCell
|
||||
//- For every unmerged triangle point the point in the triSurface
|
||||
labelList triPointMergeMap_;
|
||||
|
||||
//- triSurface points that have weighted interpolation
|
||||
DynamicList<label> interpolatedPoints_;
|
||||
|
||||
//- corresponding original, unmerged points
|
||||
DynamicList<FixedList<label, 3> > interpolatedOldPoints_;
|
||||
|
||||
//- corresponding weights
|
||||
DynamicList<FixedList<scalar, 3> > interpolationWeights_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
@ -214,19 +228,15 @@ class isoSurfaceCell
|
||||
void generateTriPoints
|
||||
(
|
||||
const DynamicList<Type>& snapped,
|
||||
const scalar isoVal0,
|
||||
const scalar s0,
|
||||
const Type& p0,
|
||||
const label p0Index,
|
||||
const scalar isoVal1,
|
||||
const scalar s1,
|
||||
const Type& p1,
|
||||
const label p1Index,
|
||||
const scalar isoVal2,
|
||||
const scalar s2,
|
||||
const Type& p2,
|
||||
const label p2Index,
|
||||
const scalar isoVal3,
|
||||
const scalar s3,
|
||||
const Type& p3,
|
||||
const label p3Index,
|
||||
@ -271,27 +281,6 @@ class isoSurfaceCell
|
||||
Map<labelList>& edgeFacesRest
|
||||
) const;
|
||||
|
||||
////- Determine orientation
|
||||
//static void walkOrientation
|
||||
//(
|
||||
// const triSurface& surf,
|
||||
// const List<FixedList<label, 3> >& faceEdges,
|
||||
// const labelList& edgeFace0,
|
||||
// const labelList& edgeFace1,
|
||||
// const label seedTriI,
|
||||
// labelList& flipState
|
||||
//);
|
||||
|
||||
////- Orient surface
|
||||
//static void orientSurface
|
||||
//(
|
||||
// triSurface&,
|
||||
// const List<FixedList<label, 3> >& faceEdges,
|
||||
// const labelList& edgeFace0,
|
||||
// const labelList& edgeFace1,
|
||||
// const Map<labelList>& edgeFacesRest
|
||||
//);
|
||||
|
||||
//- Is triangle (given by 3 edges) not fully connected?
|
||||
static bool danglingTriangle
|
||||
(
|
||||
@ -317,8 +306,6 @@ class isoSurfaceCell
|
||||
labelList& newToOldPoints
|
||||
);
|
||||
|
||||
//- Combine all triangles inside a cell into a minimal triangulation
|
||||
void combineCellTriangles();
|
||||
|
||||
public:
|
||||
|
||||
@ -336,6 +323,7 @@ public:
|
||||
const scalarField& pointValues,
|
||||
const scalar iso,
|
||||
const bool regularise,
|
||||
const boundBox& bounds = boundBox::greatBox,
|
||||
const scalar mergeTol = 1e-6 // fraction of bounding box
|
||||
);
|
||||
|
||||
@ -348,24 +336,6 @@ public:
|
||||
return meshCells_;
|
||||
}
|
||||
|
||||
//- For every unmerged triangle point the point in the triSurface
|
||||
const labelList triPointMergeMap() const
|
||||
{
|
||||
return triPointMergeMap_;
|
||||
}
|
||||
|
||||
|
||||
//- Interpolates cCoords,pCoords. Takes the original fields
|
||||
// used to create the iso surface.
|
||||
template<class Type>
|
||||
tmp<Field<Type> > interpolate
|
||||
(
|
||||
const scalarField& cVals,
|
||||
const scalarField& pVals,
|
||||
const Field<Type>& cCoords,
|
||||
const Field<Type>& pCoords
|
||||
) const;
|
||||
|
||||
//- Interpolates cCoords,pCoords.
|
||||
template<class Type>
|
||||
tmp<Field<Type> > interpolate
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
#include "isoSurfaceCell.H"
|
||||
#include "polyMesh.H"
|
||||
#include "tetMatcher.H"
|
||||
#include "isoSurface.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -76,22 +77,18 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
(
|
||||
const DynamicList<Type>& snapped,
|
||||
|
||||
const scalar isoVal0,
|
||||
const scalar s0,
|
||||
const Type& p0,
|
||||
const label p0Index,
|
||||
|
||||
const scalar isoVal1,
|
||||
const scalar s1,
|
||||
const Type& p1,
|
||||
const label p1Index,
|
||||
|
||||
const scalar isoVal2,
|
||||
const scalar s2,
|
||||
const Type& p2,
|
||||
const label p2Index,
|
||||
|
||||
const scalar isoVal3,
|
||||
const scalar s3,
|
||||
const Type& p3,
|
||||
const label p3Index,
|
||||
@ -124,160 +121,196 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
case 0x0F:
|
||||
break;
|
||||
|
||||
case 0x0E:
|
||||
case 0x01:
|
||||
case 0x0E:
|
||||
{
|
||||
// 0 is common point. Orient such that normal points in positive
|
||||
// gradient direction
|
||||
if (isoVal0 >= isoVal1)
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s0,p0,p0Index,s1,p1,p1Index)
|
||||
);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s0,p0,p0Index,s2,p2,p2Index)
|
||||
);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s0,p0,p0Index,s3,p3,p3Index)
|
||||
);
|
||||
if (triIndex == 0x0E)
|
||||
{
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s1,p1,p1Index));
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s2,p2,p2Index));
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s3,p3,p3Index));
|
||||
}
|
||||
else
|
||||
{
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s2,p2,p2Index));
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s1,p1,p1Index));
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s3,p3,p3Index));
|
||||
// Flip normals
|
||||
label sz = pts.size();
|
||||
Swap(pts[sz-2], pts[sz-1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0D:
|
||||
case 0x02:
|
||||
case 0x0D:
|
||||
{
|
||||
// 1 is common point
|
||||
if (isoVal1 >= isoVal0)
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s1,p1,p1Index,s0,p0,p0Index)
|
||||
);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s1,p1,p1Index,s3,p3,p3Index)
|
||||
);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s1,p1,p1Index,s2,p2,p2Index)
|
||||
);
|
||||
|
||||
if (triIndex == 0x0D)
|
||||
{
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s0,p0,p0Index));
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s3,p3,p3Index));
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s2,p2,p2Index));
|
||||
}
|
||||
else
|
||||
{
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s3,p3,p3Index));
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s0,p0,p0Index));
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s2,p2,p2Index));
|
||||
// Flip normals
|
||||
label sz = pts.size();
|
||||
Swap(pts[sz-2], pts[sz-1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0C:
|
||||
case 0x03:
|
||||
case 0x0C:
|
||||
{
|
||||
Type s02 = generatePoint(snapped,s0,p0,p0Index,s2,p2,p2Index);
|
||||
Type s13 = generatePoint(snapped,s1,p1,p1Index,s3,p3,p3Index);
|
||||
Type p0p2 =
|
||||
generatePoint(snapped,s0,p0,p0Index,s2,p2,p2Index);
|
||||
Type p1p3 =
|
||||
generatePoint(snapped,s1,p1,p1Index,s3,p3,p3Index);
|
||||
|
||||
if (isoVal0 >= isoVal3)
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s0,p0,p0Index,s3,p3,p3Index)
|
||||
);
|
||||
pts.append(p1p3);
|
||||
pts.append(p0p2);
|
||||
|
||||
pts.append(p1p3);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s1,p1,p1Index,s2,p2,p2Index)
|
||||
);
|
||||
pts.append(p0p2);
|
||||
|
||||
if (triIndex == 0x0C)
|
||||
{
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s3,p3,p3Index));
|
||||
pts.append(s02);
|
||||
pts.append(s13);
|
||||
pts.append(s13);
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s2,p2,p2Index));
|
||||
pts.append(s02);
|
||||
}
|
||||
else
|
||||
{
|
||||
pts.append(s02);
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s3,p3,p3Index));
|
||||
pts.append(s13);
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s2,p2,p2Index));
|
||||
pts.append(s13);
|
||||
pts.append(s02);
|
||||
// Flip normals
|
||||
label sz = pts.size();
|
||||
Swap(pts[sz-5], pts[sz-4]);
|
||||
Swap(pts[sz-2], pts[sz-1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0B:
|
||||
case 0x04:
|
||||
case 0x0B:
|
||||
{
|
||||
// 2 is common point
|
||||
if (isoVal2 >= isoVal0)
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s2,p2,p2Index,s0,p0,p0Index)
|
||||
);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s2,p2,p2Index,s1,p1,p1Index)
|
||||
);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s2,p2,p2Index,s3,p3,p3Index)
|
||||
);
|
||||
|
||||
if (triIndex == 0x0B)
|
||||
{
|
||||
pts.append(generatePoint(snapped,s2,p2,p2Index,s0,p0,p0Index));
|
||||
pts.append(generatePoint(snapped,s2,p2,p2Index,s1,p1,p1Index));
|
||||
pts.append(generatePoint(snapped,s2,p2,p2Index,s3,p3,p3Index));
|
||||
}
|
||||
else
|
||||
{
|
||||
pts.append(generatePoint(snapped,s2,p2,p2Index,s1,p1,p1Index));
|
||||
pts.append(generatePoint(snapped,s2,p2,p2Index,s0,p0,p0Index));
|
||||
pts.append(generatePoint(snapped,s2,p2,p2Index,s3,p3,p3Index));
|
||||
// Flip normals
|
||||
label sz = pts.size();
|
||||
Swap(pts[sz-2], pts[sz-1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0A:
|
||||
case 0x05:
|
||||
case 0x0A:
|
||||
{
|
||||
Type s01 = generatePoint(snapped,s0,p0,p0Index,s1,p1,p1Index);
|
||||
Type s23 = generatePoint(snapped,s2,p2,p2Index,s3,p3,p3Index);
|
||||
Type p0p1 =
|
||||
generatePoint(snapped,s0,p0,p0Index,s1,p1,p1Index);
|
||||
Type p2p3 =
|
||||
generatePoint(snapped,s2,p2,p2Index,s3,p3,p3Index);
|
||||
|
||||
if (isoVal3 >= isoVal0)
|
||||
pts.append(p0p1);
|
||||
pts.append(p2p3);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s0,p0,p0Index,s3,p3,p3Index)
|
||||
);
|
||||
|
||||
pts.append(p0p1);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s1,p1,p1Index,s2,p2,p2Index)
|
||||
);
|
||||
pts.append(p2p3);
|
||||
|
||||
if (triIndex == 0x0A)
|
||||
{
|
||||
pts.append(s01);
|
||||
pts.append(s23);
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s3,p3,p3Index));
|
||||
pts.append(s01);
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s2,p2,p2Index));
|
||||
pts.append(s23);
|
||||
}
|
||||
else
|
||||
{
|
||||
pts.append(s23);
|
||||
pts.append(s01);
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s3,p3,p3Index));
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s2,p2,p2Index));
|
||||
pts.append(s01);
|
||||
pts.append(s23);
|
||||
// Flip normals
|
||||
label sz = pts.size();
|
||||
Swap(pts[sz-5], pts[sz-4]);
|
||||
Swap(pts[sz-2], pts[sz-1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x09:
|
||||
case 0x06:
|
||||
case 0x09:
|
||||
{
|
||||
Type s01 = generatePoint(snapped,s0,p0,p0Index,s1,p1,p1Index);
|
||||
Type s23 = generatePoint(snapped,s2,p2,p2Index,s3,p3,p3Index);
|
||||
Type p0p1 =
|
||||
generatePoint(snapped,s0,p0,p0Index,s1,p1,p1Index);
|
||||
Type p2p3 =
|
||||
generatePoint(snapped,s2,p2,p2Index,s3,p3,p3Index);
|
||||
|
||||
if (isoVal3 >= isoVal1)
|
||||
pts.append(p0p1);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s1,p1,p1Index,s3,p3,p3Index)
|
||||
);
|
||||
pts.append(p2p3);
|
||||
|
||||
pts.append(p0p1);
|
||||
pts.append(p2p3);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s0,p0,p0Index,s2,p2,p2Index)
|
||||
);
|
||||
|
||||
if (triIndex == 0x09)
|
||||
{
|
||||
pts.append(s01);
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s3,p3,p3Index));
|
||||
pts.append(s23);
|
||||
pts.append(s01);
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s2,p2,p2Index));
|
||||
pts.append(s23);
|
||||
}
|
||||
else
|
||||
{
|
||||
pts.append(generatePoint(snapped,s1,p1,p1Index,s3,p3,p3Index));
|
||||
pts.append(s01);
|
||||
pts.append(s23);
|
||||
pts.append(generatePoint(snapped,s0,p0,p0Index,s2,p2,p2Index));
|
||||
pts.append(s01);
|
||||
pts.append(s23);
|
||||
// Flip normals
|
||||
label sz = pts.size();
|
||||
Swap(pts[sz-5], pts[sz-4]);
|
||||
Swap(pts[sz-2], pts[sz-1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x07:
|
||||
case 0x08:
|
||||
case 0x07:
|
||||
{
|
||||
// 3 is common point
|
||||
if (isoVal3 >= isoVal0)
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s3,p3,p3Index,s0,p0,p0Index)
|
||||
);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s3,p3,p3Index,s2,p2,p2Index)
|
||||
);
|
||||
pts.append
|
||||
(
|
||||
generatePoint(snapped,s3,p3,p3Index,s1,p1,p1Index)
|
||||
);
|
||||
if (triIndex == 0x07)
|
||||
{
|
||||
pts.append(generatePoint(snapped,s3,p3,p3Index,s0,p0,p0Index));
|
||||
pts.append(generatePoint(snapped,s3,p3,p3Index,s2,p2,p2Index));
|
||||
pts.append(generatePoint(snapped,s3,p3,p3Index,s1,p1,p1Index));
|
||||
}
|
||||
else
|
||||
{
|
||||
pts.append(generatePoint(snapped,s3,p3,p3Index,s2,p2,p2Index));
|
||||
pts.append(generatePoint(snapped,s3,p3,p3Index,s0,p0,p0Index));
|
||||
pts.append(generatePoint(snapped,s3,p3,p3Index,s1,p1,p1Index));
|
||||
// Flip normals
|
||||
label sz = pts.size();
|
||||
Swap(pts[sz-2], pts[sz-1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -341,22 +374,18 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
(
|
||||
snappedPoints,
|
||||
|
||||
pVals_[f0[1]],
|
||||
pVals[f0[1]],
|
||||
pCoords[f0[1]],
|
||||
snappedPoint[f0[1]],
|
||||
|
||||
pVals_[f0[0]],
|
||||
pVals[f0[0]],
|
||||
pCoords[f0[0]],
|
||||
snappedPoint[f0[0]],
|
||||
|
||||
pVals_[f0[2]],
|
||||
pVals[f0[2]],
|
||||
pCoords[f0[2]],
|
||||
snappedPoint[f0[2]],
|
||||
|
||||
pVals_[oppositeI],
|
||||
pVals[oppositeI],
|
||||
pCoords[oppositeI],
|
||||
snappedPoint[oppositeI],
|
||||
@ -370,22 +399,18 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
(
|
||||
snappedPoints,
|
||||
|
||||
pVals_[f0[0]],
|
||||
pVals[f0[0]],
|
||||
pCoords[f0[0]],
|
||||
snappedPoint[f0[0]],
|
||||
|
||||
pVals_[f0[1]],
|
||||
pVals[f0[1]],
|
||||
pCoords[f0[1]],
|
||||
snappedPoint[f0[1]],
|
||||
|
||||
pVals_[f0[2]],
|
||||
pVals[f0[2]],
|
||||
pCoords[f0[2]],
|
||||
snappedPoint[f0[2]],
|
||||
|
||||
pVals_[oppositeI],
|
||||
pVals[oppositeI],
|
||||
pCoords[oppositeI],
|
||||
snappedPoint[oppositeI],
|
||||
@ -411,7 +436,6 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
}
|
||||
|
||||
label fp = f.fcIndex(fp0);
|
||||
|
||||
for (label i = 2; i < f.size(); i++)
|
||||
{
|
||||
label nextFp = f.fcIndex(fp);
|
||||
@ -425,22 +449,18 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
(
|
||||
snappedPoints,
|
||||
|
||||
pVals_[tri[1]],
|
||||
pVals[tri[1]],
|
||||
pCoords[tri[1]],
|
||||
snappedPoint[tri[1]],
|
||||
|
||||
pVals_[tri[0]],
|
||||
pVals[tri[0]],
|
||||
pCoords[tri[0]],
|
||||
snappedPoint[tri[0]],
|
||||
|
||||
pVals_[tri[2]],
|
||||
pVals[tri[2]],
|
||||
pCoords[tri[2]],
|
||||
snappedPoint[tri[2]],
|
||||
|
||||
cVals_[cellI],
|
||||
cVals[cellI],
|
||||
cCoords[cellI],
|
||||
snappedCc[cellI],
|
||||
@ -454,22 +474,18 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
(
|
||||
snappedPoints,
|
||||
|
||||
pVals_[tri[0]],
|
||||
pVals[tri[0]],
|
||||
pCoords[tri[0]],
|
||||
snappedPoint[tri[0]],
|
||||
|
||||
pVals_[tri[1]],
|
||||
pVals[tri[1]],
|
||||
pCoords[tri[1]],
|
||||
snappedPoint[tri[1]],
|
||||
|
||||
pVals_[tri[2]],
|
||||
pVals[tri[2]],
|
||||
pCoords[tri[2]],
|
||||
snappedPoint[tri[2]],
|
||||
|
||||
cVals_[cellI],
|
||||
cVals[cellI],
|
||||
cCoords[cellI],
|
||||
snappedCc[cellI],
|
||||
@ -495,7 +511,7 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
|
||||
if (countNotFoundTets > 0)
|
||||
{
|
||||
WarningIn("Foam::isoSurfaceCell::generateTriPoints")
|
||||
WarningInFunction
|
||||
<< "Could not find " << countNotFoundTets
|
||||
<< " tet base points, which may lead to inverted triangles."
|
||||
<< endl;
|
||||
@ -510,13 +526,11 @@ template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::isoSurfaceCell::interpolate
|
||||
(
|
||||
const scalarField& cVals,
|
||||
const scalarField& pVals,
|
||||
const Field<Type>& cCoords,
|
||||
const Field<Type>& pCoords
|
||||
) const
|
||||
{
|
||||
DynamicList<Type> triPoints(nCutCells_);
|
||||
DynamicList<Type> triPoints(3*nCutCells_);
|
||||
DynamicList<label> triMeshCells(nCutCells_);
|
||||
|
||||
// Dummy snap data
|
||||
@ -524,59 +538,6 @@ Foam::isoSurfaceCell::interpolate
|
||||
labelList snappedCc(mesh_.nCells(), -1);
|
||||
labelList snappedPoint(mesh_.nPoints(), -1);
|
||||
|
||||
|
||||
generateTriPoints
|
||||
(
|
||||
cVals,
|
||||
pVals,
|
||||
|
||||
cCoords,
|
||||
pCoords,
|
||||
|
||||
snappedPoints,
|
||||
snappedCc,
|
||||
snappedPoint,
|
||||
|
||||
triPoints,
|
||||
triMeshCells
|
||||
);
|
||||
|
||||
|
||||
// One value per point
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues();
|
||||
|
||||
forAll(triPoints, i)
|
||||
{
|
||||
label mergedPointI = triPointMergeMap_[i];
|
||||
|
||||
if (mergedPointI >= 0)
|
||||
{
|
||||
values[mergedPointI] = triPoints[i];
|
||||
}
|
||||
}
|
||||
|
||||
return tvalues;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::isoSurfaceCell::interpolate
|
||||
(
|
||||
const Field<Type>& cCoords,
|
||||
const Field<Type>& pCoords
|
||||
) const
|
||||
{
|
||||
DynamicList<Type> triPoints(nCutCells_);
|
||||
DynamicList<label> triMeshCells(nCutCells_);
|
||||
|
||||
// Dummy snap data
|
||||
DynamicList<Type> snappedPoints;
|
||||
labelList snappedCc(mesh_.nCells(), -1);
|
||||
labelList snappedPoint(mesh_.nPoints(), -1);
|
||||
|
||||
|
||||
generateTriPoints
|
||||
(
|
||||
cVals_,
|
||||
@ -593,22 +554,15 @@ Foam::isoSurfaceCell::interpolate
|
||||
triMeshCells
|
||||
);
|
||||
|
||||
|
||||
// One value per point
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues();
|
||||
|
||||
forAll(triPoints, i)
|
||||
{
|
||||
label mergedPointI = triPointMergeMap_[i];
|
||||
|
||||
if (mergedPointI >= 0)
|
||||
{
|
||||
values[mergedPointI] = triPoints[i];
|
||||
}
|
||||
}
|
||||
|
||||
return tvalues;
|
||||
return isoSurface::interpolate
|
||||
(
|
||||
points().size(),
|
||||
triPointMergeMap_,
|
||||
interpolatedPoints_,
|
||||
interpolatedOldPoints_,
|
||||
interpolationWeights_,
|
||||
triPoints
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -120,7 +120,7 @@ Foam::isoSurface::adaptPatchFields
|
||||
{
|
||||
fvPatchField<Type>& pfld = const_cast<fvPatchField<Type>&>
|
||||
(
|
||||
fld.boundaryField()[patchI]
|
||||
sliceFld.boundaryField()[patchI]
|
||||
);
|
||||
|
||||
const scalarField& w = mesh.weights().boundaryField()[patchI];
|
||||
@ -189,6 +189,8 @@ Type Foam::isoSurface::generatePoint
|
||||
}
|
||||
|
||||
|
||||
// Note: cannot use simpler isoSurfaceCell::generateTriPoints since
|
||||
// the need here to sometimes pass in remote 'snappedPoints'
|
||||
template<class Type>
|
||||
void Foam::isoSurface::generateTriPoints
|
||||
(
|
||||
@ -240,8 +242,8 @@ void Foam::isoSurface::generateTriPoints
|
||||
case 0x0F:
|
||||
break;
|
||||
|
||||
case 0x0E:
|
||||
case 0x01:
|
||||
case 0x0E:
|
||||
points.append
|
||||
(
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1)
|
||||
@ -254,10 +256,16 @@ void Foam::isoSurface::generateTriPoints
|
||||
(
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
|
||||
);
|
||||
if (triIndex == 0x0E)
|
||||
{
|
||||
// Flip normals
|
||||
label sz = points.size();
|
||||
Swap(points[sz-2], points[sz-1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0D:
|
||||
case 0x02:
|
||||
case 0x0D:
|
||||
points.append
|
||||
(
|
||||
generatePoint(s1,p1,hasSnap1,snapP1,s0,p0,hasSnap0,snapP0)
|
||||
@ -270,97 +278,133 @@ void Foam::isoSurface::generateTriPoints
|
||||
(
|
||||
generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
|
||||
);
|
||||
if (triIndex == 0x0D)
|
||||
{
|
||||
// Flip normals
|
||||
label sz = points.size();
|
||||
Swap(points[sz-2], points[sz-1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0C:
|
||||
case 0x03:
|
||||
{
|
||||
Type tp1 =
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2);
|
||||
Type tp2 =
|
||||
generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3);
|
||||
case 0x0C:
|
||||
{
|
||||
Type p0p2 =
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2);
|
||||
Type p1p3 =
|
||||
generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3);
|
||||
|
||||
points.append
|
||||
(
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
|
||||
);
|
||||
points.append(tp1);
|
||||
points.append(tp2);
|
||||
points.append(tp2);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
|
||||
);
|
||||
points.append(tp1);
|
||||
}
|
||||
points.append
|
||||
(
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
|
||||
);
|
||||
points.append(p1p3);
|
||||
points.append(p0p2);
|
||||
|
||||
points.append(p1p3);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
|
||||
);
|
||||
points.append(p0p2);
|
||||
}
|
||||
if (triIndex == 0x0C)
|
||||
{
|
||||
// Flip normals
|
||||
label sz = points.size();
|
||||
Swap(points[sz-5], points[sz-4]);
|
||||
Swap(points[sz-2], points[sz-1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0B:
|
||||
case 0x04:
|
||||
{
|
||||
points.append
|
||||
(
|
||||
generatePoint(s2,p2,hasSnap2,snapP2,s0,p0,hasSnap0,snapP0)
|
||||
);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s2,p2,hasSnap2,snapP2,s1,p1,hasSnap1,snapP1)
|
||||
);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3)
|
||||
);
|
||||
}
|
||||
case 0x0B:
|
||||
{
|
||||
points.append
|
||||
(
|
||||
generatePoint(s2,p2,hasSnap2,snapP2,s0,p0,hasSnap0,snapP0)
|
||||
);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s2,p2,hasSnap2,snapP2,s1,p1,hasSnap1,snapP1)
|
||||
);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3)
|
||||
);
|
||||
}
|
||||
if (triIndex == 0x0B)
|
||||
{
|
||||
// Flip normals
|
||||
label sz = points.size();
|
||||
Swap(points[sz-2], points[sz-1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0A:
|
||||
case 0x05:
|
||||
{
|
||||
Type tp0 =
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1);
|
||||
Type tp1 =
|
||||
generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3);
|
||||
case 0x0A:
|
||||
{
|
||||
Type p0p1 =
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1);
|
||||
Type p2p3 =
|
||||
generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3);
|
||||
|
||||
points.append(tp0);
|
||||
points.append(tp1);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
|
||||
);
|
||||
points.append(tp0);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
|
||||
);
|
||||
points.append(tp1);
|
||||
}
|
||||
points.append(p0p1);
|
||||
points.append(p2p3);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
|
||||
);
|
||||
|
||||
points.append(p0p1);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
|
||||
);
|
||||
points.append(p2p3);
|
||||
}
|
||||
if (triIndex == 0x0A)
|
||||
{
|
||||
// Flip normals
|
||||
label sz = points.size();
|
||||
Swap(points[sz-5], points[sz-4]);
|
||||
Swap(points[sz-2], points[sz-1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x09:
|
||||
case 0x06:
|
||||
{
|
||||
Type tp0 =
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1);
|
||||
Type tp1 =
|
||||
generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3);
|
||||
case 0x09:
|
||||
{
|
||||
Type p0p1 =
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1);
|
||||
Type p2p3 =
|
||||
generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3);
|
||||
|
||||
points.append(tp0);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3)
|
||||
);
|
||||
points.append(tp1);
|
||||
points.append(tp0);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2)
|
||||
);
|
||||
points.append(tp1);
|
||||
}
|
||||
points.append(p0p1);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3)
|
||||
);
|
||||
points.append(p2p3);
|
||||
|
||||
points.append(p0p1);
|
||||
points.append(p2p3);
|
||||
points.append
|
||||
(
|
||||
generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2)
|
||||
);
|
||||
}
|
||||
if (triIndex == 0x09)
|
||||
{
|
||||
// Flip normals
|
||||
label sz = points.size();
|
||||
Swap(points[sz-5], points[sz-4]);
|
||||
Swap(points[sz-2], points[sz-1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x07:
|
||||
case 0x08:
|
||||
case 0x07:
|
||||
points.append
|
||||
(
|
||||
generatePoint(s3,p3,hasSnap3,snapP3,s0,p0,hasSnap0,snapP0)
|
||||
@ -373,6 +417,12 @@ void Foam::isoSurface::generateTriPoints
|
||||
(
|
||||
generatePoint(s3,p3,hasSnap3,snapP3,s1,p1,hasSnap1,snapP1)
|
||||
);
|
||||
if (triIndex == 0x07)
|
||||
{
|
||||
// Flip normals
|
||||
label sz = points.size();
|
||||
Swap(points[sz-2], points[sz-1]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -492,7 +542,7 @@ void Foam::isoSurface::generateTriPoints
|
||||
|| (snappedPoint.size() != mesh_.nPoints())
|
||||
)
|
||||
{
|
||||
FatalErrorIn("isoSurface::generateTriPoints(..)")
|
||||
FatalErrorInFunction
|
||||
<< "Incorrect size." << endl
|
||||
<< "mesh: nCells:" << mesh_.nCells()
|
||||
<< " points:" << mesh_.nPoints() << endl
|
||||
@ -689,6 +739,69 @@ void Foam::isoSurface::generateTriPoints
|
||||
//}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::isoSurface::interpolate
|
||||
(
|
||||
const label nPoints,
|
||||
const labelList& triPointMergeMap,
|
||||
const labelList& interpolatedPoints,
|
||||
const List<FixedList<label, 3> >& interpolatedOldPoints,
|
||||
const List<FixedList<scalar, 3> >& interpolationWeights,
|
||||
const DynamicList<Type>& unmergedValues
|
||||
)
|
||||
{
|
||||
// One value per point
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(nPoints, pTraits<Type>::zero));
|
||||
Field<Type>& values = tvalues();
|
||||
|
||||
|
||||
// Pass1: unweighted average of merged point values
|
||||
{
|
||||
labelList nValues(values.size(), 0);
|
||||
|
||||
forAll(unmergedValues, i)
|
||||
{
|
||||
label mergedPointI = triPointMergeMap[i];
|
||||
|
||||
if (mergedPointI >= 0)
|
||||
{
|
||||
values[mergedPointI] += unmergedValues[i];
|
||||
nValues[mergedPointI]++;
|
||||
}
|
||||
}
|
||||
|
||||
forAll(values, i)
|
||||
{
|
||||
if (nValues[i] > 0)
|
||||
{
|
||||
values[i] /= scalar(nValues[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Pass2: weighted average for remaining values (from clipped triangles)
|
||||
|
||||
forAll(interpolatedPoints, i)
|
||||
{
|
||||
label pointI = interpolatedPoints[i];
|
||||
const FixedList<label, 3>& oldPoints = interpolatedOldPoints[i];
|
||||
const FixedList<scalar, 3>& w = interpolationWeights[i];
|
||||
|
||||
// Note: zeroing should not be necessary if interpolation only done
|
||||
// for newly introduced points (i.e. not in triPointMergeMap)
|
||||
values[pointI] = pTraits<Type>::zero;
|
||||
forAll(oldPoints, j)
|
||||
{
|
||||
values[pointI] = w[j]*unmergedValues[oldPoints[j]];
|
||||
}
|
||||
}
|
||||
|
||||
return tvalues;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::isoSurface::interpolate
|
||||
@ -707,7 +820,7 @@ Foam::isoSurface::interpolate
|
||||
> > c2(adaptPatchFields(cCoords));
|
||||
|
||||
|
||||
DynamicList<Type> triPoints(nCutCells_);
|
||||
DynamicList<Type> triPoints(3*nCutCells_);
|
||||
DynamicList<label> triMeshCells(nCutCells_);
|
||||
|
||||
// Dummy snap data
|
||||
@ -731,52 +844,15 @@ Foam::isoSurface::interpolate
|
||||
triMeshCells
|
||||
);
|
||||
|
||||
|
||||
// One value per point
|
||||
tmp<Field<Type> > tvalues
|
||||
return interpolate
|
||||
(
|
||||
new Field<Type>(points().size(), pTraits<Type>::zero)
|
||||
points().size(),
|
||||
triPointMergeMap_,
|
||||
interpolatedPoints_,
|
||||
interpolatedOldPoints_,
|
||||
interpolationWeights_,
|
||||
triPoints
|
||||
);
|
||||
Field<Type>& values = tvalues();
|
||||
labelList nValues(values.size(), 0);
|
||||
|
||||
forAll(triPoints, i)
|
||||
{
|
||||
label mergedPointI = triPointMergeMap_[i];
|
||||
|
||||
if (mergedPointI >= 0)
|
||||
{
|
||||
values[mergedPointI] += triPoints[i];
|
||||
nValues[mergedPointI]++;
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "nValues:" << values.size() << endl;
|
||||
label nMult = 0;
|
||||
forAll(nValues, i)
|
||||
{
|
||||
if (nValues[i] == 0)
|
||||
{
|
||||
FatalErrorIn("isoSurface::interpolate(..)")
|
||||
<< "point:" << i << " nValues:" << nValues[i]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
else if (nValues[i] > 1)
|
||||
{
|
||||
nMult++;
|
||||
}
|
||||
}
|
||||
Pout<< "Of which mult:" << nMult << endl;
|
||||
}
|
||||
|
||||
forAll(values, i)
|
||||
{
|
||||
values[i] /= scalar(nValues[i]);
|
||||
}
|
||||
|
||||
return tvalues;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("sampledIsoSurface::getIsoFields()")
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find isosurface field " << isoField_
|
||||
<< " in database or directory " << vfHeader.path()
|
||||
<< exit(FatalError);
|
||||
@ -122,18 +122,52 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
// Get pointField
|
||||
// ~~~~~~~~~~~~~~
|
||||
|
||||
// In case of multiple iso values we don't want to calculate multiple e.g.
|
||||
// "volPointInterpolate(p)" so register it and re-use it. This is the
|
||||
// same as the 'cache' functionality from volPointInterpolate but
|
||||
// unfortunately that one does not guarantee that the field pointer
|
||||
// remain: e.g. some other
|
||||
// functionObject might delete the cached version.
|
||||
// (volPointInterpolation::interpolate with cache=false deletes any
|
||||
// registered one or if mesh.changing())
|
||||
|
||||
if (!subMeshPtr_.valid())
|
||||
{
|
||||
word pointFldName = "volPointInterpolate(" + isoField_ + ')';
|
||||
const word pointFldName =
|
||||
"volPointInterpolate_"
|
||||
+ type()
|
||||
+ "("
|
||||
+ isoField_
|
||||
+ ')';
|
||||
|
||||
if (fvm.foundObject<pointScalarField>(pointFldName))
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() : lookup pointField "
|
||||
<< pointFldName << endl;
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " lookup pointField " << pointFldName << endl;
|
||||
}
|
||||
pointFieldPtr_ = &fvm.lookupObject<pointScalarField>(pointFldName);
|
||||
const pointScalarField& pfld = fvm.lookupObject<pointScalarField>
|
||||
(
|
||||
pointFldName
|
||||
);
|
||||
|
||||
if (!pfld.upToDate(*volFieldPtr_))
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " updating pointField " << pointFldName << endl;
|
||||
}
|
||||
// Update the interpolated value
|
||||
volPointInterpolation::New(fvm).interpolate
|
||||
(
|
||||
*volFieldPtr_,
|
||||
const_cast<pointScalarField&>(pfld)
|
||||
);
|
||||
}
|
||||
|
||||
pointFieldPtr_ = &pfld;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -141,33 +175,23 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() : "
|
||||
<< "checking pointField " << pointFldName
|
||||
<< " for same time " << fvm.time().timeName()
|
||||
<< endl;
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " creating and storing pointField "
|
||||
<< pointFldName << " for time "
|
||||
<< fvm.time().timeName() << endl;
|
||||
}
|
||||
|
||||
if
|
||||
tmp<pointScalarField> tpfld
|
||||
(
|
||||
storedPointFieldPtr_.empty()
|
||||
|| (fvm.time().timeName() != storedPointFieldPtr_().instance())
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " interpolating volField " << volFieldPtr_->name()
|
||||
<< " to get pointField " << pointFldName << endl;
|
||||
}
|
||||
|
||||
storedPointFieldPtr_.reset
|
||||
volPointInterpolation::New(fvm).interpolate
|
||||
(
|
||||
volPointInterpolation::New(fvm)
|
||||
.interpolate(*volFieldPtr_).ptr()
|
||||
);
|
||||
storedPointFieldPtr_->checkOut();
|
||||
pointFieldPtr_ = storedPointFieldPtr_.operator->();
|
||||
}
|
||||
*volFieldPtr_,
|
||||
pointFldName,
|
||||
false
|
||||
)
|
||||
);
|
||||
pointFieldPtr_ = tpfld.ptr();
|
||||
const_cast<pointScalarField*>(pointFieldPtr_)->store();
|
||||
}
|
||||
|
||||
|
||||
@ -233,8 +257,10 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
|
||||
// Pointfield on submesh
|
||||
|
||||
word pointFldName =
|
||||
"volPointInterpolate("
|
||||
const word pointFldName =
|
||||
"volPointInterpolate_"
|
||||
+ type()
|
||||
+ "("
|
||||
+ volSubFieldPtr_->name()
|
||||
+ ')';
|
||||
|
||||
@ -245,11 +271,28 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " submesh lookup pointField " << pointFldName << endl;
|
||||
}
|
||||
storedPointSubFieldPtr_.clear();
|
||||
pointSubFieldPtr_ = &subFvm.lookupObject<pointScalarField>
|
||||
const pointScalarField& pfld = subFvm.lookupObject<pointScalarField>
|
||||
(
|
||||
pointFldName
|
||||
);
|
||||
|
||||
if (!pfld.upToDate(*volSubFieldPtr_))
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " updating submesh pointField "
|
||||
<< pointFldName << endl;
|
||||
}
|
||||
// Update the interpolated value
|
||||
volPointInterpolation::New(subFvm).interpolate
|
||||
(
|
||||
*volSubFieldPtr_,
|
||||
const_cast<pointScalarField&>(pfld)
|
||||
);
|
||||
}
|
||||
|
||||
pointFieldPtr_ = &pfld;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -260,15 +303,15 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
<< volSubFieldPtr_->name()
|
||||
<< " to get submesh pointField " << pointFldName << endl;
|
||||
}
|
||||
storedPointSubFieldPtr_.reset
|
||||
tmp<pointScalarField> tpfld
|
||||
(
|
||||
volPointInterpolation::New
|
||||
(
|
||||
subFvm
|
||||
).interpolate(*volSubFieldPtr_).ptr()
|
||||
).interpolate(*volSubFieldPtr_)
|
||||
);
|
||||
storedPointSubFieldPtr_->checkOut();
|
||||
pointSubFieldPtr_ = storedPointSubFieldPtr_.operator->();
|
||||
pointSubFieldPtr_ = tpfld.ptr();
|
||||
const_cast<pointScalarField*>(pointSubFieldPtr_)->store();
|
||||
}
|
||||
|
||||
|
||||
@ -349,28 +392,34 @@ bool Foam::sampledIsoSurface::updateGeometry() const
|
||||
|
||||
if (subMeshPtr_.valid())
|
||||
{
|
||||
const volScalarField& vfld = *volSubFieldPtr_;
|
||||
|
||||
surfPtr_.reset
|
||||
(
|
||||
new isoSurface
|
||||
(
|
||||
*volSubFieldPtr_,
|
||||
vfld,
|
||||
*pointSubFieldPtr_,
|
||||
isoVal_,
|
||||
regularise_,
|
||||
bounds_,
|
||||
mergeTol_
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
const volScalarField& vfld = *volFieldPtr_;
|
||||
|
||||
surfPtr_.reset
|
||||
(
|
||||
new isoSurface
|
||||
(
|
||||
*volFieldPtr_,
|
||||
vfld,
|
||||
*pointFieldPtr_,
|
||||
isoVal_,
|
||||
regularise_,
|
||||
bounds_,
|
||||
mergeTol_
|
||||
)
|
||||
);
|
||||
@ -412,6 +461,7 @@ Foam::sampledIsoSurface::sampledIsoSurface
|
||||
sampledSurface(name, mesh, dict),
|
||||
isoField_(dict.lookup("isoField")),
|
||||
isoVal_(readScalar(dict.lookup("isoValue"))),
|
||||
bounds_(dict.lookupOrDefault("bounds", boundBox::greatBox)),
|
||||
mergeTol_(dict.lookupOrDefault("mergeTol", 1e-6)),
|
||||
regularise_(dict.lookupOrDefault("regularise", true)),
|
||||
average_(dict.lookupOrDefault("average", false)),
|
||||
@ -422,15 +472,12 @@ Foam::sampledIsoSurface::sampledIsoSurface
|
||||
prevTimeIndex_(-1),
|
||||
storedVolFieldPtr_(NULL),
|
||||
volFieldPtr_(NULL),
|
||||
storedPointFieldPtr_(NULL),
|
||||
pointFieldPtr_(NULL)
|
||||
{
|
||||
if (!sampledSurface::interpolate())
|
||||
{
|
||||
FatalIOErrorIn
|
||||
FatalIOErrorInFunction
|
||||
(
|
||||
"sampledIsoSurface::sampledIsoSurface"
|
||||
"(const word&, const polyMesh&, const dictionary&)",
|
||||
dict
|
||||
) << "Non-interpolated iso surface not supported since triangles"
|
||||
<< " span across cells." << exit(FatalIOError);
|
||||
@ -442,10 +489,8 @@ Foam::sampledIsoSurface::sampledIsoSurface
|
||||
|
||||
if (mesh.boundaryMesh().findPatchID(exposedPatchName_) == -1)
|
||||
{
|
||||
FatalIOErrorIn
|
||||
FatalIOErrorInFunction
|
||||
(
|
||||
"sampledIsoSurface::sampledIsoSurface"
|
||||
"(const word&, const polyMesh&, const dictionary&)",
|
||||
dict
|
||||
) << "Cannot find patch " << exposedPatchName_
|
||||
<< " in which to put exposed faces." << endl
|
||||
|
||||
@ -63,6 +63,9 @@ class sampledIsoSurface
|
||||
//- Iso value
|
||||
const scalar isoVal_;
|
||||
|
||||
//- Optional bounding box to trim triangles against
|
||||
const boundBox bounds_;
|
||||
|
||||
//- Merge tolerance
|
||||
const scalar mergeTol_;
|
||||
|
||||
@ -94,7 +97,6 @@ class sampledIsoSurface
|
||||
mutable const volScalarField* volFieldPtr_;
|
||||
|
||||
//- Cached pointfield
|
||||
mutable autoPtr<pointScalarField> storedPointFieldPtr_;
|
||||
mutable const pointScalarField* pointFieldPtr_;
|
||||
|
||||
// And on subsetted mesh
|
||||
@ -107,7 +109,6 @@ class sampledIsoSurface
|
||||
mutable const volScalarField* volSubFieldPtr_;
|
||||
|
||||
//- Cached pointfield
|
||||
mutable autoPtr<pointScalarField> storedPointSubFieldPtr_;
|
||||
mutable const pointScalarField* pointSubFieldPtr_;
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -148,7 +148,8 @@ bool Foam::sampledIsoSurfaceCell::updateGeometry() const
|
||||
cellAvg,
|
||||
pointFld().internalField(),
|
||||
isoVal_,
|
||||
regularise_
|
||||
regularise_,
|
||||
bounds_
|
||||
);
|
||||
|
||||
const_cast<sampledIsoSurfaceCell&>
|
||||
@ -166,7 +167,8 @@ bool Foam::sampledIsoSurfaceCell::updateGeometry() const
|
||||
cellFld.internalField(),
|
||||
pointFld().internalField(),
|
||||
isoVal_,
|
||||
regularise_
|
||||
regularise_,
|
||||
bounds_
|
||||
);
|
||||
|
||||
const_cast<sampledIsoSurfaceCell&>
|
||||
@ -185,6 +187,7 @@ bool Foam::sampledIsoSurfaceCell::updateGeometry() const
|
||||
<< " average : " << average_ << nl
|
||||
<< " isoField : " << isoField_ << nl
|
||||
<< " isoValue : " << isoVal_ << nl
|
||||
<< " bounds : " << bounds_ << nl
|
||||
<< " points : " << points().size() << nl
|
||||
<< " tris : " << triSurface::size() << nl
|
||||
<< " cut cells : " << meshCells_.size() << endl;
|
||||
@ -206,6 +209,7 @@ Foam::sampledIsoSurfaceCell::sampledIsoSurfaceCell
|
||||
sampledSurface(name, mesh, dict),
|
||||
isoField_(dict.lookup("isoField")),
|
||||
isoVal_(readScalar(dict.lookup("isoValue"))),
|
||||
bounds_(dict.lookupOrDefault("bounds", boundBox::greatBox)),
|
||||
regularise_(dict.lookupOrDefault("regularise", true)),
|
||||
average_(dict.lookupOrDefault("average", true)),
|
||||
zoneKey_(keyType::null),
|
||||
|
||||
@ -62,6 +62,9 @@ class sampledIsoSurfaceCell
|
||||
//- Iso value
|
||||
const scalar isoVal_;
|
||||
|
||||
//- Optional bounding box to trim triangles against
|
||||
const boundBox bounds_;
|
||||
|
||||
//- Whether to coarse
|
||||
const Switch regularise_;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -230,6 +230,7 @@ void Foam::sampledCuttingPlane::createGeometry()
|
||||
pointDistance_,
|
||||
0.0,
|
||||
regularise_,
|
||||
bounds_,
|
||||
mergeTol_
|
||||
)
|
||||
//new isoSurfaceCell
|
||||
@ -262,6 +263,7 @@ Foam::sampledCuttingPlane::sampledCuttingPlane
|
||||
:
|
||||
sampledSurface(name, mesh, dict),
|
||||
plane_(dict),
|
||||
bounds_(dict.lookupOrDefault("bounds", boundBox::greatBox)),
|
||||
mergeTol_(dict.lookupOrDefault("mergeTol", 1e-6)),
|
||||
regularise_(dict.lookupOrDefault("regularise", true)),
|
||||
average_(dict.lookupOrDefault("average", false)),
|
||||
@ -279,11 +281,8 @@ Foam::sampledCuttingPlane::sampledCuttingPlane
|
||||
|
||||
if (mesh.boundaryMesh().findPatchID(exposedPatchName_) == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"sampledCuttingPlane::sampledCuttingPlane"
|
||||
"(const word&, const polyMesh&, const dictionary&)"
|
||||
) << "Cannot find patch " << exposedPatchName_
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find patch " << exposedPatchName_
|
||||
<< " in which to put exposed faces." << endl
|
||||
<< "Valid patches are " << mesh.boundaryMesh().names()
|
||||
<< exit(FatalError);
|
||||
|
||||
@ -60,6 +60,9 @@ class sampledCuttingPlane
|
||||
//- Plane
|
||||
const plane plane_;
|
||||
|
||||
//- Optional bounding box to trim triangles against
|
||||
const boundBox bounds_;
|
||||
|
||||
//- Merge tolerance
|
||||
const scalar mergeTol_;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -84,11 +84,7 @@ const Foam::labelList& Foam::sampledPatch::patchIDs() const
|
||||
{
|
||||
if (patchIDs_.empty())
|
||||
{
|
||||
patchIDs_ = mesh().boundaryMesh().patchSet
|
||||
(
|
||||
patchNames_,
|
||||
false
|
||||
).sortedToc();
|
||||
patchIDs_ = mesh().boundaryMesh().patchSet(patchNames_).sortedToc();
|
||||
}
|
||||
return patchIDs_;
|
||||
}
|
||||
@ -135,7 +131,7 @@ bool Foam::sampledPatch::update()
|
||||
|
||||
if (isA<emptyPolyPatch>(pp))
|
||||
{
|
||||
FatalErrorIn("sampledPatch::update()")
|
||||
FatalErrorInFunction
|
||||
<< "Cannot sample an empty patch. Patch " << pp.name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -53,7 +53,7 @@ void Foam::sampledSurface::makeSf() const
|
||||
// It is an error to recalculate if the pointer is already set
|
||||
if (SfPtr_)
|
||||
{
|
||||
FatalErrorIn("Foam::sampledSurface::makeSf()")
|
||||
FatalErrorInFunction
|
||||
<< "face area vectors already exist"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -74,7 +74,7 @@ void Foam::sampledSurface::makeMagSf() const
|
||||
// It is an error to recalculate if the pointer is already set
|
||||
if (magSfPtr_)
|
||||
{
|
||||
FatalErrorIn("Foam::sampledSurface::makeMagSf()")
|
||||
FatalErrorInFunction
|
||||
<< "mag face areas already exist"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -95,7 +95,7 @@ void Foam::sampledSurface::makeCf() const
|
||||
// It is an error to recalculate if the pointer is already set
|
||||
if (CfPtr_)
|
||||
{
|
||||
FatalErrorIn("Foam::sampledSurface::makeCf()")
|
||||
FatalErrorInFunction
|
||||
<< "face centres already exist"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -132,11 +132,8 @@ Foam::autoPtr<Foam::sampledSurface> Foam::sampledSurface::New
|
||||
|
||||
if (cstrIter == wordConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"sampledSurface::New"
|
||||
"(const word&, const polyMesh&, const dictionary&)"
|
||||
) << "Unknown sample type "
|
||||
FatalErrorInFunction
|
||||
<< "Unknown sample type "
|
||||
<< sampleType << nl << nl
|
||||
<< "Valid sample types : " << endl
|
||||
<< wordConstructorTablePtr_->sortedToc()
|
||||
@ -245,7 +242,7 @@ Foam::tmp<Foam::scalarField> Foam::sampledSurface::sample
|
||||
const surfaceScalarField& sField
|
||||
) const
|
||||
{
|
||||
notImplemented("tmp<Foam::scalarField> sampledSurface::sample");
|
||||
NotImplemented;
|
||||
return tmp<scalarField>(NULL);
|
||||
}
|
||||
|
||||
@ -255,7 +252,7 @@ Foam::tmp<Foam::vectorField> Foam::sampledSurface::sample
|
||||
const surfaceVectorField& sField
|
||||
) const
|
||||
{
|
||||
notImplemented("tmp<Foam::vectorField> sampledSurface::sample");
|
||||
NotImplemented;
|
||||
return tmp<vectorField>(NULL);
|
||||
}
|
||||
|
||||
@ -265,7 +262,7 @@ Foam::tmp<Foam::sphericalTensorField> Foam::sampledSurface::sample
|
||||
const surfaceSphericalTensorField& sField
|
||||
) const
|
||||
{
|
||||
notImplemented("tmp<Foam::sphericalTensorField> sampledSurface::sample");
|
||||
NotImplemented;
|
||||
return tmp<sphericalTensorField>(NULL);
|
||||
}
|
||||
|
||||
@ -275,7 +272,7 @@ Foam::tmp<Foam::symmTensorField> Foam::sampledSurface::sample
|
||||
const surfaceSymmTensorField& sField
|
||||
) const
|
||||
{
|
||||
notImplemented("tmp<Foam::symmTensorField> sampledSurface::sample");
|
||||
NotImplemented;
|
||||
return tmp<symmTensorField>(NULL);
|
||||
}
|
||||
|
||||
@ -285,7 +282,7 @@ Foam::tmp<Foam::tensorField> Foam::sampledSurface::sample
|
||||
const surfaceTensorField& sField
|
||||
) const
|
||||
{
|
||||
notImplemented("tmp<Foam::tensorField> sampledSurface::sample");
|
||||
NotImplemented;
|
||||
return tmp<tensorField>(NULL);
|
||||
}
|
||||
|
||||
|
||||
@ -217,7 +217,7 @@ public:
|
||||
//- Clone
|
||||
autoPtr<sampledSurface> clone() const
|
||||
{
|
||||
notImplemented("autoPtr<sampledSurface> clone() const");
|
||||
NotImplemented;
|
||||
return autoPtr<sampledSurface>(NULL);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,10 +35,7 @@ bool Foam::sampledSurface::checkFieldSize(const Field<Type>& field) const
|
||||
|
||||
if (field.size() != faces().size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"sampledSurface::checkFieldSize(const Field<Type>&) const"
|
||||
)
|
||||
FatalErrorInFunction
|
||||
<< "size mismatch: "
|
||||
<< "field (" << field.size()
|
||||
<< ") != surface (" << faces().size() << ")"
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -162,19 +162,7 @@ void Foam::sampledSurfaces::write()
|
||||
|
||||
const label nFields = classifyFields();
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Creating directory "
|
||||
<< outputPath_/obr_.time().timeName() << nl << endl;
|
||||
|
||||
}
|
||||
|
||||
mkDir(outputPath_/obr_.time().timeName());
|
||||
}
|
||||
|
||||
// Write geometry first if required,
|
||||
// write geometry first if required,
|
||||
// or when no fields would otherwise be written
|
||||
if (nFields == 0 || formatter_->separateGeometry())
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -50,7 +50,7 @@ Foam::label Foam::sampledSurfaces::classifyFields()
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn("sampledSurfaces::classifyFields()")
|
||||
WarningInFunction
|
||||
<< "Cannot find field file matching "
|
||||
<< fieldSelection_[i] << endl;
|
||||
}
|
||||
@ -72,7 +72,7 @@ Foam::label Foam::sampledSurfaces::classifyFields()
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn("sampledSurfaces::classifyFields()")
|
||||
WarningInFunction
|
||||
<< "Cannot find registered field matching "
|
||||
<< fieldSelection_[i] << endl;
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -644,8 +644,25 @@ bool Foam::sampledTriSurfaceMesh::update()
|
||||
return false;
|
||||
}
|
||||
|
||||
// Calculate surface and mesh overlap bounding box
|
||||
treeBoundBox bb
|
||||
(
|
||||
surface_.triSurface::points(),
|
||||
surface_.triSurface::meshPoints()
|
||||
);
|
||||
bb.min() = max(bb.min(), mesh().bounds().min());
|
||||
bb.max() = min(bb.max(), mesh().bounds().max());
|
||||
|
||||
// Extend a bit
|
||||
const vector span(bb.span());
|
||||
|
||||
bb.min() -= 0.5*span;
|
||||
bb.max() += 0.5*span;
|
||||
|
||||
bb.inflate(1e-6);
|
||||
|
||||
// Mesh search engine, no triangulation of faces.
|
||||
meshSearch meshSearcher(mesh(), polyMesh::FACE_PLANES);
|
||||
meshSearch meshSearcher(mesh(), bb, polyMesh::FACE_PLANES);
|
||||
|
||||
return update(meshSearcher);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -163,10 +163,7 @@ Foam::sampledThresholdCellFaces::sampledThresholdCellFaces
|
||||
{
|
||||
if (!dict.found("lowerLimit") && !dict.found("upperLimit"))
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"sampledThresholdCellFaces::sampledThresholdCellFaces(..)"
|
||||
)
|
||||
FatalErrorInFunction
|
||||
<< "require at least one of 'lowerLimit' or 'upperLimit'" << endl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -279,8 +279,7 @@ Foam::thresholdCellFaces::thresholdCellFaces
|
||||
|
||||
if (lowerThreshold > upperThreshold)
|
||||
{
|
||||
WarningIn("thresholdCellFaces::thresholdCellFaces(...)")
|
||||
<< "lower > upper limit! "
|
||||
WarningInFunction
|
||||
<< lowerThreshold << " > " << upperThreshold << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -27,29 +27,32 @@ Class
|
||||
Description
|
||||
A surfaceWriter for outputting to a form useable for the
|
||||
timeVaryingMapped boundary condition. This reads the data from
|
||||
constant/boundaryData/<patch>
|
||||
constant/boundaryData/\<patch\> directory
|
||||
|
||||
Typical way of working:
|
||||
- use a sampledSurface of type 'patch' (to sample a patch):
|
||||
\verbatim
|
||||
surfaces
|
||||
{
|
||||
type surfaces;
|
||||
surfaceFormat boundaryData;
|
||||
fields ( p );
|
||||
surfaces
|
||||
{
|
||||
type surfaces;
|
||||
surfaceFormat boundaryData;
|
||||
fields ( p );
|
||||
surfaces
|
||||
(
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
patches (outlet);
|
||||
interpolate false;
|
||||
}
|
||||
);
|
||||
(
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
patches (outlet);
|
||||
interpolate false;
|
||||
}
|
||||
);
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
- write using this writer.
|
||||
- move postProcessing/surfaces/outlet to constant/boundaryData/outlet
|
||||
in your destination case.
|
||||
- use a timeVaryingMappedFixedValue bc to read&interpolate
|
||||
- use a timeVaryingMappedFixedValue condition to read and interpolate
|
||||
the profile:
|
||||
type timeVaryingMappedFixedValue;
|
||||
setAverage false; // do not use read average
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -69,10 +69,8 @@ void Foam::dxSurfaceWriter::writeGeometry
|
||||
|
||||
if (f.size() != 3)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"writeGeometry(Ostream&, const pointField&, const faceList&)"
|
||||
) << "Face " << faceI << " vertices " << f
|
||||
FatalErrorInFunction
|
||||
<< "Face " << faceI << " vertices " << f
|
||||
<< " is not a triangle."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ensightPTraits.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
const char* const Foam::ensightPTraits<Foam::scalar>::typeName =
|
||||
Foam::pTraits<Foam::scalar>::typeName;
|
||||
|
||||
const char* const Foam::ensightPTraits<Foam::vector>::typeName =
|
||||
Foam::pTraits<Foam::vector>::typeName;
|
||||
|
||||
const char* const Foam::ensightPTraits<Foam::sphericalTensor>::typeName =
|
||||
Foam::pTraits<Foam::scalar>::typeName;
|
||||
|
||||
const char* const Foam::ensightPTraits<Foam::symmTensor>::typeName =
|
||||
"tensor symm";
|
||||
|
||||
const char* const Foam::ensightPTraits<Foam::tensor>::typeName =
|
||||
"tensor asym";
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,108 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::ensightPTraits
|
||||
|
||||
Description
|
||||
Conversion of OpenFOAM pTraits into the Ensight equivalent
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ensightPTraits_H
|
||||
#define ensightPTraits_H
|
||||
|
||||
#include "pTraits.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ensightPTraits Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class PrimitiveType>
|
||||
class ensightPTraits
|
||||
{
|
||||
public:
|
||||
|
||||
// Static data members
|
||||
|
||||
static const char* const typeName;
|
||||
|
||||
};
|
||||
|
||||
|
||||
template<>
|
||||
class ensightPTraits<scalar>
|
||||
{
|
||||
public:
|
||||
|
||||
static const char* const typeName;
|
||||
};
|
||||
|
||||
template<>
|
||||
class ensightPTraits<vector>
|
||||
{
|
||||
public:
|
||||
|
||||
static const char* const typeName;
|
||||
};
|
||||
|
||||
template<>
|
||||
class ensightPTraits<sphericalTensor>
|
||||
{
|
||||
public:
|
||||
|
||||
static const char* const typeName;
|
||||
};
|
||||
|
||||
template<>
|
||||
class ensightPTraits<symmTensor>
|
||||
{
|
||||
public:
|
||||
|
||||
static const char* const typeName;
|
||||
};
|
||||
|
||||
template<>
|
||||
class ensightPTraits<tensor>
|
||||
{
|
||||
public:
|
||||
|
||||
static const char* const typeName;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -190,14 +190,8 @@ void Foam::nastranSurfaceWriter::writeCoord
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::nastranSurfaceWriter::writeCoord"
|
||||
"("
|
||||
"Ostream&, "
|
||||
"const point&"
|
||||
") const"
|
||||
) << "Unknown writeFormat enumeration" << abort(FatalError);
|
||||
FatalErrorInFunction
|
||||
<< "Unknown writeFormat enumeration" << abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -280,16 +274,8 @@ void Foam::nastranSurfaceWriter::writeFace
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::nastranSurfaceWriter::writeFace"
|
||||
"("
|
||||
"const word&"
|
||||
"const labelList&"
|
||||
"label&"
|
||||
"Ostream&, "
|
||||
") const"
|
||||
) << "Unknown writeFormat enumeration" << abort(FatalError);
|
||||
FatalErrorInFunction
|
||||
<< "Unknown writeFormat enumeration" << abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -105,17 +105,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"template<class Type>"
|
||||
"void Foam::nastranSurfaceWriter::writeNodeValue"
|
||||
"("
|
||||
"const dataFormat&, "
|
||||
"const Type&, "
|
||||
"const label, "
|
||||
"OFstream&"
|
||||
") const"
|
||||
)
|
||||
WarningInFunction
|
||||
<< dataFormatNames_[format] << " requires scalar values "
|
||||
<< "and cannot be used for higher rank values"
|
||||
<< endl;
|
||||
@ -141,19 +131,9 @@ void Foam::nastranSurfaceWriter::writeFaceValue
|
||||
}
|
||||
default:
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"template<class Type>"
|
||||
"void Foam::nastranSurfaceWriter::writeNodeValue"
|
||||
"("
|
||||
"const dataFormat&, "
|
||||
"const Type&, "
|
||||
"const label, "
|
||||
"OFstream&"
|
||||
") const"
|
||||
)
|
||||
FatalErrorInFunction
|
||||
<< "Unhandled enumeration " << dataFormatNames_[format]
|
||||
<< endl;
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,23 +156,9 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
|
||||
const bool verbose
|
||||
) const
|
||||
{
|
||||
|
||||
if (!fieldMap_.found(fieldName))
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"void Foam::nastranSurfaceWriter::writeTemplate"
|
||||
"("
|
||||
"const fileName&, "
|
||||
"const fileName&, "
|
||||
"const pointField&, "
|
||||
"const faceList&, "
|
||||
"const word&, "
|
||||
"const Field<Type>&, "
|
||||
"const bool, "
|
||||
"const bool"
|
||||
") const"
|
||||
)
|
||||
FatalErrorInFunction
|
||||
<< "No mapping found between field " << fieldName
|
||||
<< " and corresponding Nastran field. Available types are:"
|
||||
<< fieldMap_
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -68,10 +68,8 @@ Foam::surfaceWriter::New(const word& writeType)
|
||||
|
||||
if (cstrIter == wordConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"surfaceWriter::New(const word&)"
|
||||
) << "Unknown write type \"" << writeType << "\"\n\n"
|
||||
FatalErrorInFunction
|
||||
<< "Unknown write type \"" << writeType << "\"\n\n"
|
||||
<< "Valid write types : "
|
||||
<< wordConstructorTablePtr_->sortedToc() << nl
|
||||
<< "Valid proxy types : "
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
Reference in New Issue
Block a user