Merge branch 'develop-pre-release' of develop.openfoam.com:Development/OpenFOAM-plus into develop-pre-release

This commit is contained in:
mattijs
2018-05-17 17:11:57 +01:00
108 changed files with 2503 additions and 992 deletions

View File

@ -5,7 +5,7 @@
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
// Insitu processing of finiteVolume fields with ParaView Catalyst
// Insitu processing with ParaView Catalyst
type catalyst;
libs ("libcatalystFoam.so");

View File

@ -0,0 +1,68 @@
from paraview.simple import *
from paraview import coprocessing
# The frequency to output everything
outputfrequency = 1
# Simply print out all channel names that our function object is producing
# ----------------------- CoProcessor definition -----------------------
def CreateCoProcessor():
def _CreatePipeline(coprocessor, datadescription):
class Pipeline:
for i in range(datadescription.GetNumberOfInputDescriptions()):
name = datadescription.GetInputDescriptionName(i)
input = coprocessor.CreateProducer(datadescription, name)
grid = input.GetClientSideObject().GetOutputDataObject(0)
print "Channel <" + name + "> is", grid.GetClassName()
return Pipeline()
class CoProcessor(coprocessing.CoProcessor):
def CreatePipeline(self, datadescription):
self.Pipeline = _CreatePipeline(self, datadescription)
return CoProcessor()
#--------------------------------------------------------------
# Global variables that will hold the pipeline for each timestep
# Creating the CoProcessor object, doesn't actually create the ParaView pipeline.
# It will be automatically setup when coprocessor.UpdateProducers() is called the
# first time.
coprocessor = CreateCoProcessor()
#--------------------------------------------------------------
# Enable Live-Visualizaton with ParaView
coprocessor.EnableLiveVisualization(False)
# ---------------------- Data Selection method ----------------------
def RequestDataDescription(datadescription):
"Callback to populate the request for current timestep"
global coprocessor
if datadescription.GetForceOutput() == True or datadescription.GetTimeStep() % outputfrequency == 0:
# We are just going to request all fields and meshes from the simulation
# code/adaptor.
for i in range(datadescription.GetNumberOfInputDescriptions()):
datadescription.GetInputDescription(i).AllFieldsOn()
datadescription.GetInputDescription(i).GenerateMeshOn()
return
# setup requests for all inputs based on the requirements of the
# pipeline.
coprocessor.LoadRequestedData(datadescription)
# ------------------------ Processing method ------------------------
def DoCoProcessing(datadescription):
"Callback to do co-processing for current timestep"
global coprocessor
# Update the coprocessor by providing it the newly generated simulation data.
# If the pipeline hasn't been setup yet, this will setup the pipeline.
coprocessor.UpdateProducers(datadescription)
# Write output data, if appropriate.
coprocessor.WriteData(datadescription);

View File

@ -0,0 +1,77 @@
from paraview.simple import *
from paraview import coprocessing
# The frequency to output everything
outputfrequency = 5
# This is largely identical to the Catalyst allinputsgridwriter.py example
# but only handle vtkMultiBlockDataSet, since that is what we generate
# ----------------------- CoProcessor definition -----------------------
def CreateCoProcessor():
def _CreatePipeline(coprocessor, datadescription):
class Pipeline:
for i in range(datadescription.GetNumberOfInputDescriptions()):
name = datadescription.GetInputDescriptionName(i)
input = coprocessor.CreateProducer(datadescription, name)
grid = input.GetClientSideObject().GetOutputDataObject(0)
if grid.IsA('vtkMultiBlockDataSet'):
writer = servermanager.writers.XMLMultiBlockDataWriter(Input=input)
coprocessor.RegisterWriter(writer, filename=name+'_%t.vtm', freq=outputfrequency)
return Pipeline()
class CoProcessor(coprocessing.CoProcessor):
def CreatePipeline(self, datadescription):
self.Pipeline = _CreatePipeline(self, datadescription)
return CoProcessor()
#--------------------------------------------------------------
# Global variables that will hold the pipeline for each timestep
# Creating the CoProcessor object, doesn't actually create the ParaView pipeline.
# It will be automatically setup when coprocessor.UpdateProducers() is called the
# first time.
coprocessor = CreateCoProcessor()
#--------------------------------------------------------------
# Enable Live-Visualizaton with ParaView
coprocessor.EnableLiveVisualization(False)
# ---------------------- Data Selection method ----------------------
def RequestDataDescription(datadescription):
"Callback to populate the request for current timestep"
global coprocessor
if datadescription.GetForceOutput() == True or datadescription.GetTimeStep() % outputfrequency == 0:
# We are just going to request all fields and meshes from the simulation
# code/adaptor.
for i in range(datadescription.GetNumberOfInputDescriptions()):
datadescription.GetInputDescription(i).AllFieldsOn()
datadescription.GetInputDescription(i).GenerateMeshOn()
return
# setup requests for all inputs based on the requirements of the
# pipeline.
coprocessor.LoadRequestedData(datadescription)
# ------------------------ Processing method ------------------------
def DoCoProcessing(datadescription):
"Callback to do co-processing for current timestep"
global coprocessor
# Update the coprocessor by providing it the newly generated simulation data.
# If the pipeline hasn't been setup yet, this will setup the pipeline.
coprocessor.UpdateProducers(datadescription)
# Write output data, if appropriate.
coprocessor.WriteData(datadescription);
# Write image capture (Last arg: rescale lookup table), if appropriate.
coprocessor.WriteImages(datadescription, rescale_lookuptable=False)
# Live Visualization, if enabled.
coprocessor.DoLiveVisualization(datadescription, "localhost", 22222)

View File

@ -0,0 +1,78 @@
from paraview.simple import *
from paraview import coprocessing
# The frequency to output everything
outputfrequency = 5
# As per writeAll, but only for "/mesh" sub-channels.
# ----------------------- CoProcessor definition -----------------------
def CreateCoProcessor():
def _CreatePipeline(coprocessor, datadescription):
class Pipeline:
for i in range(datadescription.GetNumberOfInputDescriptions()):
name = datadescription.GetInputDescriptionName(i)
if not name.endswith('/mesh'):
continue
input = coprocessor.CreateProducer(datadescription, name)
grid = input.GetClientSideObject().GetOutputDataObject(0)
if grid.IsA('vtkMultiBlockDataSet'):
writer = servermanager.writers.XMLMultiBlockDataWriter(Input=input)
coprocessor.RegisterWriter(writer, filename=name+'_%t.vtm', freq=outputfrequency)
return Pipeline()
class CoProcessor(coprocessing.CoProcessor):
def CreatePipeline(self, datadescription):
self.Pipeline = _CreatePipeline(self, datadescription)
return CoProcessor()
#--------------------------------------------------------------
# Global variables that will hold the pipeline for each timestep
# Creating the CoProcessor object, doesn't actually create the ParaView pipeline.
# It will be automatically setup when coprocessor.UpdateProducers() is called the
# first time.
coprocessor = CreateCoProcessor()
#--------------------------------------------------------------
# Enable Live-Visualizaton with ParaView
coprocessor.EnableLiveVisualization(False)
# ---------------------- Data Selection method ----------------------
def RequestDataDescription(datadescription):
"Callback to populate the request for current timestep"
global coprocessor
if datadescription.GetForceOutput() == True or datadescription.GetTimeStep() % outputfrequency == 0:
# We are just going to request all fields and meshes from the simulation
# code/adaptor.
for i in range(datadescription.GetNumberOfInputDescriptions()):
datadescription.GetInputDescription(i).AllFieldsOn()
datadescription.GetInputDescription(i).GenerateMeshOn()
return
# setup requests for all inputs based on the requirements of the
# pipeline.
coprocessor.LoadRequestedData(datadescription)
# ------------------------ Processing method ------------------------
def DoCoProcessing(datadescription):
"Callback to do co-processing for current timestep"
global coprocessor
# Update the coprocessor by providing it the newly generated simulation data.
# If the pipeline hasn't been setup yet, this will setup the pipeline.
coprocessor.UpdateProducers(datadescription)
# Write output data, if appropriate.
coprocessor.WriteData(datadescription);
# Write image capture (Last arg: rescale lookup table), if appropriate.
coprocessor.WriteImages(datadescription, rescale_lookuptable=False)
# Live Visualization, if enabled.
coprocessor.DoLiveVisualization(datadescription, "localhost", 22222)

View File

@ -0,0 +1,78 @@
from paraview.simple import *
from paraview import coprocessing
# The frequency to output everything
outputfrequency = 5
# As per writeAll, but only for "/patches" sub-channels.
# ----------------------- CoProcessor definition -----------------------
def CreateCoProcessor():
def _CreatePipeline(coprocessor, datadescription):
class Pipeline:
for i in range(datadescription.GetNumberOfInputDescriptions()):
name = datadescription.GetInputDescriptionName(i)
if not name.endswith('/patches'):
continue
input = coprocessor.CreateProducer(datadescription, name)
grid = input.GetClientSideObject().GetOutputDataObject(0)
if grid.IsA('vtkMultiBlockDataSet'):
writer = servermanager.writers.XMLMultiBlockDataWriter(Input=input)
coprocessor.RegisterWriter(writer, filename=name+'_%t.vtm', freq=outputfrequency)
return Pipeline()
class CoProcessor(coprocessing.CoProcessor):
def CreatePipeline(self, datadescription):
self.Pipeline = _CreatePipeline(self, datadescription)
return CoProcessor()
#--------------------------------------------------------------
# Global variables that will hold the pipeline for each timestep
# Creating the CoProcessor object, doesn't actually create the ParaView pipeline.
# It will be automatically setup when coprocessor.UpdateProducers() is called the
# first time.
coprocessor = CreateCoProcessor()
#--------------------------------------------------------------
# Enable Live-Visualizaton with ParaView
coprocessor.EnableLiveVisualization(False)
# ---------------------- Data Selection method ----------------------
def RequestDataDescription(datadescription):
"Callback to populate the request for current timestep"
global coprocessor
if datadescription.GetForceOutput() == True or datadescription.GetTimeStep() % outputfrequency == 0:
# We are just going to request all fields and meshes from the simulation
# code/adaptor.
for i in range(datadescription.GetNumberOfInputDescriptions()):
datadescription.GetInputDescription(i).AllFieldsOn()
datadescription.GetInputDescription(i).GenerateMeshOn()
return
# setup requests for all inputs based on the requirements of the
# pipeline.
coprocessor.LoadRequestedData(datadescription)
# ------------------------ Processing method ------------------------
def DoCoProcessing(datadescription):
"Callback to do co-processing for current timestep"
global coprocessor
# Update the coprocessor by providing it the newly generated simulation data.
# If the pipeline hasn't been setup yet, this will setup the pipeline.
coprocessor.UpdateProducers(datadescription)
# Write output data, if appropriate.
coprocessor.WriteData(datadescription);
# Write image capture (Last arg: rescale lookup table), if appropriate.
coprocessor.WriteImages(datadescription, rescale_lookuptable=False)
# Live Visualization, if enabled.
coprocessor.DoLiveVisualization(datadescription, "localhost", 22222)

View File

@ -1,16 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
// Insitu processing of finiteArea fields with ParaView Catalyst
type catalyst::area;
libs ("libcatalystFoam.so");
executeControl timeStep;
writeControl none;
// ************************************************************************* //

View File

@ -1,16 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
// Insitu processing of lagrangian clouds with ParaView Catalyst
type catalyst::cloud;
libs ("libcatalystFoam.so");
executeControl timeStep;
writeControl none;
// ************************************************************************* //

View File

@ -13,8 +13,8 @@
# config.csh/example/paraview
#
# Description
# Example of defining a different ParaView_VERSION but retaining
# the standard config.csh/paraview mechanism
# Example of defining a different ParaView_VERSION but retaining the
# standard config.csh/paraview mechanism
#
# Note
# This file could be copied to a user or site location, but should never
@ -25,7 +25,8 @@
set pv=5.5.0
set pv=5.5.0-mpipy
set qt=qt-5.9.0
eval `foamEtcFile -csh -config -mode=o paraview -- ParaView_VERSION=$pv`
eval `foamEtcFile -csh -config -mode=o paraview -- ParaView_VERSION=$pv ParaView_QT=$qt`
#------------------------------------------------------------------------------

View File

@ -120,8 +120,16 @@ if ( $?ParaView_VERSION ) then
#OBSOLETE? endif
# QT libraries as required
# Set Qt5_DIR to root directory.
# Another possibility: "qtpaths --qt-version"
set qtDir="$archDir/$ParaView_QT"
if ( -d "$qtDir" ) then
switch ($ParaView_QT)
case *-qt*:
setenv Qt5_DIR $qtDir
breaksw
endsw
foreach qtLibDir ("$qtDir/lib$WM_COMPILER_LIB_ARCH" "$qtDir/lib")
if ( -d "$qtLibDir" ) then
setenv LD_LIBRARY_PATH "${qtLibDir}:${LD_LIBRARY_PATH}"

View File

@ -111,6 +111,7 @@ unsetenv ParaView_INCLUDE_DIR
unsetenv ParaView_VERSION
unsetenv PV_PLUGIN_PATH
unsetenv VTK_DIR
unsetenv Qt5_DIR # Perhaps only unset if it is in WM_THIRD_PARTY_DIR?
#------------------------------------------------------------------------------
# Unset other ThirdParty environment variables

View File

@ -13,8 +13,8 @@
# config.sh/example/paraview
#
# Description
# Example of defining a different ParaView_VERSION but retaining
# the standard config.sh/paraview mechanism
# Example of defining a different ParaView_VERSION but retaining the
# standard config.sh/paraview mechanism
#
# Note
# This file could be copied to a user or site location, but should never
@ -25,7 +25,8 @@
pv=5.5.0
pv=5.5.0-mpipy
qt=qt-5.9.0
eval $(foamEtcFile -sh -config -mode=o paraview -- ParaView_VERSION=$pv)
eval $(foamEtcFile -sh -config -mode=o paraview -- ParaView_VERSION=$pv ParaView_QT=$qt)
#------------------------------------------------------------------------------

View File

@ -127,10 +127,16 @@ then
#OBSOLETE? export PYTHONPATH=$PYTHONPATH:${PYTHONPATH:+:}$pvPython:$pvLibDir
#OBSOLETE? fi
# QT libraries as required
# QT libraries as required, and Qt5_DIR for the root directory.
# Another possibility: "qtpaths --qt-version"
qtDir="$archDir/$ParaView_QT"
if [ -d "$qtDir" ]
then
case "$ParaView_QT" in
*-5*)
export Qt5_DIR=$qtDir
;;
esac
for qtLibDir in $qtDir/lib$WM_COMPILER_LIB_ARCH $qtDir/lib
do
if [ -d "$qtLibDir" ]

View File

@ -97,7 +97,6 @@ then
unset OPAL_PREFIX
fi
#------------------------------------------------------------------------------
# Unset Ensight/ParaView-related environment variables
@ -108,6 +107,12 @@ unset ParaView_VERSION
unset PV_PLUGIN_PATH
unset VTK_DIR
# Undefine Qt5_DIR if set to one of the paths on foamOldDirs
if [ -z "$($foamClean -env=Qt5_DIR "$foamOldDirs")" ]
then
unset Qt5_DIR
fi
#------------------------------------------------------------------------------
# Unset other ThirdParty environment variables

View File

@ -39,8 +39,8 @@ InfoSwitches
writeDictionaries 0;
writeOptionalEntries 0;
// Write lagrangian "positions" file in v1706 format (at earlier)
writeLagrangianPositions 0;
// Write lagrangian "positions" file in v1706 format (and earlier)
writeLagrangianPositions 1;
// Report hosts used (parallel)
// - 0 = none

View File

@ -236,7 +236,7 @@ void Foam::error::exit(const int errNo)
{
Perr<< endl << *this << endl
<< "\nFOAM exiting\n" << endl;
::exit(1);
::exit(errNo);
}
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -86,6 +86,7 @@ void pow
gf.oriented() = pow(gf1.oriented(), r);
}
template
<
class Type,
@ -181,6 +182,7 @@ void sqr
gf.oriented() = sqr(gf1.oriented());
}
template<class Type, template<class> class PatchField, class GeoMesh>
tmp
<
@ -217,6 +219,7 @@ sqr(const GeometricField<Type, PatchField, GeoMesh>& gf)
return tSqr;
}
template<class Type, template<class> class PatchField, class GeoMesh>
tmp
<
@ -270,6 +273,7 @@ void magSqr
gsf.oriented() = magSqr(gf.oriented());
}
template<class Type, template<class> class PatchField, class GeoMesh>
tmp<GeometricField<scalar, PatchField, GeoMesh>> magSqr
(
@ -343,6 +347,7 @@ void mag
gsf.oriented() = mag(gf.oriented());
}
template<class Type, template<class> class PatchField, class GeoMesh>
tmp<GeometricField<scalar, PatchField, GeoMesh>> mag
(
@ -458,6 +463,7 @@ cmptAv(const GeometricField<Type, PatchField, GeoMesh>& gf)
return CmptAv;
}
template<class Type, template<class> class PatchField, class GeoMesh>
tmp
<
@ -500,7 +506,7 @@ cmptAv(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf)
}
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, binaryOp) \
\
template<class Type, template<class> class PatchField, class GeoMesh> \
dimensioned<returnType> func \
@ -512,7 +518,15 @@ dimensioned<returnType> func \
( \
#func "(" + gf.name() + ')', \
gf.dimensions(), \
Foam::func(gFunc(gf.primitiveField()), gFunc(gf.boundaryField())) \
returnReduce \
( \
Foam::func \
( \
Foam::func(gf.primitiveField()), \
Foam::func(gf.boundaryField()) \
), \
binaryOp<Type>() \
) \
); \
} \
\
@ -527,8 +541,8 @@ dimensioned<returnType> func \
return res; \
}
UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, max, gMax)
UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, min, gMin)
UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, max, maxOp)
UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, min, minOp)
#undef UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -212,7 +212,7 @@ tmp
cmptAv(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf);
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, binaryOp) \
\
template<class Type, template<class> class PatchField, class GeoMesh> \
dimensioned<returnType> func \
@ -226,8 +226,8 @@ dimensioned<returnType> func \
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
);
UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, max, gMax)
UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, min, gMin)
UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, max, maxOp)
UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, min, minOp)
#undef UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY

View File

@ -266,7 +266,7 @@ Foam::faceZone::faceZone
(
const word& name,
const labelUList& addr,
const boolList& fm,
const boolUList& fm,
const label index,
const faceZoneMesh& zm
)
@ -328,7 +328,7 @@ Foam::faceZone::faceZone
(
const faceZone& origZone,
const labelUList& addr,
const boolList& fm,
const boolUList& fm,
const label index,
const faceZoneMesh& zm
)
@ -468,7 +468,7 @@ void Foam::faceZone::resetAddressing
void Foam::faceZone::resetAddressing
(
const labelUList& addr,
const boolList& flipMap
const boolUList& flipMap
)
{
clearAddressing();

View File

@ -177,7 +177,7 @@ public:
(
const word& name,
const labelUList& addr,
const boolList& fm,
const boolUList& fm,
const label index,
const faceZoneMesh& zm
);
@ -208,7 +208,7 @@ public:
(
const faceZone& origZone,
const labelUList& addr,
const boolList& fm,
const boolUList& fm,
const label index,
const faceZoneMesh& zm
);
@ -236,7 +236,7 @@ public:
virtual autoPtr<faceZone> clone
(
const labelUList& addr,
const boolList& fm,
const boolUList& fm,
const label index,
const faceZoneMesh& zm
) const
@ -309,7 +309,7 @@ public:
virtual void resetAddressing
(
const labelUList& addr,
const boolList& flipMap
const boolUList& flipMap
);
//- Move reset addressing - use uniform flip map value

View File

@ -1,5 +1,5 @@
sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
sinclude $(RULES)/mplib$(WM_MPLIB)
sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB)
EXE_INC = $(PFLAGS) $(PINC) $(c++LESSWARN)
LIB_LIBS = $(PLIBS)

View File

@ -571,7 +571,8 @@ void Foam::vtk::vtuSizing::populateArrays
if (output == contentType::LEGACY)
{
// Update size for legacy face stream
faceOutput[startLabel] = (faceIndexer - startLabel);
// (subtract 1 to avoid counting the storage location)
faceOutput[startLabel] = (faceIndexer - 1 - startLabel);
}
else
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -42,6 +42,7 @@ License
#include "fvMeshTools.H"
#include "labelPairHashes.H"
#include "ListOps.H"
#include "globalIndex.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -688,25 +689,54 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
// merge those points.
Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
(
const labelList& pointToGlobalMaster,
labelListList& constructPointMap
)
{
// Find out which sets of points get merged and create a map from
// mesh point to unique point.
Map<label> pointToMaster
(
fvMeshAdder::findSharedPoints
(
mesh_,
mergeTol_
)
);
label nShared = 0;
forAll(pointToGlobalMaster, pointi)
{
if (pointToGlobalMaster[pointi] != -1)
{
nShared++;
}
}
Map<label> globalMasterToLocalMaster(2*nShared);
Map<label> pointToMaster(2*nShared);
forAll(pointToGlobalMaster, pointi)
{
label globali = pointToGlobalMaster[pointi];
if (globali != -1)
{
Map<label>::const_iterator iter = globalMasterToLocalMaster.find
(
globali
);
if (iter == globalMasterToLocalMaster.end())
{
// Found first point. Designate as master
globalMasterToLocalMaster.insert(globali, pointi);
pointToMaster.insert(pointi, pointi);
}
else
{
pointToMaster.insert(pointi, iter());
}
}
}
if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
{
return nullptr;
}
polyTopoChange meshMod(mesh_);
fvMeshAdder::mergePoints(mesh_, pointToMaster, meshMod);
@ -750,16 +780,19 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
}
// Construct the local environment of all boundary faces.
void Foam::fvMeshDistribute::getNeighbourData
void Foam::fvMeshDistribute::getCouplingData
(
const labelList& distribution,
labelList& sourceFace,
labelList& sourceProc,
labelList& sourcePatch,
labelList& sourceNewNbrProc
labelList& sourceNewNbrProc,
labelList& sourcePointMaster
) const
{
// Construct the coupling information for all (boundary) faces and
// points
label nBnd = mesh_.nFaces() - mesh_.nInternalFaces();
sourceFace.setSize(nBnd);
sourceProc.setSize(nBnd);
@ -890,13 +923,62 @@ void Foam::fvMeshDistribute::getNeighbourData
}
}
}
// Collect coupled (collocated) points
sourcePointMaster.setSize(mesh_.nPoints());
sourcePointMaster = -1;
{
// Assign global master point
const globalIndex globalPoints(mesh_.nPoints());
const globalMeshData& gmd = mesh_.globalData();
const indirectPrimitivePatch& cpp = gmd.coupledPatch();
const labelList& meshPoints = cpp.meshPoints();
const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
const labelListList& slaves = gmd.globalCoPointSlaves();
labelList elems(slavesMap.constructSize(), -1);
forAll(meshPoints, pointi)
{
const labelList& slots = slaves[pointi];
if (slots.size())
{
// pointi is a master. Assign a unique label.
label globalPointi = globalPoints.toGlobal(meshPoints[pointi]);
elems[pointi] = globalPointi;
forAll(slots, i)
{
label sloti = slots[i];
if (sloti >= meshPoints.size())
{
// Filter out local collocated points. We don't want
// to merge these
elems[slots[i]] = globalPointi;
}
}
}
}
// Push slave-slot data back to slaves
slavesMap.reverseDistribute(elems.size(), elems, false);
// Extract back onto mesh
forAll(meshPoints, pointi)
{
sourcePointMaster[meshPoints[pointi]] = elems[pointi];
}
}
}
// Subset the neighbourCell/neighbourProc fields
void Foam::fvMeshDistribute::subsetBoundaryData
void Foam::fvMeshDistribute::subsetCouplingData
(
const fvMesh& mesh,
const labelList& pointMap,
const labelList& faceMap,
const labelList& cellMap,
@ -909,11 +991,13 @@ void Foam::fvMeshDistribute::subsetBoundaryData
const labelList& sourceProc,
const labelList& sourcePatch,
const labelList& sourceNewNbrProc,
const labelList& sourcePointMaster,
labelList& subFace,
labelList& subProc,
labelList& subPatch,
labelList& subNewNbrProc
labelList& subNewNbrProc,
labelList& subPointMaster
)
{
subFace.setSize(mesh.nFaces() - mesh.nInternalFaces());
@ -959,6 +1043,9 @@ void Foam::fvMeshDistribute::subsetBoundaryData
subNewNbrProc[newBFacei] = sourceNewNbrProc[oldBFacei];
}
}
subPointMaster = UIndirectList<label>(sourcePointMaster, pointMap);
}
@ -1042,9 +1129,9 @@ Foam::labelList Foam::fvMeshDistribute::mapBoundaryData
(
const primitiveMesh& mesh, // mesh after adding
const mapAddedPolyMesh& map,
const labelList& boundaryData0, // mesh before adding
const labelList& boundaryData0, // on mesh before adding
const label nInternalFaces1,
const labelList& boundaryData1 // added mesh
const labelList& boundaryData1 // on added mesh
)
{
labelList newBoundaryData(mesh.nFaces() - mesh.nInternalFaces());
@ -1076,6 +1163,41 @@ Foam::labelList Foam::fvMeshDistribute::mapBoundaryData
}
Foam::labelList Foam::fvMeshDistribute::mapPointData
(
const primitiveMesh& mesh, // mesh after adding
const mapAddedPolyMesh& map,
const labelList& boundaryData0, // on mesh before adding
const labelList& boundaryData1 // on added mesh
)
{
labelList newBoundaryData(mesh.nPoints());
forAll(boundaryData0, oldPointi)
{
label newPointi = map.oldPointMap()[oldPointi];
// Point still exists (is necessary?)
if (newPointi >= 0)
{
newBoundaryData[newPointi] = boundaryData0[oldPointi];
}
}
forAll(boundaryData1, addedPointi)
{
label newPointi = map.addedPointMap()[addedPointi];
if (newPointi >= 0)
{
newBoundaryData[newPointi] = boundaryData1[addedPointi];
}
}
return newBoundaryData;
}
// Remove cells. Add all exposed faces to patch oldInternalPatchi
Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::doRemoveCells
(
@ -1297,6 +1419,7 @@ void Foam::fvMeshDistribute::sendMesh
const labelList& sourceProc,
const labelList& sourcePatch,
const labelList& sourceNewNbrProc,
const labelList& sourcePointMaster,
Ostream& toDomain
)
{
@ -1433,7 +1556,8 @@ void Foam::fvMeshDistribute::sendMesh
<< sourceFace
<< sourceProc
<< sourcePatch
<< sourceNewNbrProc;
<< sourceNewNbrProc
<< sourcePointMaster;
if (debug)
@ -1456,6 +1580,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
labelList& domainSourceProc,
labelList& domainSourcePatch,
labelList& domainSourceNewNbrProc,
labelList& domainSourcePointMaster,
Istream& fromNbr
)
{
@ -1474,7 +1599,8 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
>> domainSourceFace
>> domainSourceProc
>> domainSourcePatch
>> domainSourceNewNbrProc;
>> domainSourceNewNbrProc
>> domainSourcePointMaster;
// Construct fvMesh
auto domainMeshPtr = autoPtr<fvMesh>::New
@ -1709,13 +1835,15 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
labelList sourceFace;
labelList sourceProc;
labelList sourceNewNbrProc;
getNeighbourData
labelList sourcePointMaster;
getCouplingData
(
distribution,
sourceFace,
sourceProc,
sourcePatch,
sourceNewNbrProc
sourceNewNbrProc,
sourcePointMaster
);
@ -1924,11 +2052,13 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
labelList procSourceProc;
labelList procSourcePatch;
labelList procSourceNewNbrProc;
labelList procSourcePointMaster;
subsetBoundaryData
subsetCouplingData
(
subsetter.subMesh(),
subsetter.faceMap(), // from subMesh to mesh
subsetter.pointMap(), // from subMesh to mesh
subsetter.faceMap(), // ,, ,,
subsetter.cellMap(), // ,, ,,
distribution, // old mesh distribution
@ -1940,15 +2070,16 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
sourceProc,
sourcePatch,
sourceNewNbrProc,
sourcePointMaster,
procSourceFace,
procSourceProc,
procSourcePatch,
procSourceNewNbrProc
procSourceNewNbrProc,
procSourcePointMaster
);
// Send to neighbour
sendMesh
(
@ -1963,6 +2094,8 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
procSourceProc,
procSourcePatch,
procSourceNewNbrProc,
procSourcePointMaster,
str
);
@ -2121,10 +2254,12 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
labelList domainSourceProc;
labelList domainSourcePatch;
labelList domainSourceNewNbrProc;
labelList domainSourcePointMaster;
subsetBoundaryData
subsetCouplingData
(
mesh_, // new mesh
subMap().pointMap(), // from new to original mesh
subMap().faceMap(), // from new to original mesh
subMap().cellMap(),
@ -2137,17 +2272,20 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
sourceProc,
sourcePatch,
sourceNewNbrProc,
sourcePointMaster,
domainSourceFace,
domainSourceProc,
domainSourcePatch,
domainSourceNewNbrProc
domainSourceNewNbrProc,
domainSourcePointMaster
);
sourceFace.transfer(domainSourceFace);
sourceProc.transfer(domainSourceProc);
sourcePatch.transfer(domainSourcePatch);
sourceNewNbrProc.transfer(domainSourceNewNbrProc);
sourcePointMaster.transfer(domainSourcePointMaster);
}
@ -2205,6 +2343,7 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
labelList domainSourceProc;
labelList domainSourcePatch;
labelList domainSourceNewNbrProc;
labelList domainSourcePointMaster;
autoPtr<fvMesh> domainMeshPtr;
@ -2241,6 +2380,7 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
domainSourceProc,
domainSourcePatch,
domainSourceNewNbrProc,
domainSourcePointMaster,
str
);
fvMesh& domainMesh = domainMeshPtr();
@ -2508,6 +2648,15 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
domainMesh.nInternalFaces(),
domainSourceNewNbrProc
);
// Update pointMaster data
sourcePointMaster = mapPointData
(
mesh_,
map(),
sourcePointMaster,
domainSourcePointMaster
);
// Update all addressing so xxProcAddressing points to correct
// item in masterMesh.
@ -2621,6 +2770,10 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
}
// See if any originally shared points need to be merged. Note: does
// parallel comms. After this points and edges should again be consistent.
mergeSharedPoints(sourcePointMaster, constructPointMap);
// Add processorPatches
// ~~~~~~~~~~~~~~~~~~~~
@ -2650,16 +2803,8 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
// Change patches. Since this might change ordering of coupled faces
// we also need to adapt our constructMaps.
// NOTE: there is one very particular problem with this structure.
// We first create the processor patches and use these to merge out
// shared points (see mergeSharedPoints below). So temporarily points
// and edges do not match!
repatch(newPatchID, constructFaceMap);
// See if any geometrically shared points need to be merged. Note: does
// parallel comms. After this points and edges should again be consistent.
mergeSharedPoints(constructPointMap);
// Bit of hack: processorFvPatchField does not get reset since created
// from nothing so explicitly reset.
initPatchFields<volScalarField, processorFvPatchField<scalar>>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -163,11 +163,11 @@ class fvMeshDistribute
labelListList& constructFaceMap
);
//- Merge any shared points that are geometrically shared. Needs
// parallel valid mesh - uses globalMeshData.
//- Merge any local points that were remotely coupled.
// constructPointMap is adapted for the new point labels.
autoPtr<mapPolyMesh> mergeSharedPoints
(
const labelList& pointToGlobalMaster,
labelListList& constructPointMap
);
@ -175,19 +175,21 @@ class fvMeshDistribute
// Coupling information
//- Construct the local environment of all boundary faces.
void getNeighbourData
void getCouplingData
(
const labelList& distribution,
labelList& sourceFace,
labelList& sourceProc,
labelList& sourcePatch,
labelList& sourceNewProc
labelList& sourceNewProc,
labelList& sourcePointMaster
) const;
// Subset the neighbourCell/neighbourProc fields
static void subsetBoundaryData
static void subsetCouplingData
(
const fvMesh& mesh,
const labelList& pointMap,
const labelList& faceMap,
const labelList& cellMap,
@ -200,11 +202,13 @@ class fvMeshDistribute
const labelList& sourceProc,
const labelList& sourcePatch,
const labelList& sourceNewProc,
const labelList& sourcePointMaster,
labelList& subFace,
labelList& subProc,
labelList& subPatch,
labelList& subNewProc
labelList& subNewProc,
labelList& subPointMaster
);
//- Find cells on mesh whose faceID/procID match the neighbour
@ -237,6 +241,14 @@ class fvMeshDistribute
const labelList& boundaryData1 // added mesh
);
//- Map point data to new mesh (resulting from adding two meshes)
static labelList mapPointData
(
const primitiveMesh& mesh, // mesh after adding
const mapAddedPolyMesh& map,
const labelList& boundaryData0, // on mesh before adding
const labelList& boundaryData1 // on added mesh
);
// Other
@ -276,6 +288,7 @@ class fvMeshDistribute
const labelList& sourceProc,
const labelList& sourcePatch,
const labelList& sourceNewProc,
const labelList& sourcePointMaster,
Ostream& toDomain
);
//- Send subset of fields
@ -300,6 +313,7 @@ class fvMeshDistribute
labelList& domainSourceProc,
labelList& domainSourcePatch,
labelList& domainSourceNewProc,
labelList& domainSourcePointMaster,
Istream& fromNbr
);

View File

@ -75,7 +75,7 @@ swirlFlowRateInletVelocityFvPatchVectorField
dict.lookupOrDefault
(
"axis",
patch().size()
returnReduce(patch().size(), maxOp<label>())
? -gSum(patch().Sf())/gSum(patch().magSf())
: Zero
)
@ -145,48 +145,53 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
{
return;
}
const scalar t = this->db().time().timeOutputValue();
const scalar flowRate = flowRate_->value(t);
const scalar rpm = rpm_->value(t);
const scalar totArea = gSum(patch().magSf());
const scalar avgU = -flowRate/totArea;
const vector axisHat = axis_/mag(axis_);
// Update angular velocity - convert [rpm] to [rad/s]
tmp<vectorField> tangentialVelocity
(
axisHat ^ (rpm*constant::mathematical::pi/30.0)*(patch().Cf() - origin_)
);
tmp<vectorField> n = patch().nf();
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
if (phi.dimensions() == dimVelocity*dimArea)
if (totArea > ROOTVSMALL && axis_ != vector(Zero))
{
// volumetric flow-rate
operator==(tangentialVelocity + n*avgU);
}
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
const scalar t = this->db().time().timeOutputValue();
const scalar flowRate = flowRate_->value(t);
const scalar rpm = rpm_->value(t);
// mass flow-rate
operator==(tangentialVelocity + n*avgU/rhop);
}
else
{
FatalErrorInFunction
<< "dimensions of " << phiName_ << " are incorrect" << nl
<< " on patch " << this->patch().name()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< nl << exit(FatalError);
const scalar avgU = -flowRate/totArea;
const vector axisHat = axis_/mag(axis_);
// Update angular velocity - convert [rpm] to [rad/s]
tmp<vectorField> tangentialVelocity
(
axisHat
^(rpm*constant::mathematical::pi/30.0)
*(patch().Cf() - origin_)
);
tmp<vectorField> n = patch().nf();
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
if (phi.dimensions() == dimVelocity*dimArea)
{
// volumetric flow-rate
operator==(tangentialVelocity + n*avgU);
}
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
// mass flow-rate
operator==(tangentialVelocity + n*avgU/rhop);
}
else
{
FatalErrorInFunction
<< "dimensions of " << phiName_ << " are incorrect" << nl
<< " on patch " << this->patch().name()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< nl << exit(FatalError);
}
}
fixedValueFvPatchField<vector>::updateCoeffs();

View File

@ -261,7 +261,7 @@ EulerDdtScheme<Type>::fvcDdt
new GeometricField<Type, fvPatchField, volMesh>
(
ddtIOobject,
rDeltaT.value()*
rDeltaT*
(
alpha()
*rho()

View File

@ -61,7 +61,8 @@ Foam::functionObjects::turbulenceFields::compressibleFieldNames_
{ compressibleField::cfAlphaEff, "alphaEff" },
{ compressibleField::cfR, "R" },
{ compressibleField::cfDevRhoReff, "devRhoReff" },
{ compressibleField::cfL, "L" }
{ compressibleField::cfL, "L" },
{ compressibleField::cfI, "I" }
};
@ -80,6 +81,7 @@ Foam::functionObjects::turbulenceFields::incompressibleFieldNames_
{ incompressibleField::ifR, "R" },
{ incompressibleField::ifDevReff, "devReff" },
{ incompressibleField::ifL, "L" },
{ incompressibleField::ifI, "I" }
};
@ -236,6 +238,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField<scalar>(f, L(model));
break;
}
case cfI:
{
processField<scalar>(f, I(model));
break;
}
default:
{
FatalErrorInFunction
@ -298,6 +305,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField<scalar>(f, L(model));
break;
}
case ifI:
{
processField<scalar>(f, I(model));
break;
}
default:
{
FatalErrorInFunction

View File

@ -76,6 +76,7 @@ Usage
devReff | Deviatoric part of the effective Reynolds stress
devRhoReff | Divergence of the Reynolds stress
L | turbulence length scale
I | turbulence intensity
\endplaintable
See also
@ -125,7 +126,8 @@ public:
cfAlphaEff,
cfR,
cfDevRhoReff,
cfL
cfL,
cfI
};
static const Enum<compressibleField> compressibleFieldNames_;
@ -139,7 +141,8 @@ public:
ifNuEff,
ifR,
ifDevReff,
ifL
ifL,
ifI
};
static const Enum<incompressibleField> incompressibleFieldNames_;
@ -179,6 +182,10 @@ protected:
template<class Model>
tmp<volScalarField> L(const Model& model) const;
//- Return I calculated from k and U
template<class Model>
tmp<volScalarField> I(const Model& model) const;
private:

View File

@ -85,19 +85,16 @@ Foam::functionObjects::turbulenceFields::omega
const volScalarField k(model.k());
const volScalarField epsilon(model.epsilon());
return tmp<volScalarField>
return tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"omega.tmp",
k.mesh().time().timeName(),
k.mesh()
),
epsilon/(Cmu*k),
epsilon.boundaryField().types()
)
"omega.tmp",
k.mesh().time().timeName(),
k.mesh()
),
epsilon/(Cmu*k),
epsilon.boundaryField().types()
);
}
@ -109,9 +106,10 @@ Foam::functionObjects::turbulenceFields::nuTilda
const Model& model
) const
{
return tmp<volScalarField>
return tmp<volScalarField>::New
(
new volScalarField("nuTilda.tmp", model.k()/omega(model))
"nuTilda.tmp",
model.k()/omega(model)
);
}
@ -130,15 +128,30 @@ Foam::functionObjects::turbulenceFields::L
const volScalarField epsilon(model.epsilon());
const dimensionedScalar eps0("eps0", epsilon.dimensions(), SMALL);
return tmp<volScalarField>
return tmp<volScalarField>::New
(
new volScalarField
(
"L.tmp",
pow(Cmu, 0.75)*pow(k, 1.5)/(epsilon + eps0)
)
"L.tmp",
pow(Cmu, 0.75)*pow(k, 1.5)/(epsilon + eps0)
);
}
template<class Model>
Foam::tmp<Foam::volScalarField>
Foam::functionObjects::turbulenceFields::I
(
const Model& model
) const
{
// Assume k is available
const volScalarField uPrime(sqrt((2.0/3.0)*model.k()));
const dimensionedScalar U0("U0", dimVelocity, SMALL);
return tmp<volScalarField>::New
(
"I.tmp",
uPrime/max(max(uPrime, mag(model.U())), U0)
);
}
// ************************************************************************* //

View File

@ -353,7 +353,7 @@ Foam::functionObjects::forces::devRhoReff() const
const dictionary& transportProperties =
lookupObject<dictionary>("transportProperties");
dimensionedScalar nu(transportProperties.lookup("nu"));
dimensionedScalar nu("nu", dimViscosity, transportProperties);
const volVectorField& U = lookupObject<volVectorField>(UName_);

View File

@ -108,6 +108,7 @@ bool Foam::functionObjects::vtkWrite::read(const dictionary& dict)
//
dict.readIfPresent("directory", dirName_);
decompose_ = dict.lookupOrDefault("decompose", false);
writeIds_ = dict.lookupOrDefault("writeIds", false);
@ -185,7 +186,7 @@ bool Foam::functionObjects::vtkWrite::write()
(
mesh_,
writeOpts_,
true // decompose
decompose_
);
// Write mesh

View File

@ -44,6 +44,7 @@ Description
writeInterval 1;
format binary;
legacy false;
decompose false;
...
fields (U p);
}
@ -51,14 +52,15 @@ Description
Usage
\table
Property | Description | Required | Default value
type | Type name: vtkWrite | yes |
fields | Fields to output | yes |
writeControl | Output control | recommended | timeStep
directory | The output directory name | no | "VTK"
format | ASCII or binary format | no | binary
legacy | Legacy VTK output | no | false
writeIds | Write cell ids as field | no | true
Property | Description | Required | Default
type | Type name: vtkWrite | yes |
fields | Fields to output | yes |
writeControl | Output control | recommended | timeStep
directory | The output directory name | no | "VTK"
format | ASCII or binary format | no | binary
legacy | Legacy VTK output | no | false
decompose | decompose polyhedra | no | false
writeIds | Write cell ids as field | no | true
\endtable
See also
@ -106,6 +108,9 @@ class vtkWrite
//- Output directory name
fileName dirName_;
//- Decompose polyhedra
bool decompose_;
//- Write cell ids field
bool writeIds_;
@ -119,7 +124,11 @@ class vtkWrite
//- Write selected fields for GeoField type.
template<class GeoField>
label writeFields(vtk::internalWriter& writer, bool verbose=true) const;
label writeFields
(
vtk::internalWriter& writer,
bool verbose=true
) const;
//- Write selected fields for GeoField type.
@ -131,10 +140,10 @@ class vtkWrite
) const;
//- Disallow default bitwise copy construct
//- No copy construct
vtkWrite(const vtkWrite&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const vtkWrite&) = delete;
@ -150,7 +159,7 @@ public:
vtkWrite
(
const word& name,
const Time& t,
const Time& runTime,
const dictionary& dict
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,6 +34,7 @@ License
#include "ParticleErosion.H"
#include "ParticleTracks.H"
#include "ParticleTrap.H"
#include "PatchCollisionDensity.H"
#include "PatchPostProcessing.H"
#include "VoidFraction.H"
@ -48,6 +49,7 @@ License
makeCloudFunctionObjectType(ParticleErosion, CloudType); \
makeCloudFunctionObjectType(ParticleTracks, CloudType); \
makeCloudFunctionObjectType(ParticleTrap, CloudType); \
makeCloudFunctionObjectType(PatchCollisionDensity, CloudType); \
makeCloudFunctionObjectType(PatchPostProcessing, CloudType); \
makeCloudFunctionObjectType(VoidFraction, CloudType);

View File

@ -0,0 +1,168 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 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 "PatchCollisionDensity.H"
#include "Pstream.H"
#include "stringListOps.H"
#include "ListOps.H"
#include "ListListOps.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template<class CloudType>
void Foam::PatchCollisionDensity<CloudType>::write()
{
const scalarField z(this->owner().mesh().nCells(), 0);
volScalarField
(
IOobject
(
this->owner().name() + ":collisionDensity",
this->owner().mesh().time().timeName(),
this->owner().mesh()
),
this->owner().mesh(),
dimless/dimArea,
z,
collisionDensity_
)
.write();
volScalarField
(
IOobject
(
this->owner().name() + ":collisionDensityRate",
this->owner().mesh().time().timeName(),
this->owner().mesh()
),
this->owner().mesh(),
dimless/dimArea/dimTime,
z,
(collisionDensity_ - collisionDensity0_)
/(this->owner().mesh().time().value() - time0_)
)
.write();
collisionDensity0_ == collisionDensity_;
time0_ = this->owner().mesh().time().value();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::PatchCollisionDensity<CloudType>::PatchCollisionDensity
(
const dictionary& dict,
CloudType& owner,
const word& modelName
)
:
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
minSpeed_(dict.lookupOrDefault<scalar>("minSpeed", -1)),
collisionDensity_
(
this->owner().mesh().boundary(),
volScalarField::Internal::null(),
calculatedFvPatchField<scalar>::typeName
),
collisionDensity0_
(
this->owner().mesh().boundary(),
volScalarField::Internal::null(),
calculatedFvPatchField<scalar>::typeName
),
time0_(this->owner().mesh().time().value())
{
collisionDensity_ == 0;
collisionDensity0_ == 0;
IOobject io
(
this->owner().name() + ":collisionDensity",
this->owner().mesh().time().timeName(),
this->owner().mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (io.typeHeaderOk<volScalarField>())
{
const volScalarField collisionDensity(io, this->owner().mesh());
collisionDensity_ == collisionDensity.boundaryField();
collisionDensity0_ == collisionDensity.boundaryField();
}
}
template<class CloudType>
Foam::PatchCollisionDensity<CloudType>::PatchCollisionDensity
(
const PatchCollisionDensity<CloudType>& ppm
)
:
CloudFunctionObject<CloudType>(ppm),
minSpeed_(ppm.minSpeed_),
collisionDensity_(ppm.collisionDensity_),
collisionDensity0_(ppm.collisionDensity0_),
time0_(ppm.time0_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::PatchCollisionDensity<CloudType>::~PatchCollisionDensity()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::PatchCollisionDensity<CloudType>::postPatch
(
const parcelType& p,
const polyPatch& pp,
bool&
)
{
const label patchi = pp.index();
const label patchFacei = p.face() - pp.start();
vector nw, Up;
this->owner().patchData(p, pp, nw, Up);
const scalar speed = (p.U() - Up) & nw;
if (speed > minSpeed_)
{
collisionDensity_[patchi][patchFacei] +=
1/this->owner().mesh().magSf().boundaryField()[patchi][patchFacei];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,152 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 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::PatchCollisionDensity
Description
Function object which generates fields of the number and rate of collisions
per unit area on all patches. Can optionally take a minimum speed below
which a collision is not counted.
Example usage:
\verbatim
patchCollisionDensity1
{
type patchCollisionDensity;
minSpeed 1e-3;
}
\endverbatim
SourceFiles
PatchCollisionDensity.C
\*---------------------------------------------------------------------------*/
#ifndef PatchCollisionDensity_H
#define PatchCollisionDensity_H
#include "CloudFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class PatchCollisionDensity Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class PatchCollisionDensity
:
public CloudFunctionObject<CloudType>
{
// Private data
typedef typename CloudType::particleType parcelType;
//- The threshold for a collision
const scalar minSpeed_;
//- The field of the number of collisions per unit area
volScalarField::Boundary collisionDensity_;
//- The field of the number of collisions per unit area at the last
// output
volScalarField::Boundary collisionDensity0_;
//- The time at the last output
scalar time0_;
protected:
// Protected Member Functions
//- Write post-processing info
void write();
public:
//- Runtime type information
TypeName("patchCollisionDensity");
// Constructors
//- Construct from dictionary
PatchCollisionDensity
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Construct copy
PatchCollisionDensity(const PatchCollisionDensity<CloudType>& ppm);
//- Construct and return a clone
virtual autoPtr<CloudFunctionObject<CloudType>> clone() const
{
return autoPtr<CloudFunctionObject<CloudType>>
(
new PatchCollisionDensity<CloudType>(*this)
);
}
//- Destructor
virtual ~PatchCollisionDensity();
// Member Functions
// Evaluation
//- Post-patch hook
virtual void postPatch
(
const parcelType& p,
const polyPatch& pp,
bool& keepParticle
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "PatchCollisionDensity.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -250,7 +250,7 @@ void Foam::lumpedPointDisplacementPointPatchVectorField::updateCoeffs()
if (Pstream::master())
{
movement().writeData(forces, moments);
movement().writeData(forces, moments, &(db().time()));
// Signal external source to execute
movement().coupler().useSlave();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,29 +48,65 @@ Foam::lumpedPointMovement::formatNames
};
const Foam::Enum
<
Foam::lumpedPointMovement::scalingType
>
Foam::lumpedPointMovement::scalingNames
{
{ scalingType::LENGTH, "plain" },
{ scalingType::FORCE, "force" },
{ scalingType::MOMENT, "moment" }
};
const Foam::word
Foam::lumpedPointMovement::dictionaryName("lumpedPointMovement");
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
namespace Foam
{
//! \cond fileScope
//- Space-separated vector value (ASCII)
static inline Ostream& putPlain(Ostream& os, const vector& val)
{
os << val.x() << ' ' << val.y() << ' ' << val.z();
return os;
}
//! \cond fileScope
//- Space-separated vector value (ASCII)
static inline Ostream& putTime(Ostream& os, const Time& t)
{
os <<"Time index=" << t.timeIndex()
<< " value=" << t.timeOutputValue();
return os;
}
//! \cond fileScope
//- Write list content with size, bracket, content, bracket one-per-line.
// This makes for consistent for parsing, regardless of the list length.
template <class T>
static void writeList(Ostream& os, const string& header, const UList<T>& lst)
static void writeList(Ostream& os, const string& header, const UList<T>& list)
{
const label len = list.size();
// Header string
os << header.c_str() << nl;
// Write size and start delimiter
os << lst.size() << nl
<< token::BEGIN_LIST << nl;
os << len << nl << token::BEGIN_LIST << nl;
// Write contents
forAll(lst, i)
for (label i=0; i < len; ++i)
{
os << lst[i] << nl;
os << list[i] << nl;
}
// Write end delimiter
@ -165,8 +201,11 @@ Foam::lumpedPointMovement::lumpedPointMovement()
coupler_(),
inputName_("positions.in"),
outputName_("forces.out"),
logName_("movement.log"),
inputFormat_(lumpedPointState::inputFormatType::DICTIONARY),
outputFormat_(outputFormatType::DICTIONARY),
scaleInput_(-1.0),
scaleOutput_(-1.0),
state0_(),
state_(),
thresholdPtr_(0),
@ -198,6 +237,11 @@ Foam::lumpedPointMovement::lumpedPointMovement
autoCentre_(true),
forcesDict_(),
coupler_(),
inputName_("positions.in"),
outputName_("forces.out"),
logName_("movement.log"),
scaleInput_(-1.0),
scaleOutput_(-1.0),
state0_(),
state_(),
thresholdPtr_(0),
@ -262,6 +306,7 @@ void Foam::lumpedPointMovement::readDict(const dictionary& dict)
commDict.lookup("inputName") >> inputName_;
commDict.lookup("outputName") >> outputName_;
commDict.readIfPresent("logName", logName_);
inputFormat_ = lumpedPointState::formatNames.lookup
(
@ -274,6 +319,47 @@ void Foam::lumpedPointMovement::readDict(const dictionary& dict)
"outputFormat",
commDict
);
scaleInput_ = -1;
scaleOutput_ = -1;
const dictionary* scaleDict = nullptr;
if ((scaleDict = commDict.subDictPtr("scaleInput")))
{
for (int i=0; i < scaleInput_.size(); ++i)
{
const word& key = scalingNames[scalingType(i)];
if
(
scaleDict->readIfPresent(key, scaleInput_[i])
&& scaleInput_[i] > 0
)
{
Info<<"Using input " << key << " multiplier: "
<< scaleInput_[i] << nl;
}
}
}
if ((scaleDict = commDict.subDictPtr("scaleOutput")))
{
for (int i=0; i < scaleOutput_.size(); ++i)
{
const word& key = scalingNames[scalingType(i)];
if
(
scaleDict->readIfPresent(key, scaleOutput_[i])
&& scaleOutput_[i] > 0
)
{
Info<<"Using output " << key << " multiplier: "
<< scaleOutput_[i] << nl;
}
}
}
}
@ -638,6 +724,8 @@ bool Foam::lumpedPointMovement::readState()
coupler().resolveFile(inputName_)
);
state_.scalePoints(scaleInput_[scalingType::LENGTH]);
state_.relax(relax_, prev);
return status;
@ -646,45 +734,114 @@ bool Foam::lumpedPointMovement::readState()
bool Foam::lumpedPointMovement::writeData
(
const UList<vector>& forces
Ostream& os,
const UList<vector>& forces,
const UList<vector>& moments,
const outputFormatType fmt,
const Time* timeinfo
) const
{
if (!Pstream::master())
const bool writeMoments = (moments.size() == forces.size());
if (fmt == outputFormatType::PLAIN)
{
return false;
}
const fileName output(coupler().resolveFile(outputName_));
OFstream os(output); // ASCII
if (outputFormat_ == outputFormatType::PLAIN)
{
os <<"# output from OpenFOAM" << nl
<<"# N, points, forces" << nl
<< this->size() << nl;
const char* zeroVector = "0 0 0";
forAll(locations_, i)
os <<"########" << nl;
if (timeinfo)
{
const vector pos = locations_[i] * axis_;
os <<"# ";
putTime(os, *timeinfo) << nl;
}
os <<"# size=" << this->size() << nl
<<"# columns (points) (forces)";
os << pos.x() << ' '
<< pos.y() << ' '
<< pos.z() << ' ';
if (writeMoments)
{
os << " (moments)";
}
if (i < forces.size())
os << nl;
bool report = false;
scalar scaleLength = scaleOutput_[scalingType::LENGTH];
scalar scaleForce = scaleOutput_[scalingType::FORCE];
scalar scaleMoment = scaleOutput_[scalingType::MOMENT];
if (scaleLength > 0)
{
report = true;
}
else
{
scaleLength = 1.0;
}
if (scaleForce > 0)
{
report = true;
}
else
{
scaleForce = 1.0;
}
if (writeMoments)
{
if (scaleMoment > 0)
{
os << forces[i].x() << ' '
<< forces[i].y() << ' '
<< forces[i].z();
report = true;
}
else
{
os << zeroVector;
scaleMoment = 1.0;
}
}
if (report)
{
os <<"# scaling points=" << scaleLength
<<" forces=" << scaleForce;
if (writeMoments)
{
os <<" moments=" << scaleMoment;
}
os << nl;
os << nl;
}
os <<"########" << nl;
forAll(locations_, i)
{
const vector pos = scaleLength * (locations_[i] * axis_);
putPlain(os, pos) << ' ';
if (i < forces.size())
{
const vector val(scaleForce * forces[i]);
putPlain(os, val);
}
else
{
putPlain(os, vector::zero);
}
if (writeMoments)
{
os << ' ';
if (i < moments.size())
{
const vector val(scaleMoment * moments[i]);
putPlain(os, val);
}
else
{
putPlain(os, vector::zero);
}
}
os << nl;
}
}
else
@ -693,10 +850,21 @@ bool Foam::lumpedPointMovement::writeData
// - exclude the usual OpenFOAM 'FoamFile' header
// - ensure lists have consistent format
os <<"// output from OpenFOAM" << nl << nl;
os <<"////////" << nl;
if (timeinfo)
{
os <<"// ";
putTime(os, *timeinfo) << nl;
}
os << nl;
writeList(os, "points", (locations_*axis_)());
writeList(os, "forces", forces);
if (writeMoments)
{
writeList(os, "moments", moments);
}
}
return true;
@ -706,7 +874,8 @@ bool Foam::lumpedPointMovement::writeData
bool Foam::lumpedPointMovement::writeData
(
const UList<vector>& forces,
const UList<vector>& moments
const UList<vector>& moments,
const Time* timeinfo
) const
{
if (!Pstream::master())
@ -714,60 +883,28 @@ bool Foam::lumpedPointMovement::writeData
return false;
}
const fileName output(coupler().resolveFile(outputName_));
OFstream os(output); // ASCII
if (outputFormat_ == outputFormatType::PLAIN)
// Regular output
{
os <<"# output from OpenFOAM" << nl
<<"# N, points, forces, moments" << nl
<< this->size() << nl;
const fileName output(coupler().resolveFile(outputName_));
OFstream os(output, IOstream::ASCII);
const char* zeroVector = "0 0 0";
forAll(locations_, i)
{
const vector pos = locations_[i] * axis_;
os << pos.x() << ' '
<< pos.y() << ' '
<< pos.z() << ' ';
if (i < forces.size())
{
os << forces[i].x() << ' '
<< forces[i].y() << ' '
<< forces[i].z() << ' ';
}
else
{
os << zeroVector << ' ';
}
if (i < moments.size())
{
os << moments[i].x() << ' '
<< moments[i].y() << ' '
<< moments[i].z();
}
else
{
os << zeroVector;
}
os << nl;
}
writeData(os, forces, moments, outputFormat_, timeinfo);
}
else
// Log output
{
// Make it easier for external programs to parse
// - exclude the usual OpenFOAM 'FoamFile' header
// - ensure lists have consistent format
const fileName output(coupler().resolveFile(logName_));
os <<"// output from OpenFOAM" << nl << nl;
OFstream os
(
output,
IOstream::ASCII,
IOstream::currentVersion,
IOstream::UNCOMPRESSED,
true // append mode
);
writeList(os, "points", (locations_*axis_)());
writeList(os, "forces", forces);
writeList(os, "moments", moments);
writeData(os, forces, moments, outputFormatType::PLAIN, timeinfo);
}
return true;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,8 +60,10 @@ SourceFiles
namespace Foam
{
// Forward declarations
class polyMesh;
class Time;
/*---------------------------------------------------------------------------*\
Class lumpedPointMovement Declaration
@ -78,11 +80,22 @@ public:
DICTIONARY
};
//- Output format types
enum scalingType
{
LENGTH = 0,
FORCE,
MOMENT
};
// Static data
//- Names for the output format types
static const Enum<outputFormatType> formatNames;
//- Names for the scaling types
static const Enum<scalingType> scalingNames;
private:
@ -125,9 +138,15 @@ private:
//- File io
word inputName_;
word outputName_;
word logName_;
lumpedPointState::inputFormatType inputFormat_;
outputFormatType outputFormat_;
//- Optional scale factors for input/output files
FixedList<scalar, 1> scaleInput_;
FixedList<scalar, 3> scaleOutput_;
// Demand-driven private data
@ -246,6 +265,9 @@ public:
//- The output (forces) file name
inline const word& outputName() const;
//- The log file name
inline const word& logName() const;
//- The input (state) file format
inline lumpedPointState::inputFormatType inputFormat() const;
@ -324,21 +346,24 @@ public:
//- Write axis, locations, division as a dictionary
void writeDict(Ostream& os) const;
//- Write points, forces
//- Write points, forces, moments. Only call from the master process
bool writeData
(
const UList<vector>& forces
Ostream& os,
const UList<vector>& forces,
const UList<vector>& moments,
const outputFormatType fmt = outputFormatType::PLAIN,
const Time* timeinfo = nullptr
) const;
//- Write points, forces, moments
bool writeData
(
const UList<vector>& forces,
const UList<vector>& moments
const UList<vector>& moments = List<vector>(),
const Time* timeinfo = nullptr
) const;
//- Read state from file, applying relaxation as requested
bool readState();

View File

@ -0,0 +1,100 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object lumpedPointMovement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Reference axis for the locations
axis (0 0 1);
// Locations of the lumped points
locations 11(0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5);
// Division for pressure forces (0-1)
division 0.5;
//- If present, the offset of patch points compared to the locations
// Otherwise determined from the bounding box
// centre (0 0 0);
//- The interpolation scheme
interpolationScheme linear;
//- Relaxation/scaling factor when updating positions
relax 1.0;
forces
{
//- The pressure name (default: p)
p p;
//- Reference pressure [Pa] (default: 0)
pRef 0;
//- Reference density for incompressible calculations (default: 1)
rhoRef 1;
}
communication
{
commsDir "comms";
log on;
waitInterval 1;
timeOut 100;
initByExternal false;
// Input file of positions/rotation, written by external application
inputName positions.in;
// Output file of forces, written by OpenFOAM
outputName forces.out;
// Log of points/forces/moments during the simulation
logName movement.log;
inputFormat dictionary;
outputFormat dictionary;
debugTable "$FOAM_CASE/output.txt";
// Scaling applied to values read from 'inputName'
scaleInput
{
//- Length multiplier (to metres). Eg 0.001 for [mm] -> [m]
length 1;
}
// Scaling applied to values written to 'outputName'
scaleOutput
{
//- Length multiplier (from metres). Eg 1000 for [m] -> [mm]
length 1;
//- Force units multiplier (from Pa)
force 1;
//- Moment units multiplier (from N.m)
moment 1;
}
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -133,6 +133,12 @@ inline const Foam::word& Foam::lumpedPointMovement::outputName() const
}
inline const Foam::word& Foam::lumpedPointMovement::logName() const
{
return logName_;
}
inline Foam::lumpedPointState::inputFormatType
Foam::lumpedPointMovement::inputFormat() const
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,8 +94,8 @@ void Foam::lumpedPointState::readDict(const dictionary& dict)
Foam::lumpedPointState::lumpedPointState()
:
points_(0),
angles_(0),
points_(),
angles_(),
degrees_(false),
rotationPtr_(nullptr)
{}
@ -110,10 +110,7 @@ Foam::lumpedPointState::lumpedPointState(const lumpedPointState& rhs)
{}
Foam::lumpedPointState::lumpedPointState
(
const pointField& pts
)
Foam::lumpedPointState::lumpedPointState(const pointField& pts)
:
points_(pts),
angles_(points_.size(), Zero),
@ -122,10 +119,7 @@ Foam::lumpedPointState::lumpedPointState
{}
Foam::lumpedPointState::lumpedPointState
(
tmp<pointField>& pts
)
Foam::lumpedPointState::lumpedPointState(tmp<pointField>& pts)
:
points_(pts),
angles_(points_.size(), Zero),
@ -134,13 +128,10 @@ Foam::lumpedPointState::lumpedPointState
{}
Foam::lumpedPointState::lumpedPointState
(
const dictionary& dict
)
Foam::lumpedPointState::lumpedPointState(const dictionary& dict)
:
points_(0),
angles_(0),
points_(),
angles_(),
degrees_(false),
rotationPtr_(nullptr)
{
@ -168,6 +159,15 @@ void Foam::lumpedPointState::operator=(const lumpedPointState& rhs)
}
void Foam::lumpedPointState::scalePoints(const scalar scaleFactor)
{
if (scaleFactor > 0)
{
points_ *= scaleFactor;
}
}
void Foam::lumpedPointState::relax
(
const scalar alpha,
@ -273,19 +273,17 @@ void Foam::lumpedPointState::writePlain(Ostream& os) const
{
const vector& pt = points_[i];
os << pt.x() << ' '
<< pt.y() << ' '
<< pt.z() << ' ';
os << pt.x() << ' ' << pt.y() << ' ' << pt.z();
if (i < angles_.size())
{
os << angles_[i].x() << ' '
<< angles_[i].y() << ' '
<< angles_[i].z() << '\n';
os << ' ' << angles_[i].x()
<< ' ' << angles_[i].y()
<< ' ' << angles_[i].z() << '\n';
}
else
{
os << "0 0 0\n";
os << " 0 0 0\n";
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -143,13 +143,16 @@ public:
//- The local-to-global transformation for each point
inline const tensorField& rotations() const;
//- Scale points by given factor.
// Zero and negative values are ignored.
void scalePoints(const scalar scaleFactor);
//- Relax the state
// alpha = 1 : no relaxation
// alpha < 1 : relaxation
// alpha = 0 : do nothing
void relax(const scalar alpha, const lumpedPointState& prev);
//- Read input as dictionary content
bool readData(Istream& is);

View File

@ -170,6 +170,8 @@ $(faceSources)/boundaryToFace/boundaryToFace.C
$(faceSources)/zoneToFace/zoneToFace.C
$(faceSources)/boxToFace/boxToFace.C
$(faceSources)/regionToFace/regionToFace.C
$(faceSources)/cylinderToFace/cylinderToFace.C
$(faceSources)/cylinderAnnulusToFace/cylinderAnnulusToFace.C
pointSources = sets/pointSources
$(pointSources)/labelToPoint/labelToPoint.C

View File

@ -54,7 +54,7 @@ namespace Foam
void Foam::cylindrical::init
(
const objectRegistry& obr,
const List<label>& cells
const labelUList& cells
)
{
const polyMesh& mesh = refCast<const polyMesh>(obr);
@ -196,7 +196,7 @@ void Foam::cylindrical::updateCells
forAll(cells, i)
{
label celli = cells[i];
const label celli = cells[i];
vector dir = cc[celli] - origin_;
dir /= mag(dir) + VSMALL;

View File

@ -52,6 +52,7 @@ SourceFiles
#include "point.H"
#include "vector.H"
#include "ListOps.H"
#include "coordinateRotation.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -85,7 +86,7 @@ class cylindrical
void init
(
const objectRegistry& obr,
const List<label>& cells = List<label>()
const labelUList& cells = Foam::emptyLabelList
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,15 @@ License
#include "boxToCell.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(boxToCell, 0);
addToRunTimeSelectionTable(topoSetSource, boxToCell, word);
addToRunTimeSelectionTable(topoSetSource, boxToCell, istream);
defineTypeNameAndDebug(boxToCell, 0);
addToRunTimeSelectionTable(topoSetSource, boxToCell, word);
addToRunTimeSelectionTable(topoSetSource, boxToCell, istream);
}
@ -72,7 +67,6 @@ void Foam::boxToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::boxToCell::boxToCell
(
const polyMesh& mesh,
@ -84,7 +78,6 @@ Foam::boxToCell::boxToCell
{}
// Construct from dictionary
Foam::boxToCell::boxToCell
(
const polyMesh& mesh,
@ -101,7 +94,6 @@ Foam::boxToCell::boxToCell
{}
// Construct from Istream
Foam::boxToCell::boxToCell
(
const polyMesh& mesh,
@ -112,6 +104,7 @@ Foam::boxToCell::boxToCell
bbs_(1, treeBoundBox(checkIs(is)))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::boxToCell::~boxToCell()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,13 +51,11 @@ class boxToCell
:
public topoSetSource
{
// Private data
//- Add usage string
static addToUsageTable usage_;
//- Bounding box.
treeBoundBoxList bbs_;
@ -112,7 +110,6 @@ public:
const topoSetSource::setAction action,
topoSet&
) const;
};

View File

@ -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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,20 +26,15 @@ License
#include "cellToCell.H"
#include "polyMesh.H"
#include "cellSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(cellToCell, 0);
addToRunTimeSelectionTable(topoSetSource, cellToCell, word);
addToRunTimeSelectionTable(topoSetSource, cellToCell, istream);
defineTypeNameAndDebug(cellToCell, 0);
addToRunTimeSelectionTable(topoSetSource, cellToCell, word);
addToRunTimeSelectionTable(topoSetSource, cellToCell, istream);
}
@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::cellToCell::usage_
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::cellToCell::cellToCell
(
const polyMesh& mesh,
@ -65,7 +59,6 @@ Foam::cellToCell::cellToCell
{}
// Construct from dictionary
Foam::cellToCell::cellToCell
(
const polyMesh& mesh,
@ -77,7 +70,6 @@ Foam::cellToCell::cellToCell
{}
// Construct from Istream
Foam::cellToCell::cellToCell
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,7 +107,6 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell
{}
// Construct from Istream
Foam::cylinderAnnulusToCell::cylinderAnnulusToCell
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -102,7 +102,6 @@ Foam::cylinderToCell::cylinderToCell
{}
// Construct from Istream
Foam::cylinderToCell::cylinderToCell
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,7 +26,6 @@ License
#include "faceToCell.H"
#include "polyMesh.H"
#include "faceSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -148,7 +147,6 @@ void Foam::faceToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::faceToCell::faceToCell
(
const polyMesh& mesh,
@ -162,7 +160,6 @@ Foam::faceToCell::faceToCell
{}
// Construct from dictionary
Foam::faceToCell::faceToCell
(
const polyMesh& mesh,
@ -175,7 +172,6 @@ Foam::faceToCell::faceToCell
{}
// Construct from Istream
Foam::faceToCell::faceToCell
(
const polyMesh& mesh,

View File

@ -25,7 +25,6 @@ License
#include "faceZoneToCell.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -105,7 +104,6 @@ void Foam::faceZoneToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::faceZoneToCell::faceZoneToCell
(
const polyMesh& mesh,
@ -119,7 +117,6 @@ Foam::faceZoneToCell::faceZoneToCell
{}
// Construct from dictionary
Foam::faceZoneToCell::faceZoneToCell
(
const polyMesh& mesh,
@ -132,7 +129,6 @@ Foam::faceZoneToCell::faceZoneToCell
{}
// Construct from Istream
Foam::faceZoneToCell::faceZoneToCell
(
const polyMesh& mesh,

View File

@ -93,7 +93,6 @@ void Foam::fieldToCell::applyToSet
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::fieldToCell::fieldToCell
(
const polyMesh& mesh,
@ -109,7 +108,6 @@ Foam::fieldToCell::fieldToCell
{}
// Construct from dictionary
Foam::fieldToCell::fieldToCell
(
const polyMesh& mesh,
@ -123,7 +121,6 @@ Foam::fieldToCell::fieldToCell
{}
// Construct from Istream
Foam::fieldToCell::fieldToCell
(
const polyMesh& mesh,
@ -151,34 +148,6 @@ void Foam::fieldToCell::applyToSet
topoSet& set
) const
{
// // Construct temporary fvMesh from polyMesh
// fvMesh fMesh
// (
// mesh(), // IOobject
// mesh().points(),
// mesh().faces(),
// mesh().cells()
// );
//
// const polyBoundaryMesh& patches = mesh().boundaryMesh();
//
// List<polyPatch*> newPatches(patches.size());
// forAll(patches, patchi)
// {
// const polyPatch& pp = patches[patchi];
//
// newPatches[patchi] =
// patches[patchi].clone
// (
// fMesh.boundaryMesh(),
// patchi,
// pp.size(),
// pp.start()
// ).ptr();
// }
// fMesh.addFvPatches(newPatches);
// Try to load field
IOobject fieldObject
(

View File

@ -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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,15 @@ License
#include "labelToCell.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(labelToCell, 0);
addToRunTimeSelectionTable(topoSetSource, labelToCell, word);
addToRunTimeSelectionTable(topoSetSource, labelToCell, istream);
defineTypeNameAndDebug(labelToCell, 0);
addToRunTimeSelectionTable(topoSetSource, labelToCell, word);
addToRunTimeSelectionTable(topoSetSource, labelToCell, istream);
}
@ -63,7 +58,6 @@ void Foam::labelToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::labelToCell::labelToCell
(
const polyMesh& mesh,
@ -75,7 +69,6 @@ Foam::labelToCell::labelToCell
{}
// Construct from dictionary
Foam::labelToCell::labelToCell
(
const polyMesh& mesh,
@ -87,7 +80,6 @@ Foam::labelToCell::labelToCell
{}
// Construct from Istream
Foam::labelToCell::labelToCell
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,15 @@ License
#include "nbrToCell.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(nbrToCell, 0);
addToRunTimeSelectionTable(topoSetSource, nbrToCell, word);
addToRunTimeSelectionTable(topoSetSource, nbrToCell, istream);
defineTypeNameAndDebug(nbrToCell, 0);
addToRunTimeSelectionTable(topoSetSource, nbrToCell, word);
addToRunTimeSelectionTable(topoSetSource, nbrToCell, istream);
}
@ -104,7 +99,6 @@ void Foam::nbrToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::nbrToCell::nbrToCell
(
const polyMesh& mesh,
@ -116,7 +110,6 @@ Foam::nbrToCell::nbrToCell
{}
// Construct from dictionary
Foam::nbrToCell::nbrToCell
(
const polyMesh& mesh,
@ -128,7 +121,6 @@ Foam::nbrToCell::nbrToCell
{}
// Construct from Istream
Foam::nbrToCell::nbrToCell
(
const polyMesh& mesh,

View File

@ -32,13 +32,9 @@ License
namespace Foam
{
defineTypeNameAndDebug(nearestToCell, 0);
addToRunTimeSelectionTable(topoSetSource, nearestToCell, word);
addToRunTimeSelectionTable(topoSetSource, nearestToCell, istream);
defineTypeNameAndDebug(nearestToCell, 0);
addToRunTimeSelectionTable(topoSetSource, nearestToCell, word);
addToRunTimeSelectionTable(topoSetSource, nearestToCell, istream);
}
@ -84,7 +80,6 @@ void Foam::nearestToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::nearestToCell::nearestToCell
(
const polyMesh& mesh,
@ -96,7 +91,6 @@ Foam::nearestToCell::nearestToCell
{}
// Construct from dictionary
Foam::nearestToCell::nearestToCell
(
const polyMesh& mesh,
@ -108,7 +102,6 @@ Foam::nearestToCell::nearestToCell
{}
// Construct from Istream
Foam::nearestToCell::nearestToCell
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,7 +26,6 @@ License
#include "pointToCell.H"
#include "polyMesh.H"
#include "pointSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -105,7 +104,6 @@ void Foam::pointToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::pointToCell::pointToCell
(
const polyMesh& mesh,
@ -119,7 +117,6 @@ Foam::pointToCell::pointToCell
{}
// Construct from dictionary
Foam::pointToCell::pointToCell
(
const polyMesh& mesh,
@ -132,7 +129,6 @@ Foam::pointToCell::pointToCell
{}
// Construct from Istream
Foam::pointToCell::pointToCell
(
const polyMesh& mesh,

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -34,13 +34,9 @@ License
namespace Foam
{
defineTypeNameAndDebug(regionToCell, 0);
addToRunTimeSelectionTable(topoSetSource, regionToCell, word);
addToRunTimeSelectionTable(topoSetSource, regionToCell, istream);
defineTypeNameAndDebug(regionToCell, 0);
addToRunTimeSelectionTable(topoSetSource, regionToCell, word);
addToRunTimeSelectionTable(topoSetSource, regionToCell, istream);
}
@ -90,11 +86,7 @@ void Foam::regionToCell::markRegionFaces
{
label facei = pp.start()+i;
label bFacei = facei-mesh_.nInternalFaces();
if
(
selectedCell[faceCells[i]]
!= selectedCell[nbrSelected[bFacei]]
)
if (selectedCell[faceCells[i]] != nbrSelected[bFacei])
{
regionFace[facei] = true;
}
@ -385,7 +377,6 @@ void Foam::regionToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::regionToCell::regionToCell
(
const polyMesh& mesh,
@ -401,7 +392,6 @@ Foam::regionToCell::regionToCell
{}
// Construct from dictionary
Foam::regionToCell::regionToCell
(
const polyMesh& mesh,
@ -420,7 +410,6 @@ Foam::regionToCell::regionToCell
{}
// Construct from Istream
Foam::regionToCell::regionToCell
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,20 +26,15 @@ License
#include "rotatedBoxToCell.H"
#include "polyMesh.H"
#include "cellModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(rotatedBoxToCell, 0);
addToRunTimeSelectionTable(topoSetSource, rotatedBoxToCell, word);
addToRunTimeSelectionTable(topoSetSource, rotatedBoxToCell, istream);
defineTypeNameAndDebug(rotatedBoxToCell, 0);
addToRunTimeSelectionTable(topoSetSource, rotatedBoxToCell, word);
addToRunTimeSelectionTable(topoSetSource, rotatedBoxToCell, istream);
}
@ -117,7 +112,6 @@ void Foam::rotatedBoxToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::rotatedBoxToCell::rotatedBoxToCell
(
const polyMesh& mesh,
@ -135,7 +129,6 @@ Foam::rotatedBoxToCell::rotatedBoxToCell
{}
// Construct from dictionary
Foam::rotatedBoxToCell::rotatedBoxToCell
(
const polyMesh& mesh,
@ -150,7 +143,6 @@ Foam::rotatedBoxToCell::rotatedBoxToCell
{}
// Construct from Istream
Foam::rotatedBoxToCell::rotatedBoxToCell(const polyMesh& mesh, Istream& is)
:
topoSetSource(mesh),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,20 +28,15 @@ License
#include "unitConversion.H"
#include "hexMatcher.H"
#include "cellFeatures.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(shapeToCell, 0);
addToRunTimeSelectionTable(topoSetSource, shapeToCell, word);
addToRunTimeSelectionTable(topoSetSource, shapeToCell, istream);
defineTypeNameAndDebug(shapeToCell, 0);
addToRunTimeSelectionTable(topoSetSource, shapeToCell, word);
addToRunTimeSelectionTable(topoSetSource, shapeToCell, istream);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,7 +91,6 @@ Foam::sphereToCell::sphereToCell
{}
// Construct from Istream
Foam::sphereToCell::sphereToCell
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,20 +28,15 @@ License
#include "globalMeshData.H"
#include "plane.H"
#include "cellSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(targetVolumeToCell, 0);
addToRunTimeSelectionTable(topoSetSource, targetVolumeToCell, word);
addToRunTimeSelectionTable(topoSetSource, targetVolumeToCell, istream);
defineTypeNameAndDebug(targetVolumeToCell, 0);
addToRunTimeSelectionTable(topoSetSource, targetVolumeToCell, word);
addToRunTimeSelectionTable(topoSetSource, targetVolumeToCell, istream);
}
@ -269,7 +264,6 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::targetVolumeToCell::targetVolumeToCell
(
const polyMesh& mesh,
@ -283,7 +277,6 @@ Foam::targetVolumeToCell::targetVolumeToCell
{}
// Construct from dictionary
Foam::targetVolumeToCell::targetVolumeToCell
(
const polyMesh& mesh,
@ -297,7 +290,6 @@ Foam::targetVolumeToCell::targetVolumeToCell
{}
// Construct from Istream
Foam::targetVolumeToCell::targetVolumeToCell
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,15 @@ License
#include "zoneToCell.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(zoneToCell, 0);
addToRunTimeSelectionTable(topoSetSource, zoneToCell, word);
addToRunTimeSelectionTable(topoSetSource, zoneToCell, istream);
defineTypeNameAndDebug(zoneToCell, 0);
addToRunTimeSelectionTable(topoSetSource, zoneToCell, word);
addToRunTimeSelectionTable(topoSetSource, zoneToCell, istream);
}
@ -92,7 +87,6 @@ void Foam::zoneToCell::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::zoneToCell::zoneToCell
(
const polyMesh& mesh,
@ -104,7 +98,6 @@ Foam::zoneToCell::zoneToCell
{}
// Construct from dictionary
Foam::zoneToCell::zoneToCell
(
const polyMesh& mesh,
@ -116,7 +109,6 @@ Foam::zoneToCell::zoneToCell
{}
// Construct from Istream
Foam::zoneToCell::zoneToCell
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,20 +26,15 @@ License
#include "setToCellZone.H"
#include "polyMesh.H"
#include "cellZoneSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(setToCellZone, 0);
addToRunTimeSelectionTable(topoSetSource, setToCellZone, word);
addToRunTimeSelectionTable(topoSetSource, setToCellZone, istream);
defineTypeNameAndDebug(setToCellZone, 0);
addToRunTimeSelectionTable(topoSetSource, setToCellZone, word);
addToRunTimeSelectionTable(topoSetSource, setToCellZone, istream);
}
@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::setToCellZone::usage_
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::setToCellZone::setToCellZone
(
const polyMesh& mesh,
@ -65,7 +59,6 @@ Foam::setToCellZone::setToCellZone
{}
// Construct from dictionary
Foam::setToCellZone::setToCellZone
(
const polyMesh& mesh,
@ -77,7 +70,6 @@ Foam::setToCellZone::setToCellZone
{}
// Construct from Istream
Foam::setToCellZone::setToCellZone
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,15 @@ License
#include "boundaryToFace.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(boundaryToFace, 0);
addToRunTimeSelectionTable(topoSetSource, boundaryToFace, word);
addToRunTimeSelectionTable(topoSetSource, boundaryToFace, istream);
defineTypeNameAndDebug(boundaryToFace, 0);
addToRunTimeSelectionTable(topoSetSource, boundaryToFace, word);
addToRunTimeSelectionTable(topoSetSource, boundaryToFace, istream);
}
@ -68,21 +63,18 @@ void Foam::boundaryToFace::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::boundaryToFace::boundaryToFace(const polyMesh& mesh)
:
topoSetSource(mesh)
{}
// Construct from dictionary
Foam::boundaryToFace::boundaryToFace(const polyMesh& mesh, const dictionary&)
:
topoSetSource(mesh)
{}
// Construct from Istream
Foam::boundaryToFace::boundaryToFace
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,15 @@ License
#include "boxToFace.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(boxToFace, 0);
addToRunTimeSelectionTable(topoSetSource, boxToFace, word);
addToRunTimeSelectionTable(topoSetSource, boxToFace, istream);
defineTypeNameAndDebug(boxToFace, 0);
addToRunTimeSelectionTable(topoSetSource, boxToFace, word);
addToRunTimeSelectionTable(topoSetSource, boxToFace, istream);
}
@ -72,7 +67,6 @@ void Foam::boxToFace::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::boxToFace::boxToFace
(
const polyMesh& mesh,
@ -84,7 +78,6 @@ Foam::boxToFace::boxToFace
{}
// Construct from dictionary
Foam::boxToFace::boxToFace
(
const polyMesh& mesh,
@ -101,7 +94,6 @@ Foam::boxToFace::boxToFace
{}
// Construct from Istream
Foam::boxToFace::boxToFace
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,7 +51,6 @@ class boxToFace
:
public topoSetSource
{
// Private data
//- Add usage string
@ -111,7 +110,6 @@ public:
const topoSetSource::setAction action,
topoSet&
) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -0,0 +1,160 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 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 "cylinderAnnulusToFace.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(cylinderAnnulusToFace, 0);
addToRunTimeSelectionTable(topoSetSource, cylinderAnnulusToFace, word);
addToRunTimeSelectionTable(topoSetSource, cylinderAnnulusToFace, istream);
}
Foam::topoSetSource::addToUsageTable Foam::cylinderAnnulusToFace::usage_
(
cylinderAnnulusToFace::typeName,
"\n Usage: cylinderAnnulusToFace (p1X p1Y p1Z) (p2X p2Y p2Z)"
" outerRadius innerRadius\n\n"
" Select all faces with face centre within bounding cylinder annulus\n\n"
);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::cylinderAnnulusToFace::combine(topoSet& set, const bool add) const
{
const vector axis = p2_ - p1_;
const scalar orad2 = sqr(outerRadius_);
const scalar irad2 = sqr(innerRadius_);
const scalar magAxis2 = magSqr(axis);
const pointField& ctrs = mesh_.faceCentres();
forAll(ctrs, facei)
{
vector d = ctrs[facei] - p1_;
scalar magD = d & axis;
if ((magD > 0) && (magD < magAxis2))
{
scalar d2 = (d & d) - sqr(magD)/magAxis2;
if ((d2 < orad2) && (d2 > irad2))
{
addOrDelete(set, facei, add);
}
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cylinderAnnulusToFace::cylinderAnnulusToFace
(
const polyMesh& mesh,
const vector& p1,
const vector& p2,
const scalar outerRadius,
const scalar innerRadius
)
:
topoSetSource(mesh),
p1_(p1),
p2_(p2),
outerRadius_(outerRadius),
innerRadius_(innerRadius)
{}
Foam::cylinderAnnulusToFace::cylinderAnnulusToFace
(
const polyMesh& mesh,
const dictionary& dict
)
:
topoSetSource(mesh),
p1_(dict.lookup("p1")),
p2_(dict.lookup("p2")),
outerRadius_(readScalar(dict.lookup("outerRadius"))),
innerRadius_(readScalar(dict.lookup("innerRadius")))
{}
Foam::cylinderAnnulusToFace::cylinderAnnulusToFace
(
const polyMesh& mesh,
Istream& is
)
:
topoSetSource(mesh),
p1_(checkIs(is)),
p2_(checkIs(is)),
outerRadius_(readScalar(checkIs(is))),
innerRadius_(readScalar(checkIs(is)))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cylinderAnnulusToFace::~cylinderAnnulusToFace()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::cylinderAnnulusToFace::applyToSet
(
const topoSetSource::setAction action,
topoSet& set
) const
{
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
{
Info<< " Adding faces with centre within cylinder annulus,"
<< " with p1 = "
<< p1_ << ", p2 = " << p2_ << " and outer radius = " << outerRadius_
<< " and inner radius = " << innerRadius_
<< endl;
combine(set, true);
}
else if (action == topoSetSource::DELETE)
{
Info<< " Removing faces with centre within cylinder, with p1 = "
<< p1_ << ", p2 = " << p2_ << " and outer radius = " << outerRadius_
<< " and inner radius " << innerRadius_
<< endl;
combine(set, false);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,137 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 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::cylinderAnnulusToFace
Description
A topoSetSource to select faces based on face centres inside a
cylinder annulus.
SourceFiles
cylinderAnnulusToFace.C
\*---------------------------------------------------------------------------*/
#ifndef cylinderAnnulusToFace_H
#define cylinderAnnulusToFace_H
#include "topoSetSource.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class cylinderAnnulusToFace Declaration
\*---------------------------------------------------------------------------*/
class cylinderAnnulusToFace
:
public topoSetSource
{
// Private data
//- Add usage string
static addToUsageTable usage_;
//- First point on cylinder axis
vector p1_;
//- Second point on cylinder axis
vector p2_;
//- Outer Radius
scalar outerRadius_;
//- Inner Radius
scalar innerRadius_;
// Private Member Functions
void combine(topoSet& set, const bool add) const;
public:
//- Runtime type information
TypeName("cylinderAnnulusToFace");
// Constructors
//- Construct from components
cylinderAnnulusToFace
(
const polyMesh& mesh,
const vector& p1,
const vector& p2,
const scalar outerRadius,
const scalar innerRadius
);
//- Construct from dictionary
cylinderAnnulusToFace
(
const polyMesh& mesh,
const dictionary& dict
);
//- Construct from Istream
cylinderAnnulusToFace
(
const polyMesh& mesh,
Istream&
);
// Destructor
virtual ~cylinderAnnulusToFace();
// Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet
(
const topoSetSource::setAction action,
topoSet&
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,149 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 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 "cylinderToFace.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(cylinderToFace, 0);
addToRunTimeSelectionTable(topoSetSource, cylinderToFace, word);
addToRunTimeSelectionTable(topoSetSource, cylinderToFace, istream);
}
Foam::topoSetSource::addToUsageTable Foam::cylinderToFace::usage_
(
cylinderToFace::typeName,
"\n Usage: cylinderToFace (p1X p1Y p1Z) (p2X p2Y p2Z) radius\n\n"
" Select all faces with face centre within bounding cylinder\n\n"
);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::cylinderToFace::combine(topoSet& set, const bool add) const
{
const vector axis = p2_ - p1_;
const scalar rad2 = sqr(radius_);
const scalar magAxis2 = magSqr(axis);
const pointField& ctrs = mesh_.faceCentres();
forAll(ctrs, facei)
{
vector d = ctrs[facei] - p1_;
scalar magD = d & axis;
if ((magD > 0) && (magD < magAxis2))
{
scalar d2 = (d & d) - sqr(magD)/magAxis2;
if (d2 < rad2)
{
addOrDelete(set, facei, add);
}
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cylinderToFace::cylinderToFace
(
const polyMesh& mesh,
const vector& p1,
const vector& p2,
const scalar radius
)
:
topoSetSource(mesh),
p1_(p1),
p2_(p2),
radius_(radius)
{}
Foam::cylinderToFace::cylinderToFace
(
const polyMesh& mesh,
const dictionary& dict
)
:
topoSetSource(mesh),
p1_(dict.lookup("p1")),
p2_(dict.lookup("p2")),
radius_(readScalar(dict.lookup("radius")))
{}
Foam::cylinderToFace::cylinderToFace
(
const polyMesh& mesh,
Istream& is
)
:
topoSetSource(mesh),
p1_(checkIs(is)),
p2_(checkIs(is)),
radius_(readScalar(checkIs(is)))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cylinderToFace::~cylinderToFace()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::cylinderToFace::applyToSet
(
const topoSetSource::setAction action,
topoSet& set
) const
{
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
{
Info<< " Adding faces with centre within cylinder, with p1 = "
<< p1_ << ", p2 = " << p2_ << " and radius = " << radius_ << endl;
combine(set, true);
}
else if (action == topoSetSource::DELETE)
{
Info<< " Removing faces with centre within cylinder, with p1 = "
<< p1_ << ", p2 = " << p2_ << " and radius = " << radius_ << endl;
combine(set, false);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,133 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 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::cylinderToFace
Description
A topoSetSource to select faces based on face centres inside a cylinder.
SourceFiles
cylinderToFace.C
\*---------------------------------------------------------------------------*/
#ifndef cylinderToFace_H
#define cylinderToFace_H
#include "topoSetSource.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class cylinderToFace Declaration
\*---------------------------------------------------------------------------*/
class cylinderToFace
:
public topoSetSource
{
// Private data
//- Add usage string
static addToUsageTable usage_;
//- First point on cylinder axis
vector p1_;
//- Second point on cylinder axis
vector p2_;
//- Radius
scalar radius_;
// Private Member Functions
void combine(topoSet& set, const bool add) const;
public:
//- Runtime type information
TypeName("cylinderToFace");
// Constructors
//- Construct from components
cylinderToFace
(
const polyMesh& mesh,
const vector& p1,
const vector& p2,
const scalar radius
);
//- Construct from dictionary
cylinderToFace
(
const polyMesh& mesh,
const dictionary& dict
);
//- Construct from Istream
cylinderToFace
(
const polyMesh& mesh,
Istream&
);
//- Destructor
virtual ~cylinderToFace();
// Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet
(
const topoSetSource::setAction action,
topoSet&
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,20 +26,15 @@ License
#include "faceToFace.H"
#include "polyMesh.H"
#include "faceSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(faceToFace, 0);
addToRunTimeSelectionTable(topoSetSource, faceToFace, word);
addToRunTimeSelectionTable(topoSetSource, faceToFace, istream);
defineTypeNameAndDebug(faceToFace, 0);
addToRunTimeSelectionTable(topoSetSource, faceToFace, word);
addToRunTimeSelectionTable(topoSetSource, faceToFace, istream);
}
@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::faceToFace::usage_
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::faceToFace::faceToFace
(
const polyMesh& mesh,
@ -65,7 +59,6 @@ Foam::faceToFace::faceToFace
{}
// Construct from dictionary
Foam::faceToFace::faceToFace
(
const polyMesh& mesh,
@ -77,7 +70,6 @@ Foam::faceToFace::faceToFace
{}
// Construct from Istream
Foam::faceToFace::faceToFace
(
const polyMesh& mesh,

View File

@ -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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,15 @@ License
#include "labelToFace.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(labelToFace, 0);
addToRunTimeSelectionTable(topoSetSource, labelToFace, word);
addToRunTimeSelectionTable(topoSetSource, labelToFace, istream);
defineTypeNameAndDebug(labelToFace, 0);
addToRunTimeSelectionTable(topoSetSource, labelToFace, word);
addToRunTimeSelectionTable(topoSetSource, labelToFace, istream);
}
@ -63,7 +58,6 @@ void Foam::labelToFace::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::labelToFace::labelToFace
(
const polyMesh& mesh,
@ -75,7 +69,6 @@ Foam::labelToFace::labelToFace
{}
// Construct from dictionary
Foam::labelToFace::labelToFace
(
const polyMesh& mesh,
@ -87,7 +80,6 @@ Foam::labelToFace::labelToFace
{}
// Construct from Istream
Foam::labelToFace::labelToFace
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,20 +26,15 @@ License
#include "normalToFace.H"
#include "polyMesh.H"
#include "faceSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(normalToFace, 0);
addToRunTimeSelectionTable(topoSetSource, normalToFace, word);
addToRunTimeSelectionTable(topoSetSource, normalToFace, istream);
defineTypeNameAndDebug(normalToFace, 0);
addToRunTimeSelectionTable(topoSetSource, normalToFace, word);
addToRunTimeSelectionTable(topoSetSource, normalToFace, istream);
}
@ -71,7 +66,6 @@ void Foam::normalToFace::setNormal()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::normalToFace::normalToFace
(
const polyMesh& mesh,
@ -87,7 +81,6 @@ Foam::normalToFace::normalToFace
}
// Construct from dictionary
Foam::normalToFace::normalToFace(const polyMesh& mesh, const dictionary& dict)
:
topoSetSource(mesh),
@ -98,7 +91,6 @@ Foam::normalToFace::normalToFace(const polyMesh& mesh, const dictionary& dict)
}
// Construct from Istream
Foam::normalToFace::normalToFace(const polyMesh& mesh, Istream& is)
:
topoSetSource(mesh),

View File

@ -25,20 +25,15 @@ License
#include "patchToFace.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(patchToFace, 0);
addToRunTimeSelectionTable(topoSetSource, patchToFace, word);
addToRunTimeSelectionTable(topoSetSource, patchToFace, istream);
defineTypeNameAndDebug(patchToFace, 0);
addToRunTimeSelectionTable(topoSetSource, patchToFace, word);
addToRunTimeSelectionTable(topoSetSource, patchToFace, istream);
}
@ -90,7 +85,6 @@ void Foam::patchToFace::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::patchToFace::patchToFace
(
const polyMesh& mesh,
@ -102,7 +96,6 @@ Foam::patchToFace::patchToFace
{}
// Construct from dictionary
Foam::patchToFace::patchToFace
(
const polyMesh& mesh,
@ -114,7 +107,6 @@ Foam::patchToFace::patchToFace
{}
// Construct from Istream
Foam::patchToFace::patchToFace
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,7 +26,6 @@ License
#include "pointToFace.H"
#include "polyMesh.H"
#include "pointSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -146,7 +145,6 @@ void Foam::pointToFace::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::pointToFace::pointToFace
(
const polyMesh& mesh,
@ -160,7 +158,6 @@ Foam::pointToFace::pointToFace
{}
// Construct from dictionary
Foam::pointToFace::pointToFace
(
const polyMesh& mesh,
@ -173,7 +170,6 @@ Foam::pointToFace::pointToFace
{}
// Construct from Istream
Foam::pointToFace::pointToFace
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,13 +37,9 @@ License
namespace Foam
{
defineTypeNameAndDebug(regionToFace, 0);
addToRunTimeSelectionTable(topoSetSource, regionToFace, word);
addToRunTimeSelectionTable(topoSetSource, regionToFace, istream);
defineTypeNameAndDebug(regionToFace, 0);
addToRunTimeSelectionTable(topoSetSource, regionToFace, word);
addToRunTimeSelectionTable(topoSetSource, regionToFace, istream);
}
@ -176,7 +172,6 @@ void Foam::regionToFace::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::regionToFace::regionToFace
(
const polyMesh& mesh,
@ -190,7 +185,6 @@ Foam::regionToFace::regionToFace
{}
// Construct from dictionary
Foam::regionToFace::regionToFace
(
const polyMesh& mesh,
@ -203,7 +197,6 @@ Foam::regionToFace::regionToFace
{}
// Construct from Istream
Foam::regionToFace::regionToFace
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,15 @@ License
#include "zoneToFace.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(zoneToFace, 0);
addToRunTimeSelectionTable(topoSetSource, zoneToFace, word);
addToRunTimeSelectionTable(topoSetSource, zoneToFace, istream);
defineTypeNameAndDebug(zoneToFace, 0);
addToRunTimeSelectionTable(topoSetSource, zoneToFace, word);
addToRunTimeSelectionTable(topoSetSource, zoneToFace, istream);
}
@ -92,7 +87,6 @@ void Foam::zoneToFace::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::zoneToFace::zoneToFace
(
const polyMesh& mesh,
@ -104,7 +98,6 @@ Foam::zoneToFace::zoneToFace
{}
// Construct from dictionary
Foam::zoneToFace::zoneToFace
(
const polyMesh& mesh,
@ -116,7 +109,6 @@ Foam::zoneToFace::zoneToFace
{}
// Construct from Istream
Foam::zoneToFace::zoneToFace
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,20 +26,15 @@ License
#include "faceZoneToFaceZone.H"
#include "polyMesh.H"
#include "faceZoneSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(faceZoneToFaceZone, 0);
addToRunTimeSelectionTable(topoSetSource, faceZoneToFaceZone, word);
addToRunTimeSelectionTable(topoSetSource, faceZoneToFaceZone, istream);
defineTypeNameAndDebug(faceZoneToFaceZone, 0);
addToRunTimeSelectionTable(topoSetSource, faceZoneToFaceZone, word);
addToRunTimeSelectionTable(topoSetSource, faceZoneToFaceZone, istream);
}
@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::faceZoneToFaceZone::usage_
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::faceZoneToFaceZone::faceZoneToFaceZone
(
const polyMesh& mesh,
@ -65,7 +59,6 @@ Foam::faceZoneToFaceZone::faceZoneToFaceZone
{}
// Construct from dictionary
Foam::faceZoneToFaceZone::faceZoneToFaceZone
(
const polyMesh& mesh,
@ -77,7 +70,6 @@ Foam::faceZoneToFaceZone::faceZoneToFaceZone
{}
// Construct from Istream
Foam::faceZoneToFaceZone::faceZoneToFaceZone
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,7 +57,6 @@ Foam::topoSetSource::addToUsageTable Foam::searchableSurfaceToFaceZone::usage_
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from dictionary
Foam::searchableSurfaceToFaceZone::searchableSurfaceToFaceZone
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,20 +26,15 @@ License
#include "setToFaceZone.H"
#include "polyMesh.H"
#include "faceZoneSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(setToFaceZone, 0);
addToRunTimeSelectionTable(topoSetSource, setToFaceZone, word);
addToRunTimeSelectionTable(topoSetSource, setToFaceZone, istream);
defineTypeNameAndDebug(setToFaceZone, 0);
addToRunTimeSelectionTable(topoSetSource, setToFaceZone, word);
addToRunTimeSelectionTable(topoSetSource, setToFaceZone, istream);
}
@ -54,7 +49,6 @@ Foam::topoSetSource::addToUsageTable Foam::setToFaceZone::usage_
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::setToFaceZone::setToFaceZone
(
const polyMesh& mesh,
@ -66,7 +60,6 @@ Foam::setToFaceZone::setToFaceZone
{}
// Construct from dictionary
Foam::setToFaceZone::setToFaceZone
(
const polyMesh& mesh,
@ -78,7 +71,6 @@ Foam::setToFaceZone::setToFaceZone
{}
// Construct from Istream
Foam::setToFaceZone::setToFaceZone
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,7 +51,6 @@ Foam::topoSetSource::addToUsageTable Foam::setsToFaceZone::usage_
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::setsToFaceZone::setsToFaceZone
(
const polyMesh& mesh,
@ -67,7 +66,6 @@ Foam::setsToFaceZone::setsToFaceZone
{}
// Construct from dictionary
Foam::setsToFaceZone::setsToFaceZone
(
const polyMesh& mesh,
@ -81,7 +79,6 @@ Foam::setsToFaceZone::setsToFaceZone
{}
// Construct from Istream
Foam::setsToFaceZone::setsToFaceZone
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,15 @@ License
#include "boxToPoint.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(boxToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, boxToPoint, word);
addToRunTimeSelectionTable(topoSetSource, boxToPoint, istream);
defineTypeNameAndDebug(boxToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, boxToPoint, word);
addToRunTimeSelectionTable(topoSetSource, boxToPoint, istream);
}
@ -71,7 +66,6 @@ void Foam::boxToPoint::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::boxToPoint::boxToPoint
(
const polyMesh& mesh,
@ -83,7 +77,6 @@ Foam::boxToPoint::boxToPoint
{}
// Construct from dictionary
Foam::boxToPoint::boxToPoint
(
const polyMesh& mesh,
@ -100,7 +93,6 @@ Foam::boxToPoint::boxToPoint
{}
// Construct from Istream
Foam::boxToPoint::boxToPoint
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,7 +26,6 @@ License
#include "cellToPoint.H"
#include "polyMesh.H"
#include "cellSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -84,7 +83,6 @@ void Foam::cellToPoint::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::cellToPoint::cellToPoint
(
const polyMesh& mesh,
@ -98,7 +96,6 @@ Foam::cellToPoint::cellToPoint
{}
// Construct from dictionary
Foam::cellToPoint::cellToPoint
(
const polyMesh& mesh,
@ -111,7 +108,6 @@ Foam::cellToPoint::cellToPoint
{}
// Construct from Istream
Foam::cellToPoint::cellToPoint
(
const polyMesh& mesh,

View File

@ -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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,7 +26,6 @@ License
#include "faceToPoint.H"
#include "polyMesh.H"
#include "faceSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -77,7 +76,6 @@ void Foam::faceToPoint::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::faceToPoint::faceToPoint
(
const polyMesh& mesh,
@ -91,7 +89,6 @@ Foam::faceToPoint::faceToPoint
{}
// Construct from dictionary
Foam::faceToPoint::faceToPoint
(
const polyMesh& mesh,
@ -104,7 +101,6 @@ Foam::faceToPoint::faceToPoint
{}
// Construct from Istream
Foam::faceToPoint::faceToPoint
(
const polyMesh& mesh,

View File

@ -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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,15 @@ License
#include "labelToPoint.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(labelToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, labelToPoint, word);
addToRunTimeSelectionTable(topoSetSource, labelToPoint, istream);
defineTypeNameAndDebug(labelToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, labelToPoint, word);
addToRunTimeSelectionTable(topoSetSource, labelToPoint, istream);
}
@ -63,7 +58,6 @@ void Foam::labelToPoint::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::labelToPoint::labelToPoint
(
const polyMesh& mesh,
@ -75,7 +69,6 @@ Foam::labelToPoint::labelToPoint
{}
// Construct from dictionary
Foam::labelToPoint::labelToPoint
(
const polyMesh& mesh,
@ -87,7 +80,6 @@ Foam::labelToPoint::labelToPoint
{}
// Construct from Istream
Foam::labelToPoint::labelToPoint
(
const polyMesh& mesh,

View File

@ -32,13 +32,9 @@ License
namespace Foam
{
defineTypeNameAndDebug(nearestToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, nearestToPoint, word);
addToRunTimeSelectionTable(topoSetSource, nearestToPoint, istream);
defineTypeNameAndDebug(nearestToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, nearestToPoint, word);
addToRunTimeSelectionTable(topoSetSource, nearestToPoint, istream);
}
@ -104,7 +100,6 @@ void Foam::nearestToPoint::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::nearestToPoint::nearestToPoint
(
const polyMesh& mesh,
@ -116,7 +111,6 @@ Foam::nearestToPoint::nearestToPoint
{}
// Construct from dictionary
Foam::nearestToPoint::nearestToPoint
(
const polyMesh& mesh,
@ -128,7 +122,6 @@ Foam::nearestToPoint::nearestToPoint
{}
// Construct from Istream
Foam::nearestToPoint::nearestToPoint
(
const polyMesh& mesh,

View File

@ -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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,20 +26,15 @@ License
#include "pointToPoint.H"
#include "polyMesh.H"
#include "pointSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(pointToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, pointToPoint, word);
addToRunTimeSelectionTable(topoSetSource, pointToPoint, istream);
defineTypeNameAndDebug(pointToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, pointToPoint, word);
addToRunTimeSelectionTable(topoSetSource, pointToPoint, istream);
}
@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::pointToPoint::usage_
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::pointToPoint::pointToPoint
(
const polyMesh& mesh,
@ -65,7 +59,6 @@ Foam::pointToPoint::pointToPoint
{}
// Construct from dictionary
Foam::pointToPoint::pointToPoint
(
const polyMesh& mesh,
@ -77,7 +70,6 @@ Foam::pointToPoint::pointToPoint
{}
// Construct from Istream
Foam::pointToPoint::pointToPoint
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,13 +32,9 @@ License
namespace Foam
{
defineTypeNameAndDebug(zoneToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, zoneToPoint, word);
addToRunTimeSelectionTable(topoSetSource, zoneToPoint, istream);
defineTypeNameAndDebug(zoneToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, zoneToPoint, word);
addToRunTimeSelectionTable(topoSetSource, zoneToPoint, istream);
}
@ -92,7 +88,6 @@ void Foam::zoneToPoint::combine(topoSet& set, const bool add) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::zoneToPoint::zoneToPoint
(
const polyMesh& mesh,
@ -104,7 +99,6 @@ Foam::zoneToPoint::zoneToPoint
{}
// Construct from dictionary
Foam::zoneToPoint::zoneToPoint
(
const polyMesh& mesh,
@ -116,7 +110,6 @@ Foam::zoneToPoint::zoneToPoint
{}
// Construct from Istream
Foam::zoneToPoint::zoneToPoint
(
const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,20 +26,15 @@ License
#include "setToPointZone.H"
#include "polyMesh.H"
#include "pointZoneSet.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(setToPointZone, 0);
addToRunTimeSelectionTable(topoSetSource, setToPointZone, word);
addToRunTimeSelectionTable(topoSetSource, setToPointZone, istream);
defineTypeNameAndDebug(setToPointZone, 0);
addToRunTimeSelectionTable(topoSetSource, setToPointZone, word);
addToRunTimeSelectionTable(topoSetSource, setToPointZone, istream);
}
@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::setToPointZone::usage_
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::setToPointZone::setToPointZone
(
const polyMesh& mesh,
@ -65,7 +59,6 @@ Foam::setToPointZone::setToPointZone
{}
// Construct from dictionary
Foam::setToPointZone::setToPointZone
(
const polyMesh& mesh,
@ -77,7 +70,6 @@ Foam::setToPointZone::setToPointZone
{}
// Construct from Istream
Foam::setToPointZone::setToPointZone
(
const polyMesh& mesh,

View File

@ -1,5 +1,5 @@
sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
sinclude $(RULES)/mplib$(WM_MPLIB)
sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB)
EXE_INC = \
$(PFLAGS) $(PINC) \

View File

@ -3,7 +3,7 @@
* This is purely to avoid scotch.h including mpicxx.h, which causes problems.
*/
sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
sinclude $(RULES)/mplib$(WM_MPLIB)
sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB)
EXE_INC = \
$(PFLAGS) $(PINC) \

View File

@ -1,5 +1,5 @@
sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
sinclude $(RULES)/mplib$(WM_MPLIB)
sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB)
EXE_INC = \
$(PFLAGS) $(PINC) \

View File

@ -29,7 +29,6 @@ License
#include "volPointInterpolation.H"
#include "addToRunTimeSelectionTable.H"
#include "fvMesh.H"
#include "volumeType.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -134,8 +133,6 @@ void Foam::distanceSurface::createGeometry()
const fvMesh& fvm = static_cast<const fvMesh&>(mesh_);
const labelList& own = fvm.faceOwner();
// Distance to cell centres
// ~~~~~~~~~~~~~~~~~~~~~~~~
@ -173,35 +170,14 @@ void Foam::distanceSurface::createGeometry()
if (signed_)
{
List<volumeType> volType;
vectorField norms;
surfPtr_().getNormal(nearest, norms);
surfPtr_().getVolumeType(cc, volType);
forAll(volType, i)
forAll(norms, i)
{
volumeType vT = volType[i];
const point diff(cc[i] - nearest[i].hitPoint());
if (vT == volumeType::OUTSIDE)
{
fld[i] = Foam::mag(cc[i] - nearest[i].hitPoint());
}
else if (vT == volumeType::INSIDE)
{
fld[i] = -Foam::mag(cc[i] - nearest[i].hitPoint());
}
else if (vT == volumeType::UNKNOWN)
{
// Treat as very far outside
fld[i] = GREAT;
}
else
{
FatalErrorInFunction
<< "getVolumeType failure:"
<< " neither INSIDE or OUTSIDE but "
<< volumeType::names[vT]
<< exit(FatalError);
}
fld[i] = sign(diff & norms[i]) * Foam::mag(diff);
}
}
else
@ -223,9 +199,6 @@ void Foam::distanceSurface::createGeometry()
const pointField& cc = fvm.C().boundaryField()[patchi];
fvPatchScalarField& fld = cellDistanceBf[patchi];
const label patchStarti = fvm.boundaryMesh()[patchi].start();
List<pointIndexHit> nearest;
surfPtr_().findNearest
(
@ -236,41 +209,14 @@ void Foam::distanceSurface::createGeometry()
if (signed_)
{
List<volumeType> volType;
vectorField norms;
surfPtr_().getNormal(nearest, norms);
surfPtr_().getVolumeType(cc, volType);
forAll(volType, i)
forAll(norms, i)
{
volumeType vT = volType[i];
const point diff(cc[i] - nearest[i].hitPoint());
if (vT == volumeType::OUTSIDE)
{
fld[i] = Foam::mag(cc[i] - nearest[i].hitPoint());
}
else if (vT == volumeType::INSIDE)
{
fld[i] = -Foam::mag(cc[i] - nearest[i].hitPoint());
}
else if (vT == volumeType::UNKNOWN)
{
// Nothing known, so use the cell value.
// - this avoids spurious changes on the boundary
// The cell value
const label meshFacei = i+patchStarti;
const scalar& cellVal = cellDistance[own[meshFacei]];
fld[i] = cellVal;
}
else
{
FatalErrorInFunction
<< "getVolumeType failure:"
<< " neither INSIDE or OUTSIDE but "
<< volumeType::names[vT]
<< exit(FatalError);
}
fld[i] = sign(diff & norms[i]) * Foam::mag(diff);
}
}
else
@ -303,44 +249,21 @@ void Foam::distanceSurface::createGeometry()
if (signed_)
{
List<volumeType> volType;
vectorField norms;
surfPtr_().getNormal(nearest, norms);
surfPtr_().getVolumeType(pts, volType);
forAll(volType, i)
forAll(norms, i)
{
volumeType vT = volType[i];
const point diff(pts[i] - nearest[i].hitPoint());
if (vT == volumeType::OUTSIDE)
{
pointDistance_[i] =
Foam::mag(pts[i] - nearest[i].hitPoint());
}
else if (vT == volumeType::INSIDE)
{
pointDistance_[i] =
-Foam::mag(pts[i] - nearest[i].hitPoint());
}
else if (vT == volumeType::UNKNOWN)
{
// Treat as very far outside
pointDistance_[i] = GREAT;
}
else
{
FatalErrorInFunction
<< "getVolumeType failure:"
<< " neither INSIDE or OUTSIDE but "
<< volumeType::names[vT]
<< exit(FatalError);
}
pointDistance_[i] = sign(diff & norms[i]) * Foam::mag(diff);
}
}
else
{
forAll(nearest, i)
{
pointDistance_[i] = Foam::mag(pts[i]-nearest[i].hitPoint());
pointDistance_[i] = Foam::mag(pts[i] - nearest[i].hitPoint());
}
}
}

View File

@ -60,14 +60,6 @@ namespace Foam
}
};
// Avoid detecting change if the cells have been marked as GREAT
// (ie, ignore them)
static inline constexpr bool ignoreValue(const scalar val)
{
return (val >= 0.5*Foam::GREAT);
}
} // End namespace Foam
@ -165,7 +157,7 @@ void Foam::isoSurface::syncUnseparatedPoints
forAll(nbrPts, pointi)
{
label nbrPointi = nbrPts[pointi];
const label nbrPointi = nbrPts[pointi];
patchInfo[nbrPointi] = pointValues[meshPts[pointi]];
}
@ -314,39 +306,19 @@ bool Foam::isoSurface::isEdgeOfFaceCut
const bool neiLower
) const
{
// Could also count number of edges cut and return when they are > 1
// but doesn't appear to improve anything
forAll(f, fp)
{
const scalar& pt0Value = pVals[f[fp]];
const bool fpLower = (pVals[f[fp]] < iso_);
if (ignoreValue(pt0Value))
if
(
fpLower != ownLower
|| fpLower != neiLower
|| fpLower != (pVals[f[f.fcIndex(fp)]] < iso_)
)
{
continue;
}
const bool fpLower = (pt0Value < iso_);
if (fpLower != ownLower || fpLower != neiLower)
{
// ++ncut;
return true;
}
else
{
const scalar& pt1Value = pVals[f[f.fcIndex(fp)]];
if (!ignoreValue(pt1Value) && (fpLower != (pt1Value < iso_)))
{
// ++ncut;
return true;
}
}
// if (ncut > 1)
// {
// return true;
// }
}
return false;
@ -401,17 +373,9 @@ void Foam::isoSurface::calcCutTypes
faceCutType_.setSize(mesh_.nFaces());
faceCutType_ = NOTCUT;
// Avoid detecting change if the cells have been marked as GREAT
// (ie, ignore them)
for (label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
{
const scalar& ownValue = cVals[own[facei]];
if (ignoreValue(ownValue))
{
continue;
}
const bool ownLower = (ownValue < iso_);
scalar nbrValue;
@ -427,11 +391,6 @@ void Foam::isoSurface::calcCutTypes
nbrPoint
);
if (ignoreValue(nbrValue))
{
continue;
}
const bool neiLower = (nbrValue < iso_);
if (ownLower != neiLower)
@ -503,7 +462,6 @@ void Foam::isoSurface::calcCutTypes
// Propagate internal face cuts into the cells.
// For cells marked as ignore (eg, GREAT) - skip this.
for (label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
{
@ -512,20 +470,12 @@ void Foam::isoSurface::calcCutTypes
continue;
}
if
(
cellCutType_[own[facei]] == NOTCUT
&& !ignoreValue(cVals[own[facei]])
)
if (cellCutType_[own[facei]] == NOTCUT)
{
cellCutType_[own[facei]] = CUT;
++nCutCells_;
}
if
(
cellCutType_[nei[facei]] == NOTCUT
&& !ignoreValue(cVals[nei[facei]])
)
if (cellCutType_[nei[facei]] == NOTCUT)
{
cellCutType_[nei[facei]] = CUT;
++nCutCells_;
@ -534,8 +484,6 @@ void Foam::isoSurface::calcCutTypes
// Propagate boundary face cuts into the cells.
// For cells marked as ignore (eg, GREAT) - skip this and
// also suppress the boundary face cut to prevent dangling face cuts.
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); ++facei)
{
@ -544,12 +492,7 @@ void Foam::isoSurface::calcCutTypes
continue;
}
if (ignoreValue(cVals[own[facei]]))
{
// Suppress dangling boundary face cut
faceCutType_[facei] = NOTCUT;
}
else if (cellCutType_[own[facei]] == NOTCUT)
if (cellCutType_[own[facei]] == NOTCUT)
{
cellCutType_[own[facei]] = CUT;
++nCutCells_;
@ -774,10 +717,8 @@ void Foam::isoSurface::calcSnappedPoint
bool anyCut = false;
forAll(pFaces, i)
for (const label facei : pFaces)
{
label facei = pFaces[i];
if (faceCutType_[facei] == CUT)
{
anyCut = true;
@ -795,12 +736,10 @@ void Foam::isoSurface::calcSnappedPoint
label nOther = 0;
point otherPointSum = Zero;
forAll(pFaces, pFacei)
for (const label facei : pFaces)
{
// Create points for all intersections close to point
// (i.e. from pyramid edges)
label facei = pFaces[pFacei];
const face& f = mesh_.faces()[facei];
label own = mesh_.faceOwner()[facei];

View File

@ -44,20 +44,6 @@ namespace Foam
}
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
namespace Foam
{
// Avoid detecting change if the cells have been marked as GREAT
// (ie, ignore them)
static inline constexpr bool ignoreValue(const scalar val)
{
return (val >= 0.5*Foam::GREAT);
}
} // End namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::scalar Foam::isoSurfaceCell::isoFraction
@ -99,11 +85,6 @@ Foam::isoSurfaceCell::cellCutType Foam::isoSurfaceCell::calcCutType
const label celli
) const
{
if (ignoreValue(cellValues[celli]))
{
return NOTCUT;
}
const cell& cFaces = mesh_.cells()[celli];
if (isTet.test(celli))
@ -137,11 +118,7 @@ Foam::isoSurfaceCell::cellCutType Foam::isoSurfaceCell::calcCutType
// Check pyramids cut
for (const label labi : f)
{
if
(
!ignoreValue(pointValues[labi])
&& cellLower != (pointValues[labi] < iso_)
)
if (cellLower != (pointValues[labi] < iso_))
{
edgeCut = true;
break;
@ -187,11 +164,7 @@ Foam::isoSurfaceCell::cellCutType Foam::isoSurfaceCell::calcCutType
for (const label pointi : cPoints)
{
if
(
!ignoreValue(pointValues[pointi])
&& cellLower != (pointValues[pointi] < iso_)
)
if (cellLower != (pointValues[pointi] < iso_))
{
++nCuts;
}
@ -201,7 +174,7 @@ Foam::isoSurfaceCell::cellCutType Foam::isoSurfaceCell::calcCutType
{
return SPHERE;
}
else if (nCuts > 1)
else
{
return CUT;
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -40,6 +40,7 @@ SourceFiles
#include "pointField.H"
#include "labelledTri.H"
#include "HashSet.H"
#include "ListOps.H"
#include "surfZoneList.H"
#include "surfaceFormatsCore.H"
#include "runTimeSelectionTables.H"
@ -101,7 +102,7 @@ public:
const pointField& pointLst,
const UList<Face>& faceLst,
const UList<surfZone>& zoneLst = List<surfZone>(),
const labelUList& faceMap = List<label>()
const labelUList& faceMap = Foam::emptyLabelList
);

Some files were not shown because too many files have changed in this diff Show More