Compilation fixes
This commit is contained in:
parent
3ed10cf177
commit
bea25f5960
299 changed files with 4017 additions and 108360 deletions
8
applications/solvers/compressible/sonicFoam/UEqn.H
Normal file
8
applications/solvers/compressible/sonicFoam/UEqn.H
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
fvVectorMatrix UEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(rho, U)
|
||||||
|
+ fvm::div(phi, U)
|
||||||
|
+ turbulence->divDevRhoReff(U)
|
||||||
|
);
|
||||||
|
|
||||||
|
solve(UEqn == -fvc::grad(p));
|
|
@ -15,7 +15,7 @@ IOdictionary gravitationalProperties
|
||||||
const dimensionedVector g(gravitationalProperties.lookup("g"));
|
const dimensionedVector g(gravitationalProperties.lookup("g"));
|
||||||
const Switch rotating(gravitationalProperties.lookup("rotating"));
|
const Switch rotating(gravitationalProperties.lookup("rotating"));
|
||||||
const dimensionedVector Omega =
|
const dimensionedVector Omega =
|
||||||
rotating ? gravitationalProperties.lookup("Omega")
|
rotating ? dimensionedVector(gravitationalProperties.lookup("Omega"))
|
||||||
: dimensionedVector("Omega", -dimTime, vector(0,0,0));
|
: dimensionedVector("Omega", -dimTime, vector(0,0,0));
|
||||||
const dimensionedScalar magg = mag(g);
|
const dimensionedScalar magg = mag(g);
|
||||||
const dimensionedVector gHat = g/magg;
|
const dimensionedVector gHat = g/magg;
|
||||||
|
|
|
@ -39,24 +39,17 @@ Description
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
Info<< "\nEstimating error in scalar transport equation\n" << endl;
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "\nEstimating error in scalar transport equation\n"
|
||||||
|
<< "Reading transportProperties\n" << endl;
|
||||||
|
|
||||||
IOdictionary transportProperties
|
IOdictionary transportProperties
|
||||||
(
|
(
|
||||||
|
@ -79,9 +72,9 @@ int main(int argc, char *argv[])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
@ -134,7 +127,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
return(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,25 +38,17 @@ Description
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
Info<< "\nEstimating error in the incompressible momentum equation\n"
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "\nEstimating error in the incompressible momentum equation\n"
|
||||||
|
<< "Reading transportProperties\n" << endl;
|
||||||
|
|
||||||
IOdictionary transportProperties
|
IOdictionary transportProperties
|
||||||
(
|
(
|
||||||
|
@ -75,9 +67,9 @@ int main(int argc, char *argv[])
|
||||||
transportProperties.lookup("nu")
|
transportProperties.lookup("nu")
|
||||||
);
|
);
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
@ -131,7 +123,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
return(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,25 +39,17 @@ Description
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
Info<< "\nEstimating error in the incompressible momentum equation\n"
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "\nEstimating error in the incompressible momentum equation\n"
|
||||||
|
<< "Reading transportProperties\n" << endl;
|
||||||
|
|
||||||
IOdictionary transportProperties
|
IOdictionary transportProperties
|
||||||
(
|
(
|
||||||
|
@ -76,9 +68,9 @@ int main(int argc, char *argv[])
|
||||||
transportProperties.lookup("nu")
|
transportProperties.lookup("nu")
|
||||||
);
|
);
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
@ -190,7 +182,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
return(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,24 +40,17 @@ Description
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
Info<< "\nEstimating error in scalar transport equation\n" << endl;
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "\nEstimating error in scalar transport equation\n"
|
||||||
|
<< "Reading transportProperties\n" << endl;
|
||||||
|
|
||||||
IOdictionary transportProperties
|
IOdictionary transportProperties
|
||||||
(
|
(
|
||||||
|
@ -80,9 +73,9 @@ int main(int argc, char *argv[])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
@ -186,7 +179,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
return(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
|
-lincompressibleLESModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools
|
-lmeshTools
|
||||||
|
|
|
@ -34,32 +34,26 @@ Description
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
#include "singlePhaseTransportModel.H"
|
||||||
#include "incompressible/RASModel/RASModel.H"
|
#include "turbulenceModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
timeSelector::addOptions();
|
||||||
# include "setRootCase.H"
|
|
||||||
|
|
||||||
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
// set startTime and endTime depending on -time and -latestTime options
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
@ -94,9 +88,9 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
singlePhaseTransportModel laminarTransport(U, phi);
|
singlePhaseTransportModel laminarTransport(U, phi);
|
||||||
|
|
||||||
autoPtr<incompressible::RASModel> turbulence
|
autoPtr<incompressible::turbulenceModel> turbulence
|
||||||
(
|
(
|
||||||
incompressible::RASModel::New(U, phi, laminarTransport)
|
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< " Calculating uResidual" << endl;
|
Info<< " Calculating uResidual" << endl;
|
||||||
|
|
|
@ -225,7 +225,7 @@ int main(int argc, char *argv[])
|
||||||
runTime.constant(),
|
runTime.constant(),
|
||||||
runTime
|
runTime
|
||||||
),
|
),
|
||||||
blocks.points(),
|
xferCopy(blocks.points()),
|
||||||
blocks.cells(),
|
blocks.cells(),
|
||||||
blocks.patches(),
|
blocks.patches(),
|
||||||
patchNames,
|
patchNames,
|
||||||
|
|
|
@ -425,7 +425,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
),
|
),
|
||||||
tmpBlockPoints,
|
xferMove(tmpBlockPoints),
|
||||||
tmpBlockCells,
|
tmpBlockCells,
|
||||||
tmpBlocksPatches,
|
tmpBlocksPatches,
|
||||||
patchNames,
|
patchNames,
|
||||||
|
|
|
@ -327,11 +327,10 @@ autoPtr<mapPolyMesh> reorderMesh
|
||||||
|
|
||||||
mesh.resetPrimitives
|
mesh.resetPrimitives
|
||||||
(
|
(
|
||||||
mesh.nFaces(),
|
Xfer<pointField>::null(),
|
||||||
mesh.points(),
|
xferMove(newFaces),
|
||||||
newFaces,
|
xferMove(newOwner),
|
||||||
newOwner,
|
xferMove(newNeighbour),
|
||||||
newNeighbour,
|
|
||||||
patchSizes,
|
patchSizes,
|
||||||
patchStarts
|
patchStarts
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
@ -7,9 +8,9 @@ EXE_INC = \
|
||||||
$(WM_DECOMP_INC)
|
$(WM_DECOMP_INC)
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
-ldecompositionMethods \
|
||||||
|
-lmeshTools \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lfiniteArea \
|
-lfiniteArea \
|
||||||
-ldecompositionMethods \
|
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
-lmeshTools \
|
|
||||||
$(WM_DECOMP_LIBS)
|
$(WM_DECOMP_LIBS)
|
||||||
|
|
|
@ -35,36 +35,8 @@ License
|
||||||
#include "globalMeshData.H"
|
#include "globalMeshData.H"
|
||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void domainDecomposition::mark
|
|
||||||
(
|
|
||||||
const labelList& zoneElems,
|
|
||||||
const label zoneI,
|
|
||||||
labelList& elementToZone
|
|
||||||
)
|
|
||||||
{
|
|
||||||
forAll(zoneElems, i)
|
|
||||||
{
|
|
||||||
label pointi = zoneElems[i];
|
|
||||||
|
|
||||||
if (elementToZone[pointi] == -1)
|
|
||||||
{
|
|
||||||
// First occurrence
|
|
||||||
elementToZone[pointi] = zoneI;
|
|
||||||
}
|
|
||||||
else if (elementToZone[pointi] >= 0)
|
|
||||||
{
|
|
||||||
// Multiple zones
|
|
||||||
elementToZone[pointi] = -2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// from components
|
|
||||||
domainDecomposition::domainDecomposition(const IOobject& io)
|
domainDecomposition::domainDecomposition(const IOobject& io)
|
||||||
:
|
:
|
||||||
fvMesh(io),
|
fvMesh(io),
|
||||||
|
@ -295,16 +267,16 @@ bool domainDecomposition::writeDecomposition()
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
name(),
|
this->polyMesh::name(), // region name of undecomposed mesh
|
||||||
"constant",
|
pointsInstance(),
|
||||||
processorDb
|
processorDb
|
||||||
),
|
),
|
||||||
procPoints,
|
xferMove(procPoints),
|
||||||
procFaces,
|
xferMove(procFaces),
|
||||||
procOwner,
|
xferMove(procOwner),
|
||||||
procNeighbour,
|
xferMove(procNeighbour),
|
||||||
false // Do not sync par
|
false // Do not sync par
|
||||||
// procCells // Old-fashioned mesh creation using cells.
|
// xferMove(procCells) // Old-fashioned mesh creation using cells.
|
||||||
// Deprecated: using face owner/neighbour
|
// Deprecated: using face owner/neighbour
|
||||||
// HJ, 30/Mar/2009
|
// HJ, 30/Mar/2009
|
||||||
);
|
);
|
||||||
|
|
|
@ -26,43 +26,33 @@
|
||||||
# paraview3/bashrc
|
# paraview3/bashrc
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Setup file for ParaView3.
|
# Setup file for paraview-3.x
|
||||||
# Sourced from OpenFOAM-?.?/etc/bashrc
|
# Sourced from OpenFOAM-*/etc/bashrc
|
||||||
#
|
#
|
||||||
# Note
|
# Note
|
||||||
# The env. variable 'ParaView_DIR' is required for building plugins
|
# The env. variable 'ParaView_DIR' is required for building plugins
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
export CMAKE_HOME=$WM_THIRD_PARTY_DIR/cmake-2.4.6/platforms/$WM_ARCH
|
|
||||||
|
|
||||||
if [ -r $CMAKE_HOME ]; then
|
|
||||||
# determine the cmake to be used
|
# determine the cmake to be used
|
||||||
unset CMAKE_HOME
|
unset CMAKE_HOME
|
||||||
for cmake in cmake-2.8.2 cmake-2.6.4 cmake-2.6.2 cmake-2.4.6
|
for cmake in cmake-2.6.4 cmake-2.6.2 cmake-2.4.6
|
||||||
do
|
do
|
||||||
cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH
|
cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH
|
||||||
if [ -r $cmake ]
|
if [ -r $cmake ]
|
||||||
then
|
then
|
||||||
export CMAKE_HOME=$cmake
|
export CMAKE_HOME=$cmake
|
||||||
export PATH=$CMAKE_HOME/bin:$PATH
|
export PATH=$CMAKE_HOME/bin:$PATH
|
||||||
else
|
|
||||||
unset CMAKE_HOME
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
export ParaView_VERSION="3.3-cvs"
|
|
||||||
# export ParaView_VERSION="3.4.0"
|
|
||||||
# set MAJOR and VERSION variables if not already set
|
# set MAJOR and VERSION variables if not already set
|
||||||
[ -z "$ParaView_MAJOR" ] && export ParaView_MAJOR=paraview-3.6
|
[ -z "$ParaView_MAJOR" ] && export ParaView_MAJOR=paraview-3.8
|
||||||
[ -z "$ParaView_VERSION" ] && export ParaView_VERSION=3.6.1
|
[ -z "$ParaView_VERSION" ] && export ParaView_VERSION=3.8.0
|
||||||
|
|
||||||
export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
|
|
||||||
export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION
|
export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION
|
||||||
export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
|
export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
|
||||||
|
|
||||||
if [ "$PYTHONPATH" ]; then
|
|
||||||
export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/Utilities/VTKPythonWrapping
|
|
||||||
# add in python libraries if required
|
# add in python libraries if required
|
||||||
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
|
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||||
if [ -r $paraviewPython ]
|
if [ -r $paraviewPython ]
|
||||||
|
@ -71,33 +61,25 @@ then
|
||||||
then
|
then
|
||||||
export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_DIR/lib/$ParaView_MAJOR
|
export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_DIR/lib/$ParaView_MAJOR
|
||||||
else
|
else
|
||||||
export PYTHONPATH=$ParaView_DIR/Utilities/VTKPythonWrapping
|
|
||||||
export PYTHONPATH=$paraviewPython:$ParaView_DIR/lib/$ParaView_MAJOR
|
export PYTHONPATH=$paraviewPython:$ParaView_DIR/lib/$ParaView_MAJOR
|
||||||
fi
|
fi
|
||||||
if [ $WM_ARCH == "darwinPpc" -o $WM_ARCH == "darwinIntel" ]
|
fi
|
||||||
|
|
||||||
|
if [ "$PYTHONPATH" ]; then
|
||||||
|
export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||||
|
else
|
||||||
|
export PYTHONPATH=$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||||
|
fi
|
||||||
|
if [ $WM_ARCH = "darwinPpc" -o $WM_ARCH = "darwinIntel" ]
|
||||||
then
|
then
|
||||||
export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/bin
|
export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/bin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -r $ParaView_DIR ]; then
|
|
||||||
if [ -r $ParaView_DIR ]
|
if [ -r $ParaView_DIR ]
|
||||||
then
|
then
|
||||||
export PATH=$ParaView_DIR/bin:$PATH
|
export PATH=$ParaView_DIR/bin:$PATH
|
||||||
export LD_LIBRARY_PATH=$ParaView_DIR/bin:$LD_LIBRARY_PATH
|
|
||||||
if [ $WM_ARCH == "darwinPpc" -o $WM_ARCH == "darwinIntel" ]
|
|
||||||
then
|
|
||||||
export DYLD_LIBRARY_PATH=$ParaView_DIR/bin:$DYLD_LIBRARY_PATH
|
|
||||||
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview
|
|
||||||
if [ ! -e $PV_PLUGIN_PATH ]
|
|
||||||
then
|
|
||||||
echo "Creating $PV_PLUGIN_PATH"
|
|
||||||
mkdir $PV_PLUGIN_PATH
|
|
||||||
fi
|
|
||||||
ln -sf $FOAM_LIBBIN/libPV* $PV_PLUGIN_PATH
|
|
||||||
else
|
|
||||||
export PV_PLUGIN_PATH=$FOAM_LIBBIN
|
export PV_PLUGIN_PATH=$FOAM_LIBBIN
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
unset cmake paraviewPython
|
unset cmake paraviewPython
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
|
@ -34,6 +34,11 @@ Documentation
|
||||||
|
|
||||||
DebugSwitches
|
DebugSwitches
|
||||||
{
|
{
|
||||||
|
BlockLduMatrix 2;
|
||||||
|
|
||||||
|
CircumferentialAveragingInterpolation 0;
|
||||||
|
mixingPlanePolyPatch 1;
|
||||||
|
|
||||||
overlapGgi 0;
|
overlapGgi 0;
|
||||||
cyclicGgi 0;
|
cyclicGgi 0;
|
||||||
coupledLduMatrix 1;
|
coupledLduMatrix 1;
|
||||||
|
@ -465,6 +470,7 @@ DebugSwitches
|
||||||
genericPatch 0;
|
genericPatch 0;
|
||||||
geomCellLooper 0;
|
geomCellLooper 0;
|
||||||
geometricSurfacePatch 0;
|
geometricSurfacePatch 0;
|
||||||
|
ggi 0;
|
||||||
global 0;
|
global 0;
|
||||||
globalMeshData 0;
|
globalMeshData 0;
|
||||||
globalPoints 0;
|
globalPoints 0;
|
||||||
|
@ -874,10 +880,59 @@ InfoSwitches
|
||||||
OptimisationSwitches
|
OptimisationSwitches
|
||||||
{
|
{
|
||||||
fileModificationSkew 10;
|
fileModificationSkew 10;
|
||||||
commsType nonBlocking; //scheduled; //blocking;
|
// commsType nonBlocking; //scheduled; //blocking;
|
||||||
// commsType blocking; //scheduled; //blocking;
|
commsType blocking; //scheduled;
|
||||||
floatTransfer 0;// Floating transfer not realiable
|
floatTransfer 0;// Floating transfer not realiable
|
||||||
nProcsSimpleSum 0;
|
nProcsSimpleSum 0;
|
||||||
|
|
||||||
|
nSquaredProjection 0;
|
||||||
|
// nSquaredProjection 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Tolerances
|
||||||
|
{
|
||||||
|
// Primitive mesh checking limits
|
||||||
|
primitiveMeshClosedThreshold 1e-6;
|
||||||
|
primitiveMeshAspectThreshold 1000;
|
||||||
|
primitiveMeshNonOrthThreshold 70;
|
||||||
|
primitiveMeshSkewThreshold 4;
|
||||||
|
primitiveMeshFaceAngleThreshold 10;
|
||||||
|
primitiveMeshFaceFlatnessThreshold 0.8;
|
||||||
|
|
||||||
|
// Geometric matching tolerances
|
||||||
|
cyclicMatchTol 1e-4;
|
||||||
|
processorMatchTol 1e-4;
|
||||||
|
|
||||||
|
// Volumetric closed domain
|
||||||
|
closedDomainTol 1e-10;
|
||||||
|
|
||||||
|
// Patch-to-patch interpolation tolerances
|
||||||
|
patchToPatchDirectHit 1e-5;
|
||||||
|
patchToPatchProjectionTol 0.05;
|
||||||
|
|
||||||
|
// Thermophysical models
|
||||||
|
specieThermoTol 1e-4;
|
||||||
|
|
||||||
|
// Intersection tolerance
|
||||||
|
intersectionPlanarTol 0.2;
|
||||||
|
intersectionMissTol 1e-10;
|
||||||
|
|
||||||
|
// Sliding interface
|
||||||
|
// slidingPointMergeTol 0.2;
|
||||||
|
// slidingEdgeMergeTol 0.05;
|
||||||
|
// slidingIntegralAdjTol 0.15;
|
||||||
|
// slidingEdgeMasterCatchFraction 0.4;
|
||||||
|
// slidingEdgeEndCutoffTol 0.0001;
|
||||||
|
// slidingEdgeCoPlanarTol 0.8;
|
||||||
|
|
||||||
|
slidingPointMergeTol 0.2;
|
||||||
|
slidingEdgeMergeTol 0.01;
|
||||||
|
slidingIntegralAdjTol 0.05;
|
||||||
|
slidingEdgeMasterCatchFraction 0.4;
|
||||||
|
slidingEdgeEndCutoffTol 0.0001;
|
||||||
|
slidingEdgeCoPlanarTol 0.8;
|
||||||
|
|
||||||
|
// GGIAreaErrorTol 1e-8;
|
||||||
}
|
}
|
||||||
|
|
||||||
DimensionedConstants
|
DimensionedConstants
|
||||||
|
|
|
@ -11,12 +11,16 @@ Pstream/Allwmake
|
||||||
wmake libo OSspecific/$WM_OSTYPE
|
wmake libo OSspecific/$WM_OSTYPE
|
||||||
wmake libso OpenFOAM
|
wmake libso OpenFOAM
|
||||||
|
|
||||||
( cd decompositionAgglomeration && ./Allwmake )
|
# Decomposition methods needed by meshTools
|
||||||
|
decompositionMethods/AllwmakeLnInclude
|
||||||
|
decompositionMethods/Allwmake
|
||||||
|
|
||||||
wmake libso lagrangian/basic
|
wmake libso lagrangian/basic
|
||||||
|
|
||||||
wmake libso triSurface
|
wmake libso triSurface
|
||||||
wmake libso edgeMesh
|
wmake libso edgeMesh
|
||||||
|
wmake libso surfMesh
|
||||||
|
|
||||||
wmake libso meshTools
|
wmake libso meshTools
|
||||||
wmake libso finiteVolume
|
wmake libso finiteVolume
|
||||||
wmake libso finiteArea
|
wmake libso finiteArea
|
||||||
|
|
|
@ -25,6 +25,7 @@ License
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "SIBS.H"
|
#include "SIBS.H"
|
||||||
|
#include "simpleMatrix.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ void Foam::SIBS::SIMPR
|
||||||
scalar h = deltaX/nSteps;
|
scalar h = deltaX/nSteps;
|
||||||
const label nEqns = ode_.nEqns();
|
const label nEqns = ode_.nEqns();
|
||||||
|
|
||||||
Matrix<scalar> a(nEqns, nEqns);
|
scalarSquareMatrix a(nEqns);
|
||||||
for (register label i=0; i<nEqns; i++)
|
for (register label i=0; i<nEqns; i++)
|
||||||
{
|
{
|
||||||
for (register label j=0; j<nEqns; j++)
|
for (register label j=0; j<nEqns; j++)
|
||||||
|
@ -54,14 +55,14 @@ void Foam::SIBS::SIMPR
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList pivotIndices(nEqns);
|
labelList pivotIndices(nEqns);
|
||||||
simpleMatrix<scalar>::LUDecompose(a, pivotIndices);
|
scalarSquareMatrix::LUDecompose(a, pivotIndices);
|
||||||
|
|
||||||
for (register label i=0; i<nEqns; i++)
|
for (register label i=0; i<nEqns; i++)
|
||||||
{
|
{
|
||||||
yEnd[i] = h*(dydx[i] + h*dfdx[i]);
|
yEnd[i] = h*(dydx[i] + h*dfdx[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
simpleMatrix<scalar>::LUBacksubstitute(a, pivotIndices, yEnd);
|
scalarSquareMatrix::LUBacksubstitute(a, pivotIndices, yEnd);
|
||||||
|
|
||||||
scalarField del(yEnd);
|
scalarField del(yEnd);
|
||||||
scalarField ytemp(nEqns);
|
scalarField ytemp(nEqns);
|
||||||
|
|
|
@ -37,7 +37,7 @@ Description
|
||||||
#ifndef HamiltonRodriguezRot_H
|
#ifndef HamiltonRodriguezRot_H
|
||||||
#define HamiltonRodriguezRot_H
|
#define HamiltonRodriguezRot_H
|
||||||
|
|
||||||
#include "Matrix.H"
|
#include "scalarMatrices.H"
|
||||||
#include "coordinateRotation.H"
|
#include "coordinateRotation.H"
|
||||||
#include "scalarField.H"
|
#include "scalarField.H"
|
||||||
#include "dimensionedTypes.H"
|
#include "dimensionedTypes.H"
|
||||||
|
@ -64,7 +64,7 @@ class HamiltonRodriguezRot
|
||||||
scalar e3_;
|
scalar e3_;
|
||||||
|
|
||||||
//- Body to quaternions transformation
|
//- Body to quaternions transformation
|
||||||
Matrix<scalar> Gt_;
|
scalarRectangularMatrix Gt_;
|
||||||
|
|
||||||
//- Inertial to rotated coordinate system transformation
|
//- Inertial to rotated coordinate system transformation
|
||||||
mutable tensor R_;
|
mutable tensor R_;
|
||||||
|
|
|
@ -217,7 +217,7 @@ void Foam::sixDOFqODE::jacobian
|
||||||
const scalar x,
|
const scalar x,
|
||||||
const scalarField& y,
|
const scalarField& y,
|
||||||
scalarField& dfdx,
|
scalarField& dfdx,
|
||||||
Matrix<scalar>& dfdy
|
scalarSquareMatrix& dfdy
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
Info << "jacobian(...)" << endl;
|
Info << "jacobian(...)" << endl;
|
||||||
|
|
|
@ -340,7 +340,7 @@ public:
|
||||||
const scalar x,
|
const scalar x,
|
||||||
const scalarField& y,
|
const scalarField& y,
|
||||||
scalarField& dfdx,
|
scalarField& dfdx,
|
||||||
Matrix<scalar>& dfdy
|
scalarSquareMatrix& dfdy
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Update ODE after the solution, advancing by delta
|
//- Update ODE after the solution, advancing by delta
|
||||||
|
|
|
@ -33,7 +33,7 @@ Author
|
||||||
Hrvoje Jasak
|
Hrvoje Jasak
|
||||||
Dubravko Matijasevic
|
Dubravko Matijasevic
|
||||||
|
|
||||||
\*----------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "translationODE.H"
|
#include "translationODE.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
|
@ -143,7 +143,7 @@ void Foam::translationODE::jacobian
|
||||||
const scalar x,
|
const scalar x,
|
||||||
const scalarField& y,
|
const scalarField& y,
|
||||||
scalarField& dfdx,
|
scalarField& dfdx,
|
||||||
Matrix<scalar>& dfdy
|
scalarSquareMatrix& dfdy
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
notImplemented("translationODE::jacobian(...) const");
|
notImplemented("translationODE::jacobian(...) const");
|
||||||
|
|
|
@ -220,7 +220,7 @@ public:
|
||||||
const scalar x,
|
const scalar x,
|
||||||
const scalarField& y,
|
const scalarField& y,
|
||||||
scalarField& dfdx,
|
scalarField& dfdx,
|
||||||
Matrix<scalar>& dfdy
|
scalarSquareMatrix& dfdy
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Update ODE after the solution, advancing by delta
|
//- Update ODE after the solution, advancing by delta
|
||||||
|
|
|
@ -204,6 +204,11 @@ dimensionedTypes/dimensionedTensor/dimensionedTensor.C
|
||||||
matrices/solution/solution.C
|
matrices/solution/solution.C
|
||||||
matrices/constraint/scalarConstraint.C
|
matrices/constraint/scalarConstraint.C
|
||||||
|
|
||||||
|
scalarMatrices = matrices/scalarMatrices
|
||||||
|
$(scalarMatrices)/scalarMatrices.C
|
||||||
|
$(scalarMatrices)/scalarSquareMatrix.C
|
||||||
|
$(scalarMatrices)/SVD/SVD.C
|
||||||
|
|
||||||
LUscalarMatrix = matrices/LUscalarMatrix
|
LUscalarMatrix = matrices/LUscalarMatrix
|
||||||
$(LUscalarMatrix)/LUscalarMatrix.C
|
$(LUscalarMatrix)/LUscalarMatrix.C
|
||||||
$(LUscalarMatrix)/procLduMatrix.C
|
$(LUscalarMatrix)/procLduMatrix.C
|
||||||
|
@ -441,6 +446,7 @@ $(cellMatcher)/degenerateMatcher.C
|
||||||
|
|
||||||
mapPolyMesh = $(polyMesh)/mapPolyMesh
|
mapPolyMesh = $(polyMesh)/mapPolyMesh
|
||||||
$(mapPolyMesh)/mapPolyMesh.C
|
$(mapPolyMesh)/mapPolyMesh.C
|
||||||
|
$(mapPolyMesh)/pointMapper/pointMapper.C
|
||||||
$(mapPolyMesh)/faceMapper/faceMapper.C
|
$(mapPolyMesh)/faceMapper/faceMapper.C
|
||||||
$(mapPolyMesh)/cellMapper/cellMapper.C
|
$(mapPolyMesh)/cellMapper/cellMapper.C
|
||||||
$(mapPolyMesh)/mapDistribute/mapDistribute.C
|
$(mapPolyMesh)/mapDistribute/mapDistribute.C
|
||||||
|
|
|
@ -559,7 +559,11 @@ void Foam::Time::setTime(const instant& inst, const label newIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::Time::setTime(const dimensionedScalar& newTime, const label newIndex)
|
void Foam::Time::setTime
|
||||||
|
(
|
||||||
|
const dimensionedScalar& newTime,
|
||||||
|
const label newIndex
|
||||||
|
)
|
||||||
{
|
{
|
||||||
setTime(newTime.value(), newIndex);
|
setTime(newTime.value(), newIndex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,7 +305,11 @@ public:
|
||||||
instant findClosestTime(const scalar) const;
|
instant findClosestTime(const scalar) const;
|
||||||
|
|
||||||
//- Search instantList for the time index closest to the given time
|
//- Search instantList for the time index closest to the given time
|
||||||
static label findClosestTimeIndex(const instantList&, const scalar);
|
static label findClosestTimeIndex
|
||||||
|
(
|
||||||
|
const instantList&,
|
||||||
|
const scalar
|
||||||
|
);
|
||||||
|
|
||||||
//- Write using given format, version and compression
|
//- Write using given format, version and compression
|
||||||
virtual bool writeObject
|
virtual bool writeObject
|
||||||
|
|
|
@ -137,7 +137,6 @@ void MapGeometricFields
|
||||||
// Cannot check sizes for patch fields because of
|
// Cannot check sizes for patch fields because of
|
||||||
// empty fields in FV and because point fields get their size
|
// empty fields in FV and because point fields get their size
|
||||||
// from the patch which has already been resized
|
// from the patch which has already been resized
|
||||||
//
|
|
||||||
|
|
||||||
field.boundaryField()[patchi].autoMap
|
field.boundaryField()[patchi].autoMap
|
||||||
(
|
(
|
||||||
|
|
|
@ -162,6 +162,12 @@ int Foam::debug::optimisationSwitch(const char* name, const int defaultValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::dictionary& Foam::debug::tolerances()
|
||||||
|
{
|
||||||
|
return switchSet("Tolerances", tolerancesPtr_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
double Foam::debug::tolerances
|
double Foam::debug::tolerances
|
||||||
(
|
(
|
||||||
const char* name,
|
const char* name,
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
argList::validOptions.insert("constant", "");
|
|
8
src/OpenFOAM/include/addTimeOptions.H
Normal file
8
src/OpenFOAM/include/addTimeOptions.H
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
//
|
||||||
|
// addTimeOptions.H
|
||||||
|
// ~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Foam::argList::validOptions.insert("constant", "");
|
||||||
|
Foam::argList::validOptions.insert("latestTime", "");
|
||||||
|
Foam::argList::validOptions.insert("noZero", "");
|
||||||
|
Foam::argList::validOptions.insert("time", "time");
|
|
@ -112,7 +112,7 @@ static void Foam::DenseMatrixTools::qrDecompose
|
||||||
(
|
(
|
||||||
const label nCols,
|
const label nCols,
|
||||||
FieldField<Field, Type>& A,
|
FieldField<Field, Type>& A,
|
||||||
Matrix<Form, T>& R
|
Matrix<Form, Type>& R
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Note: consider Arnoldi algorithm for speed-up. HJ, 14/Sep/2006
|
// Note: consider Arnoldi algorithm for speed-up. HJ, 14/Sep/2006
|
||||||
|
|
|
@ -51,12 +51,12 @@ namespace DenseMatrixTools
|
||||||
static void solve(SquareMatrix<Type>& A, List<Type>& x, List<Type>& b);
|
static void solve(SquareMatrix<Type>& A, List<Type>& x, List<Type>& b);
|
||||||
|
|
||||||
//- Q-R decomposition
|
//- Q-R decomposition
|
||||||
template<class Form, class T>
|
template<class Form, class Type>
|
||||||
static void qrDecompose
|
static void qrDecompose
|
||||||
(
|
(
|
||||||
const label nCols,
|
const label nCols,
|
||||||
FieldField<Field, T>& A,
|
FieldField<Field, Type>& A,
|
||||||
Matrix<class Form, class Type>& R
|
Matrix<Form, Type>& R
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -125,9 +125,6 @@ Foam::lduSolverPerformance Foam::PBiCG::solve
|
||||||
// Select and construct the preconditioner
|
// Select and construct the preconditioner
|
||||||
autoPtr<lduPreconditioner> preconPtr;
|
autoPtr<lduPreconditioner> preconPtr;
|
||||||
|
|
||||||
if (dict().isDict("preconditioner"))
|
|
||||||
{
|
|
||||||
// New format: preconditioner is dictionary
|
|
||||||
preconPtr =
|
preconPtr =
|
||||||
lduPreconditioner::New
|
lduPreconditioner::New
|
||||||
(
|
(
|
||||||
|
@ -137,24 +134,6 @@ Foam::lduSolverPerformance Foam::PBiCG::solve
|
||||||
interfaces_,
|
interfaces_,
|
||||||
dict().subDict("preconditioner")
|
dict().subDict("preconditioner")
|
||||||
);
|
);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Old format: manufacture a dictionary
|
|
||||||
dictionary preconDict;
|
|
||||||
preconDict.add("type", word(dict().lookup("preconditioner")));
|
|
||||||
|
|
||||||
preconPtr =
|
|
||||||
lduPreconditioner::New
|
|
||||||
(
|
|
||||||
matrix_,
|
|
||||||
coupleBouCoeffs_,
|
|
||||||
coupleIntCoeffs_,
|
|
||||||
interfaces_,
|
|
||||||
preconDict
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Solver iteration
|
// Solver iteration
|
||||||
do
|
do
|
||||||
|
|
|
@ -115,12 +115,6 @@ Foam::lduSolverPerformance Foam::PCG::solve
|
||||||
// Select and construct the preconditioner
|
// Select and construct the preconditioner
|
||||||
autoPtr<lduPreconditioner> preconPtr;
|
autoPtr<lduPreconditioner> preconPtr;
|
||||||
|
|
||||||
// For backward compatibility, check type of preconditioner entry
|
|
||||||
// HJ, 2/Oct/2007
|
|
||||||
|
|
||||||
if (dict().isDict("preconditioner"))
|
|
||||||
{
|
|
||||||
// New format: preconditioner is dictionary
|
|
||||||
preconPtr =
|
preconPtr =
|
||||||
lduPreconditioner::New
|
lduPreconditioner::New
|
||||||
(
|
(
|
||||||
|
@ -128,25 +122,8 @@ Foam::lduSolverPerformance Foam::PCG::solve
|
||||||
coupleBouCoeffs_,
|
coupleBouCoeffs_,
|
||||||
coupleIntCoeffs_,
|
coupleIntCoeffs_,
|
||||||
interfaces_,
|
interfaces_,
|
||||||
dict().subDict("preconditioner")
|
dict()
|
||||||
);
|
);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Old format: manufacture a dictionary
|
|
||||||
dictionary preconDict;
|
|
||||||
preconDict.add("type", word(dict().lookup("preconditioner")));
|
|
||||||
|
|
||||||
preconPtr =
|
|
||||||
lduPreconditioner::New
|
|
||||||
(
|
|
||||||
matrix_,
|
|
||||||
coupleBouCoeffs_,
|
|
||||||
coupleIntCoeffs_,
|
|
||||||
interfaces_,
|
|
||||||
preconDict
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Solver iteration
|
// Solver iteration
|
||||||
do
|
do
|
||||||
|
|
203
src/OpenFOAM/matrices/scalarMatrices/scalarSquareMatrix.C
Normal file
203
src/OpenFOAM/matrices/scalarMatrices/scalarSquareMatrix.C
Normal file
|
@ -0,0 +1,203 @@
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright held by original author
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "scalarSquareMatrix.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::scalarSquareMatrix::scalarSquareMatrix()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalarSquareMatrix::scalarSquareMatrix(const label mSize)
|
||||||
|
:
|
||||||
|
SquareMatrix<scalar>(mSize, 0.0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalarSquareMatrix::scalarSquareMatrix
|
||||||
|
(
|
||||||
|
const label mSize,
|
||||||
|
const scalar v
|
||||||
|
)
|
||||||
|
:
|
||||||
|
SquareMatrix<scalar>(mSize, v)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalarSquareMatrix::scalarSquareMatrix(const scalarSquareMatrix& matrix)
|
||||||
|
:
|
||||||
|
SquareMatrix<scalar>(matrix)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalarSquareMatrix::scalarSquareMatrix(Istream& is)
|
||||||
|
:
|
||||||
|
SquareMatrix<scalar>(is)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::scalarSquareMatrix::LUDecompose
|
||||||
|
(
|
||||||
|
scalarSquareMatrix& matrix,
|
||||||
|
labelList& pivotIndices
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label n = matrix.n();
|
||||||
|
scalar vv[n];
|
||||||
|
|
||||||
|
for (register label i=0; i<n; i++)
|
||||||
|
{
|
||||||
|
scalar largestCoeff = 0.0;
|
||||||
|
scalar temp;
|
||||||
|
const scalar* __restrict__ matrixi = matrix[i];
|
||||||
|
|
||||||
|
for (register label j=0; j<n; j++)
|
||||||
|
{
|
||||||
|
if ((temp = mag(matrixi[j])) > largestCoeff)
|
||||||
|
{
|
||||||
|
largestCoeff = temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (largestCoeff == 0.0)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"scalarSquareMatrix::LUdecompose"
|
||||||
|
"(scalarSquareMatrix& matrix, labelList& rowIndices)"
|
||||||
|
) << "Singular matrix" << exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
vv[i] = 1.0/largestCoeff;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (register label j=0; j<n; j++)
|
||||||
|
{
|
||||||
|
scalar* __restrict__ matrixj = matrix[j];
|
||||||
|
|
||||||
|
for (register label i=0; i<j; i++)
|
||||||
|
{
|
||||||
|
scalar* __restrict__ matrixi = matrix[i];
|
||||||
|
|
||||||
|
scalar sum = matrixi[j];
|
||||||
|
for (register label k=0; k<i; k++)
|
||||||
|
{
|
||||||
|
sum -= matrixi[k]*matrix[k][j];
|
||||||
|
}
|
||||||
|
matrixi[j] = sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
label iMax = 0;
|
||||||
|
|
||||||
|
scalar largestCoeff = 0.0;
|
||||||
|
for (register label i=j; i<n; i++)
|
||||||
|
{
|
||||||
|
scalar* __restrict__ matrixi = matrix[i];
|
||||||
|
scalar sum = matrixi[j];
|
||||||
|
|
||||||
|
for (register label k=0; k<j; k++)
|
||||||
|
{
|
||||||
|
sum -= matrixi[k]*matrix[k][j];
|
||||||
|
}
|
||||||
|
|
||||||
|
matrixi[j] = sum;
|
||||||
|
|
||||||
|
scalar temp;
|
||||||
|
if ((temp = vv[i]*mag(sum)) >= largestCoeff)
|
||||||
|
{
|
||||||
|
largestCoeff = temp;
|
||||||
|
iMax = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pivotIndices[j] = iMax;
|
||||||
|
|
||||||
|
if (j != iMax)
|
||||||
|
{
|
||||||
|
scalar* __restrict__ matrixiMax = matrix[iMax];
|
||||||
|
|
||||||
|
for (register label k=0; k<n; k++)
|
||||||
|
{
|
||||||
|
Swap(matrixj[k], matrixiMax[k]);
|
||||||
|
}
|
||||||
|
|
||||||
|
vv[iMax] = vv[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (matrixj[j] == 0.0)
|
||||||
|
{
|
||||||
|
matrixj[j] = SMALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j != n-1)
|
||||||
|
{
|
||||||
|
scalar rDiag = 1.0/matrixj[j];
|
||||||
|
|
||||||
|
for (register label i=j+1; i<n; i++)
|
||||||
|
{
|
||||||
|
matrix[i][j] *= rDiag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalarSquareMatrix Foam::scalarSquareMatrix::LUinvert() const
|
||||||
|
{
|
||||||
|
scalarSquareMatrix luMatrix = *this;
|
||||||
|
|
||||||
|
scalarSquareMatrix luInvert(luMatrix.n());
|
||||||
|
scalarField column(luMatrix.n());
|
||||||
|
|
||||||
|
labelList pivotIndices(luMatrix.n());
|
||||||
|
|
||||||
|
LUDecompose(luMatrix, pivotIndices);
|
||||||
|
|
||||||
|
for (label j = 0; j < luMatrix.n(); j++)
|
||||||
|
{
|
||||||
|
for (label i = 0; i < luMatrix.n(); i++)
|
||||||
|
{
|
||||||
|
column[i] = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
column[j] = 1.0;
|
||||||
|
|
||||||
|
LUBacksubstitute(luMatrix, pivotIndices, column);
|
||||||
|
|
||||||
|
for (label i = 0; i < luMatrix.n(); i++)
|
||||||
|
{
|
||||||
|
luInvert[i][j] = column[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return luInvert;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -23,20 +23,21 @@ License
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::receivingReferralList
|
Foam::scalarSquareMatrix
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
Foam::scalarSquareMatrix
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
receivingReferralListI.H
|
scalarSquareMatrix.C
|
||||||
receivingReferralList.C
|
|
||||||
receivingReferralListIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef receivingReferralList_H
|
#ifndef scalarSquareMatrix_H
|
||||||
#define receivingReferralList_H
|
#define scalarSquareMatrix_H
|
||||||
|
|
||||||
|
#include "SquareMatrix.H"
|
||||||
|
#include "scalarField.H"
|
||||||
#include "labelList.H"
|
#include "labelList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
@ -45,81 +46,72 @@ namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class receivingReferralList Declaration
|
Class scalarSquareMatrix Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class receivingReferralList
|
class scalarSquareMatrix
|
||||||
:
|
:
|
||||||
public labelListList
|
public SquareMatrix<scalar>
|
||||||
{
|
{
|
||||||
// Private data
|
|
||||||
|
|
||||||
label sourceProc_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
receivingReferralList();
|
scalarSquareMatrix();
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct given size
|
||||||
receivingReferralList
|
scalarSquareMatrix(const label);
|
||||||
(
|
|
||||||
const label sourceProc,
|
//- Construct given size and coefficient value
|
||||||
const labelListList& refCellsToSendTo
|
scalarSquareMatrix(const label, const scalar v);
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct as copy
|
//- Construct as copy
|
||||||
receivingReferralList(const receivingReferralList&);
|
scalarSquareMatrix(const scalarSquareMatrix&);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
// Destructor
|
scalarSquareMatrix(Istream&);
|
||||||
|
|
||||||
~receivingReferralList();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- Solve the matrix using Gaussian elimination with pivoting,
|
||||||
|
// returning the solution in the source.
|
||||||
|
// Matrix given as a reference is destroyed during solution
|
||||||
|
template<class T>
|
||||||
|
static void solve(scalarSquareMatrix& matrix, Field<T>& source);
|
||||||
|
|
||||||
inline label sourceProc() const;
|
//- Solve the matrix using Gaussian elimination with pivoting
|
||||||
|
// and return the solution
|
||||||
|
template<class Type>
|
||||||
|
void solve(Field<Type>& psi, const Field<Type>& source) const;
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
//- LU decompose the matrix with pivoting
|
||||||
|
static void LUDecompose
|
||||||
void operator=(const receivingReferralList&);
|
|
||||||
|
|
||||||
|
|
||||||
// Friend Operators
|
|
||||||
|
|
||||||
friend bool operator==
|
|
||||||
(
|
(
|
||||||
const receivingReferralList& a,
|
scalarSquareMatrix& matrix,
|
||||||
const receivingReferralList& b
|
labelList& pivotIndices
|
||||||
);
|
);
|
||||||
|
|
||||||
inline friend bool operator!=
|
//- LU back-substitution with given source, returning the solution
|
||||||
|
// in the source
|
||||||
|
template<class Type>
|
||||||
|
static void LUBacksubstitute
|
||||||
(
|
(
|
||||||
const receivingReferralList& a,
|
const scalarSquareMatrix& luMmatrix,
|
||||||
const receivingReferralList& b
|
const labelList& pivotIndices,
|
||||||
|
Field<Type>& source
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Invert the matrix using LU decomposition with pivoting
|
||||||
|
scalarSquareMatrix LUinvert() const;
|
||||||
|
|
||||||
// IOstream Operators
|
//- Solve the matrix using LU decomposition with pivoting
|
||||||
|
// returning the LU form of the matrix and the solution in the source
|
||||||
friend Istream& operator>>
|
template<class Type>
|
||||||
(
|
static void LUsolve(scalarSquareMatrix& matrix, Field<Type>& source);
|
||||||
Istream&,
|
|
||||||
receivingReferralList&
|
|
||||||
);
|
|
||||||
|
|
||||||
friend Ostream& operator<<
|
|
||||||
(
|
|
||||||
Ostream&,
|
|
||||||
const receivingReferralList&
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,7 +121,9 @@ public:
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#include "receivingReferralListI.H"
|
#ifdef NoRepository
|
||||||
|
# include "scalarSquareMatrixTemplates.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
|
@ -0,0 +1,179 @@
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright held by original author
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "scalarSquareMatrix.H"
|
||||||
|
#include "Swap.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::scalarSquareMatrix::solve
|
||||||
|
(
|
||||||
|
scalarSquareMatrix& tmpMatrix,
|
||||||
|
Field<Type>& sourceSol
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label n = tmpMatrix.n();
|
||||||
|
|
||||||
|
// Elimination
|
||||||
|
for (register label i=0; i<n; i++)
|
||||||
|
{
|
||||||
|
label iMax = i;
|
||||||
|
scalar largestCoeff = mag(tmpMatrix[iMax][i]);
|
||||||
|
|
||||||
|
// Swap entries around to find a good pivot
|
||||||
|
for (register label j=i+1; j<n; j++)
|
||||||
|
{
|
||||||
|
if (mag(tmpMatrix[j][i]) > largestCoeff)
|
||||||
|
{
|
||||||
|
iMax = j;
|
||||||
|
largestCoeff = mag(tmpMatrix[iMax][i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i != iMax)
|
||||||
|
{
|
||||||
|
//Info<< "Pivoted on " << i << " " << iMax << endl;
|
||||||
|
|
||||||
|
for (register label k=i; k<n; k++)
|
||||||
|
{
|
||||||
|
Swap(tmpMatrix[i][k], tmpMatrix[iMax][k]);
|
||||||
|
}
|
||||||
|
Swap(sourceSol[i], sourceSol[iMax]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check that the system of equations isn't singular
|
||||||
|
if (mag(tmpMatrix[i][i]) < 1e-20)
|
||||||
|
{
|
||||||
|
FatalErrorIn("solve(scalarSquareMatrix&, Field<Type>& sourceSol)")
|
||||||
|
<< "Singular Matrix"
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reduce to upper triangular form
|
||||||
|
for (register label j=i+1; j<n; j++)
|
||||||
|
{
|
||||||
|
sourceSol[j] -= sourceSol[i]*(tmpMatrix[j][i]/tmpMatrix[i][i]);
|
||||||
|
|
||||||
|
for (register label k=n-1; k>=i; k--)
|
||||||
|
{
|
||||||
|
tmpMatrix[j][k] -=
|
||||||
|
tmpMatrix[i][k]*tmpMatrix[j][i]/tmpMatrix[i][i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Back-substitution
|
||||||
|
for (register label j=n-1; j>=0; j--)
|
||||||
|
{
|
||||||
|
Type ntempvec = pTraits<Type>::zero;
|
||||||
|
|
||||||
|
for (register label k=j+1; k<n; k++)
|
||||||
|
{
|
||||||
|
ntempvec += tmpMatrix[j][k]*sourceSol[k];
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSol[j] = (sourceSol[j] - ntempvec)/tmpMatrix[j][j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::scalarSquareMatrix::solve
|
||||||
|
(
|
||||||
|
Field<Type>& psi,
|
||||||
|
const Field<Type>& source
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalarSquareMatrix tmpMatrix = *this;
|
||||||
|
psi = source;
|
||||||
|
solve(tmpMatrix, psi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::scalarSquareMatrix::LUBacksubstitute
|
||||||
|
(
|
||||||
|
const scalarSquareMatrix& luMatrix,
|
||||||
|
const labelList& pivotIndices,
|
||||||
|
Field<Type>& sourceSol
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label n = luMatrix.n();
|
||||||
|
|
||||||
|
label ii = 0;
|
||||||
|
|
||||||
|
for (register label i=0; i<n; i++)
|
||||||
|
{
|
||||||
|
label ip = pivotIndices[i];
|
||||||
|
Type sum = sourceSol[ip];
|
||||||
|
sourceSol[ip] = sourceSol[i];
|
||||||
|
const scalar* __restrict__ luMatrixi = luMatrix[i];
|
||||||
|
|
||||||
|
if (ii != 0)
|
||||||
|
{
|
||||||
|
for (label j=ii-1; j<i; j++)
|
||||||
|
{
|
||||||
|
sum -= luMatrixi[j]*sourceSol[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (sum != pTraits<Type>::zero)
|
||||||
|
{
|
||||||
|
ii = i+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSol[i] = sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (register label i=n-1; i>=0; i--)
|
||||||
|
{
|
||||||
|
Type sum = sourceSol[i];
|
||||||
|
const scalar* __restrict__ luMatrixi = luMatrix[i];
|
||||||
|
|
||||||
|
for (register label j=i+1; j<n; j++)
|
||||||
|
{
|
||||||
|
sum -= luMatrixi[j]*sourceSol[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSol[i] = sum/luMatrixi[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::scalarSquareMatrix::LUsolve
|
||||||
|
(
|
||||||
|
scalarSquareMatrix& matrix,
|
||||||
|
Field<Type>& sourceSol
|
||||||
|
)
|
||||||
|
{
|
||||||
|
labelList pivotIndices(matrix.n());
|
||||||
|
LUDecompose(matrix, pivotIndices);
|
||||||
|
LUBacksubstitute(matrix, pivotIndices, sourceSol);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -81,10 +81,12 @@ protected:
|
||||||
virtual void calcGeometry();
|
virtual void calcGeometry();
|
||||||
|
|
||||||
//- Initialise the patches for moving points
|
//- Initialise the patches for moving points
|
||||||
virtual void initMovePoints(const pointField&);
|
virtual void initMovePoints(const pointField&)
|
||||||
|
{}
|
||||||
|
|
||||||
//- Correct patches after moving points
|
//- Correct patches after moving points
|
||||||
virtual void movePoints();
|
virtual void movePoints()
|
||||||
|
{}
|
||||||
|
|
||||||
//- Initialise the update of the patch topology
|
//- Initialise the update of the patch topology
|
||||||
virtual void initUpdateMesh();
|
virtual void initUpdateMesh();
|
||||||
|
|
112
src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointEdges.C
Normal file
112
src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointEdges.C
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright held by original author
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "primitiveMesh.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void primitiveMesh::calcPointEdges() const
|
||||||
|
{
|
||||||
|
// Loop through edges and mark up points
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "primitiveMesh::calcPointEdges() : "
|
||||||
|
<< "calculating pointEdges"
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// It is an error to attempt to recalculate pointEdges
|
||||||
|
// if the pointer is already set
|
||||||
|
if (pePtr_)
|
||||||
|
{
|
||||||
|
FatalErrorIn("primitiveMesh::calcPointEdges() const")
|
||||||
|
<< "pointEdges already calculated"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const edgeList& e = edges();
|
||||||
|
|
||||||
|
// Count edges per point
|
||||||
|
|
||||||
|
labelList npe(nPoints(), 0);
|
||||||
|
|
||||||
|
forAll (e, edgeI)
|
||||||
|
{
|
||||||
|
npe[e[edgeI].start()]++;
|
||||||
|
npe[e[edgeI].end()]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Size and fill edges per point
|
||||||
|
|
||||||
|
pePtr_ = new labelListList(npe.size());
|
||||||
|
labelListList& pointEdgeAddr = *pePtr_;
|
||||||
|
|
||||||
|
forAll (pointEdgeAddr, pointI)
|
||||||
|
{
|
||||||
|
pointEdgeAddr[pointI].setSize(npe[pointI]);
|
||||||
|
}
|
||||||
|
npe = 0;
|
||||||
|
|
||||||
|
forAll (e, edgeI)
|
||||||
|
{
|
||||||
|
label v0 = e[edgeI].start();
|
||||||
|
|
||||||
|
pointEdgeAddr[v0][npe[v0]++] = edgeI;
|
||||||
|
|
||||||
|
label v1 = e[edgeI].end();
|
||||||
|
|
||||||
|
pointEdgeAddr[v1][npe[v1]++] = edgeI;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
const labelListList& primitiveMesh::pointEdges() const
|
||||||
|
{
|
||||||
|
if (!pePtr_)
|
||||||
|
{
|
||||||
|
calcPointEdges();
|
||||||
|
}
|
||||||
|
|
||||||
|
return *pePtr_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -33,6 +33,8 @@ SourceFiles
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "pTraits.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// template specialisation for pTraits<Scalar>
|
// template specialisation for pTraits<Scalar>
|
||||||
|
|
|
@ -28,6 +28,7 @@ License
|
||||||
#include "products.H"
|
#include "products.H"
|
||||||
#include "VectorSpaceM.H"
|
#include "VectorSpaceM.H"
|
||||||
#include "ops.H"
|
#include "ops.H"
|
||||||
|
#include "pTraits.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
|
@ -2851,13 +2851,18 @@ void Foam::autoLayerDriver::addLayers
|
||||||
// Saved old points
|
// Saved old points
|
||||||
pointField oldPoints(mesh.points());
|
pointField oldPoints(mesh.points());
|
||||||
|
|
||||||
// Last set of topology changes. (changing mesh clears out polyTopoChange)
|
// Last set of topology changes. Changing mesh clears out directTopoChange
|
||||||
polyTopoChange savedMeshMod(mesh.boundaryMesh().size());
|
directTopoChange savedMeshMod(mesh.boundaryMesh().size());
|
||||||
|
|
||||||
boolList flaggedCells;
|
boolList flaggedCells;
|
||||||
boolList flaggedFaces;
|
boolList flaggedFaces;
|
||||||
|
|
||||||
for (label iteration = 0; iteration < layerParams.nLayerIter(); iteration++)
|
for
|
||||||
|
(
|
||||||
|
label iteration = 0;
|
||||||
|
iteration < layerParams.nLayerIter();
|
||||||
|
iteration++
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "Layer addition iteration " << iteration << nl
|
<< "Layer addition iteration " << iteration << nl
|
||||||
|
|
|
@ -36,6 +36,7 @@ SourceFiles
|
||||||
#ifndef autoLayerDriver_H
|
#ifndef autoLayerDriver_H
|
||||||
#define autoLayerDriver_H
|
#define autoLayerDriver_H
|
||||||
|
|
||||||
|
#include "PackedBoolList.H"
|
||||||
#include "meshRefinement.H"
|
#include "meshRefinement.H"
|
||||||
#include "wallPoint.H"
|
#include "wallPoint.H"
|
||||||
|
|
||||||
|
@ -379,7 +380,8 @@ class autoLayerDriver
|
||||||
Field<Type>& average
|
Field<Type>& average
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Calculate inverse sum of edge weights (currently always 1.0)
|
//- Calculate inverse sum of edge weights
|
||||||
|
// (currently always 1.0)
|
||||||
void sumWeights
|
void sumWeights
|
||||||
(
|
(
|
||||||
const PackedBoolList& isMasterEdge,
|
const PackedBoolList& isMasterEdge,
|
||||||
|
|
|
@ -25,7 +25,7 @@ License
|
||||||
Description
|
Description
|
||||||
Shrinking mesh (part of adding cell layers)
|
Shrinking mesh (part of adding cell layers)
|
||||||
|
|
||||||
\*----------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "autoLayerDriver.H"
|
#include "autoLayerDriver.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
|
@ -1132,7 +1132,8 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
|
||||||
Info<< "Iteration " << iter << endl;
|
Info<< "Iteration " << iter << endl;
|
||||||
if (iter == nSnap)
|
if (iter == nSnap)
|
||||||
{
|
{
|
||||||
Info<< "Displacement scaling for error reduction set to 0." << endl;
|
Info<< "Displacement scaling for error reduction set to 0."
|
||||||
|
<< endl;
|
||||||
oldErrorReduction = meshMover.setErrorReduction(0.0);
|
oldErrorReduction = meshMover.setErrorReduction(0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1149,7 +1150,8 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Info<< "shrinkMeshMedialDistance : Successfully moved mesh" << endl;
|
Info<< "shrinkMeshMedialDistance : Successfully moved mesh"
|
||||||
|
<< endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ SourceFiles
|
||||||
#ifndef autoSnapDriver_H
|
#ifndef autoSnapDriver_H
|
||||||
#define autoSnapDriver_H
|
#define autoSnapDriver_H
|
||||||
|
|
||||||
|
#include "PackedBoolList.H"
|
||||||
#include "meshRefinement.H"
|
#include "meshRefinement.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(WM_THIRD_PARTY_DIR)/scotch_5.1/src/libscotch \
|
-I$(WM_THIRD_PARTY_DIR)/scotch_5.1/src/libscotch/lnInclude \
|
||||||
|
-I/usr/include/scotch \
|
||||||
-I../decompositionMethods/lnInclude
|
-I../decompositionMethods/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-lscotch
|
-lscotch \
|
||||||
|
-lscotcherrexit
|
||||||
|
|
|
@ -44,10 +44,10 @@ Foam::dynamicFvMesh::dynamicFvMesh(const IOobject& io)
|
||||||
Foam::dynamicFvMesh::dynamicFvMesh
|
Foam::dynamicFvMesh::dynamicFvMesh
|
||||||
(
|
(
|
||||||
const IOobject& io,
|
const IOobject& io,
|
||||||
const pointField& points,
|
const Xfer<pointField>& points,
|
||||||
const faceList& faces,
|
const Xfer<faceList>& faces,
|
||||||
const labelList& owner,
|
const Xfer<labelList>& allOwner,
|
||||||
const labelList& neighbour,
|
const Xfer<labelList>& allNeighbour,
|
||||||
const bool syncPar
|
const bool syncPar
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
@ -56,8 +56,8 @@ Foam::dynamicFvMesh::dynamicFvMesh
|
||||||
io,
|
io,
|
||||||
points,
|
points,
|
||||||
faces,
|
faces,
|
||||||
owner,
|
allOwner,
|
||||||
neighbour,
|
allNeighbour,
|
||||||
syncPar
|
syncPar
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
@ -66,9 +66,9 @@ Foam::dynamicFvMesh::dynamicFvMesh
|
||||||
Foam::dynamicFvMesh::dynamicFvMesh
|
Foam::dynamicFvMesh::dynamicFvMesh
|
||||||
(
|
(
|
||||||
const IOobject& io,
|
const IOobject& io,
|
||||||
const pointField& points,
|
const Xfer<pointField>& points,
|
||||||
const faceList& faces,
|
const Xfer<faceList>& faces,
|
||||||
const cellList& cells,
|
const Xfer<cellList>& cells,
|
||||||
const bool syncPar
|
const bool syncPar
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
|
|
@ -92,10 +92,10 @@ public:
|
||||||
dynamicFvMesh
|
dynamicFvMesh
|
||||||
(
|
(
|
||||||
const IOobject& io,
|
const IOobject& io,
|
||||||
const pointField& points,
|
const Xfer<pointField>& points,
|
||||||
const faceList& faces,
|
const Xfer<faceList>& faces,
|
||||||
const labelList& owner,
|
const Xfer<labelList>& allOwner,
|
||||||
const labelList& neighbour,
|
const Xfer<labelList>& allNeighbour,
|
||||||
const bool syncPar = true
|
const bool syncPar = true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -106,9 +106,9 @@ public:
|
||||||
dynamicFvMesh
|
dynamicFvMesh
|
||||||
(
|
(
|
||||||
const IOobject& io,
|
const IOobject& io,
|
||||||
const pointField& points,
|
const Xfer<pointField>& points,
|
||||||
const faceList& faces,
|
const Xfer<faceList>& faces,
|
||||||
const cellList& cells,
|
const Xfer<cellList>& cells,
|
||||||
const bool syncPar = true
|
const bool syncPar = true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ class tetMetric
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const tetMetric&);
|
void operator=(const tetMetric&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Typedef for tetrahedral metrics
|
// Typedef for tetrahedral metrics
|
||||||
|
@ -73,6 +74,7 @@ public:
|
||||||
const point& p3
|
const point& p3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Selector
|
// Selector
|
||||||
|
|
||||||
static tetMetricReturnType New
|
static tetMetricReturnType New
|
||||||
|
@ -81,6 +83,7 @@ public:
|
||||||
const word& metricName
|
const word& metricName
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Function Selectors
|
// Member Function Selectors
|
||||||
|
|
||||||
declareMemberFunctionSelectionTable
|
declareMemberFunctionSelectionTable
|
||||||
|
@ -105,6 +108,11 @@ public:
|
||||||
const point& p2,
|
const point& p2,
|
||||||
const point& p3
|
const point& p3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
virtual ~tetMetric()
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
|
@ -64,6 +64,7 @@ class Knupp
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const Knupp&);
|
void operator=(const Knupp&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
@ -76,6 +77,12 @@ class Knupp
|
||||||
const point& p2,
|
const point& p2,
|
||||||
const point& p3
|
const point& p3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
virtual ~Knupp()
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,6 +101,7 @@ class Dihedral
|
||||||
// Enumeration for tets
|
// Enumeration for tets
|
||||||
static label tetEnum[6][4];
|
static label tetEnum[6][4];
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
@ -106,6 +114,12 @@ class Dihedral
|
||||||
const point& p2,
|
const point& p2,
|
||||||
const point& p3
|
const point& p3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
virtual ~Dihedral()
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,6 +147,12 @@ class cubicMeanRatio
|
||||||
const point& p2,
|
const point& p2,
|
||||||
const point& p3
|
const point& p3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
virtual ~cubicMeanRatio()
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -148,6 +168,7 @@ class Frobenius
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const Frobenius&);
|
void operator=(const Frobenius&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
@ -160,6 +181,12 @@ class Frobenius
|
||||||
const point& p2,
|
const point& p2,
|
||||||
const point& p3
|
const point& p3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
virtual ~Frobenius()
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -175,6 +202,7 @@ class PGH
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const PGH&);
|
void operator=(const PGH&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
@ -187,6 +215,12 @@ class PGH
|
||||||
const point& p2,
|
const point& p2,
|
||||||
const point& p3
|
const point& p3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
virtual ~PGH()
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -202,6 +236,7 @@ class CSG
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const CSG&);
|
void operator=(const CSG&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
@ -214,6 +249,12 @@ class CSG
|
||||||
const point& p2,
|
const point& p2,
|
||||||
const point& p3
|
const point& p3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
virtual ~CSG()
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,6 @@ directTopoChange/boundaryMesh/boundaryMesh.C
|
||||||
directTopoChange/fvMeshDistribute/fvMeshDistribute.C
|
directTopoChange/fvMeshDistribute/fvMeshDistribute.C
|
||||||
|
|
||||||
|
|
||||||
directTopoChange/repatch/repatch.C
|
directTopoChange/repatchPolyTopoChanger/repatchPolyTopoChanger.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libdynamicMesh
|
LIB = $(FOAM_LIBBIN)/libdynamicMesh
|
||||||
|
|
|
@ -27,7 +27,7 @@ License
|
||||||
#include "boundaryMesh.H"
|
#include "boundaryMesh.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "repatch.H"
|
#include "repatchPolyTopoChanger.H"
|
||||||
#include "faceList.H"
|
#include "faceList.H"
|
||||||
#include "octree.H"
|
#include "octree.H"
|
||||||
#include "octreeDataFaceList.H"
|
#include "octreeDataFaceList.H"
|
||||||
|
@ -1232,8 +1232,8 @@ void Foam::boundaryMesh::patchify
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actually add new list of patches
|
// Actually add new list of patches
|
||||||
repatch polyMeshRepatcher(newMesh);
|
repatchPolyTopoChanger rep(newMesh);
|
||||||
polyMeshRepatcher.changePatches(newPatchPtrList);
|
rep.changePatches(newPatchPtrList);
|
||||||
|
|
||||||
|
|
||||||
// Pass2:
|
// Pass2:
|
||||||
|
@ -1289,11 +1289,11 @@ void Foam::boundaryMesh::patchify
|
||||||
|
|
||||||
forAll(pFaces, pFaceI)
|
forAll(pFaces, pFaceI)
|
||||||
{
|
{
|
||||||
polyMeshRepatcher.changePatchID(pFaces[pFaceI], newPatchI);
|
rep.changePatchID(pFaces[pFaceI], newPatchI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
polyMeshRepatcher.execute();
|
rep.repatch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -399,7 +399,7 @@ bool Foam::octreeDataFaceList::overlaps
|
||||||
const treeBoundBox& sampleBb
|
const treeBoundBox& sampleBb
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return sampleBb.intersects(allBb_[index]);
|
return sampleBb.overlaps(allBb_[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ SourceFiles
|
||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
#include "point.H"
|
#include "point.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
#include "labelHashSet.H"
|
#include "HashSet.H"
|
||||||
#include "typeInfo.H"
|
#include "typeInfo.H"
|
||||||
#include "edgeList.H"
|
#include "edgeList.H"
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ SourceFiles
|
||||||
|
|
||||||
#include "labelIOList.H"
|
#include "labelIOList.H"
|
||||||
#include "face.H"
|
#include "face.H"
|
||||||
#include "labelHashSet.H"
|
#include "HashSet.H"
|
||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
#include "primitivePatch.H"
|
#include "primitivePatch.H"
|
||||||
#include "removeFaces.H"
|
#include "removeFaces.H"
|
||||||
|
|
|
@ -46,7 +46,7 @@ SourceFiles
|
||||||
#include "typeInfo.H"
|
#include "typeInfo.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
#include "labelList.H"
|
#include "labelList.H"
|
||||||
#include "labelHashSet.H"
|
#include "HashSet.H"
|
||||||
#include "faceList.H"
|
#include "faceList.H"
|
||||||
#include "boolList.H"
|
#include "boolList.H"
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ SourceFiles
|
||||||
#define removeFaces_H
|
#define removeFaces_H
|
||||||
|
|
||||||
#include "Pstream.H"
|
#include "Pstream.H"
|
||||||
#include "labelHashSet.H"
|
#include "HashSet.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
#include "boolList.H"
|
#include "boolList.H"
|
||||||
#include "indirectPrimitivePatch.H"
|
#include "indirectPrimitivePatch.H"
|
||||||
|
|
|
@ -3036,11 +3036,10 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::directTopoChange::changeMesh
|
||||||
|
|
||||||
mesh.resetPrimitives
|
mesh.resetPrimitives
|
||||||
(
|
(
|
||||||
nActiveFaces_,
|
xferMove(renumberedMeshPoints),
|
||||||
renumberedMeshPoints,
|
faces_.xfer(),
|
||||||
faces_,
|
faceOwner_.xfer(),
|
||||||
faceOwner_,
|
faceNeighbour_.xfer(),
|
||||||
faceNeighbour_,
|
|
||||||
patchSizes,
|
patchSizes,
|
||||||
patchStarts,
|
patchStarts,
|
||||||
syncParallel
|
syncParallel
|
||||||
|
@ -3053,11 +3052,10 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::directTopoChange::changeMesh
|
||||||
// Set new points.
|
// Set new points.
|
||||||
mesh.resetPrimitives
|
mesh.resetPrimitives
|
||||||
(
|
(
|
||||||
nActiveFaces_,
|
xferMove(newPoints),
|
||||||
newPoints,
|
faces_.xfer(),
|
||||||
faces_,
|
faceOwner_.xfer(),
|
||||||
faceOwner_,
|
faceNeighbour_.xfer(),
|
||||||
faceNeighbour_,
|
|
||||||
patchSizes,
|
patchSizes,
|
||||||
patchStarts,
|
patchStarts,
|
||||||
syncParallel
|
syncParallel
|
||||||
|
@ -3299,10 +3297,10 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::directTopoChange::makeMesh
|
||||||
new fvMesh
|
new fvMesh
|
||||||
(
|
(
|
||||||
io,
|
io,
|
||||||
newPoints,
|
xferMove(newPoints),
|
||||||
faces_,
|
faces_.xfer(),
|
||||||
faceOwner_,
|
faceOwner_.xfer(),
|
||||||
faceNeighbour_
|
faceNeighbour_.xfer()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
fvMesh& newMesh = newMeshPtr();
|
fvMesh& newMesh = newMeshPtr();
|
||||||
|
|
|
@ -73,7 +73,7 @@ SourceFiles
|
||||||
#include "PtrList.H"
|
#include "PtrList.H"
|
||||||
#include "cellList.H"
|
#include "cellList.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
#include "labelHashSet.H"
|
#include "HashSet.H"
|
||||||
#include "mapPolyMesh.H"
|
#include "mapPolyMesh.H"
|
||||||
#include "CompactListList.H"
|
#include "CompactListList.H"
|
||||||
#include "PackedList.H"
|
#include "PackedList.H"
|
||||||
|
|
|
@ -0,0 +1,257 @@
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright held by original author
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "CompactListList_dev.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
Foam::CompactListList_dev<T, Container>::CompactListList_dev(const List<Container>& ll)
|
||||||
|
:
|
||||||
|
size_(ll.size()),
|
||||||
|
offsets_(ll.size()+1)
|
||||||
|
{
|
||||||
|
label sumSize = 0;
|
||||||
|
offsets_[0] = 0;
|
||||||
|
forAll(ll, i)
|
||||||
|
{
|
||||||
|
sumSize += ll[i].size();
|
||||||
|
offsets_[i+1] = sumSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_.setSize(sumSize);
|
||||||
|
|
||||||
|
label k = 0;
|
||||||
|
forAll(ll, i)
|
||||||
|
{
|
||||||
|
const Container& lli = ll[i];
|
||||||
|
|
||||||
|
forAll(lli, j)
|
||||||
|
{
|
||||||
|
m_[k++] = lli[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
Foam::CompactListList_dev<T, Container>::CompactListList_dev
|
||||||
|
(
|
||||||
|
const UList<label>& rowSizes
|
||||||
|
)
|
||||||
|
:
|
||||||
|
size_(rowSizes.size()),
|
||||||
|
offsets_(rowSizes.size()+1)
|
||||||
|
{
|
||||||
|
label sumSize = 0;
|
||||||
|
offsets_[0] = 0;
|
||||||
|
forAll(rowSizes, i)
|
||||||
|
{
|
||||||
|
sumSize += rowSizes[i];
|
||||||
|
offsets_[i+1] = sumSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_.setSize(sumSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
Foam::CompactListList_dev<T, Container>::CompactListList_dev
|
||||||
|
(
|
||||||
|
const UList<label>& rowSizes,
|
||||||
|
const T& t
|
||||||
|
)
|
||||||
|
:
|
||||||
|
size_(rowSizes.size()),
|
||||||
|
offsets_(rowSizes.size()+1)
|
||||||
|
{
|
||||||
|
label sumSize = 0;
|
||||||
|
offsets_[0] = 0;
|
||||||
|
forAll(rowSizes, i)
|
||||||
|
{
|
||||||
|
sumSize += rowSizes[i];
|
||||||
|
offsets_[i+1] = sumSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_.setSize(sumSize, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
Foam::CompactListList_dev<T, Container>::CompactListList_dev
|
||||||
|
(
|
||||||
|
const Xfer<CompactListList_dev<T, Container> >& lst
|
||||||
|
)
|
||||||
|
{
|
||||||
|
transfer(lst());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
Foam::CompactListList_dev<T, Container>::CompactListList_dev
|
||||||
|
(
|
||||||
|
CompactListList_dev<T, Container>& lst,
|
||||||
|
bool reUse
|
||||||
|
)
|
||||||
|
:
|
||||||
|
size_(lst.size()),
|
||||||
|
offsets_(lst.offsets_, reUse),
|
||||||
|
m_(lst.m_, reUse)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
void Foam::CompactListList_dev<T, Container>::setSize(const label nRows)
|
||||||
|
{
|
||||||
|
if (nRows == 0)
|
||||||
|
{
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
if (nRows < size())
|
||||||
|
{
|
||||||
|
size_ = nRows;
|
||||||
|
offsets_.setSize(nRows+1);
|
||||||
|
m_.setSize(offsets_[nRows]);
|
||||||
|
}
|
||||||
|
else if (nRows > size())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"CompactListList_dev<T, Container>::setSize(const label nRows)"
|
||||||
|
) << "Cannot be used to extend the list from " << offsets_.size()
|
||||||
|
<< " to " << nRows << nl
|
||||||
|
<< " Please use one of the other setSize member functions"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
void Foam::CompactListList_dev<T, Container>::setSize
|
||||||
|
(
|
||||||
|
const label nRows,
|
||||||
|
const label nData
|
||||||
|
)
|
||||||
|
{
|
||||||
|
size_ = nRows;
|
||||||
|
offsets_.setSize(nRows+1);
|
||||||
|
m_.setSize(nData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
void Foam::CompactListList_dev<T, Container>::setSize
|
||||||
|
(
|
||||||
|
const label nRows,
|
||||||
|
const label nData,
|
||||||
|
const T& t
|
||||||
|
)
|
||||||
|
{
|
||||||
|
size_ = nRows;
|
||||||
|
offsets_.setSize(nRows+1);
|
||||||
|
m_.setSize(nData, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
void Foam::CompactListList_dev<T, Container>::setSize(const UList<label>& rowSizes)
|
||||||
|
{
|
||||||
|
size_ = rowSizes.size();
|
||||||
|
offsets_.setSize(rowSizes.size()+1);
|
||||||
|
|
||||||
|
label sumSize = 0;
|
||||||
|
offsets_[0] = 0;
|
||||||
|
forAll(rowSizes, i)
|
||||||
|
{
|
||||||
|
sumSize += rowSizes[i];
|
||||||
|
offsets_[i+1] = sumSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_.setSize(sumSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
Foam::labelList Foam::CompactListList_dev<T, Container>::sizes() const
|
||||||
|
{
|
||||||
|
labelList rowSizes(size());
|
||||||
|
|
||||||
|
if (rowSizes.size() > 0)
|
||||||
|
{
|
||||||
|
forAll(rowSizes, i)
|
||||||
|
{
|
||||||
|
rowSizes[i] = offsets_[i+1] - offsets_[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rowSizes;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
void Foam::CompactListList_dev<T, Container>::clear()
|
||||||
|
{
|
||||||
|
size_ = 0;
|
||||||
|
offsets_.clear();
|
||||||
|
m_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
void Foam::CompactListList_dev<T, Container>::transfer
|
||||||
|
(
|
||||||
|
CompactListList_dev<T, Container>& a
|
||||||
|
)
|
||||||
|
{
|
||||||
|
size_ = a.size_;
|
||||||
|
offsets_.transfer(a.offsets_);
|
||||||
|
m_.transfer(a.m_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
Foam::List<Container> Foam::CompactListList_dev<T, Container>::operator()()
|
||||||
|
const
|
||||||
|
{
|
||||||
|
List<Container> ll(size());
|
||||||
|
|
||||||
|
forAll(ll, i)
|
||||||
|
{
|
||||||
|
ll[i] = Container(operator[](i));
|
||||||
|
}
|
||||||
|
|
||||||
|
return ll;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "CompactListList_devIO.C"
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,270 @@
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright held by original author
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::CompactListList_dev
|
||||||
|
|
||||||
|
Description
|
||||||
|
A packed storage unstructured matrix of objects of type \<T\>
|
||||||
|
using an offset table for access.
|
||||||
|
|
||||||
|
The offset table is the size of the number of rows+1
|
||||||
|
whose elements are the
|
||||||
|
accumulated sizes of the rows, i.e.
|
||||||
|
- offset[i] gives the index of first element of row i
|
||||||
|
- offset[i+1] - offset[i] is the number of elements in row i
|
||||||
|
|
||||||
|
Storage is allocated on free-store during construction.
|
||||||
|
|
||||||
|
As a special case a null-contructed CompactListList_dev has an empty
|
||||||
|
offsets_ (instead of size 1).
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
CompactListList_dev.C
|
||||||
|
CompactListList_devI.H
|
||||||
|
CompactListList_devIO.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef CompactListListDev_H
|
||||||
|
#define CompactListListDev_H
|
||||||
|
|
||||||
|
#include "labelList.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward declaration of friend functions and operators
|
||||||
|
|
||||||
|
template<class T, class Container> class CompactListList_dev;
|
||||||
|
|
||||||
|
template<class T, class Container> Istream& operator>>
|
||||||
|
(
|
||||||
|
Istream&,
|
||||||
|
CompactListList_dev<T, Container>&
|
||||||
|
);
|
||||||
|
template<class T, class Container> Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const CompactListList_dev<T, Container>&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class CompactListList_dev Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class T, class Container = List<T> >
|
||||||
|
class CompactListList_dev
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
label size_;
|
||||||
|
|
||||||
|
//- Offset table
|
||||||
|
List<label> offsets_;
|
||||||
|
|
||||||
|
//- Packed matrix of data
|
||||||
|
List<T> m_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Static Member Functions
|
||||||
|
|
||||||
|
//- Return a null CompactListList_dev
|
||||||
|
inline static const CompactListList_dev<T, Container>& null();
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Null constructor.
|
||||||
|
inline CompactListList_dev();
|
||||||
|
|
||||||
|
//- Construct by converting given List<List<T> >
|
||||||
|
explicit CompactListList_dev(const List<Container>&);
|
||||||
|
|
||||||
|
//- Construct given size of offset table (number of rows)
|
||||||
|
// and number of data.
|
||||||
|
inline CompactListList_dev(const label nRows, const label nData);
|
||||||
|
|
||||||
|
//- Construct given size of offset table (number of rows),
|
||||||
|
// the number of data and a value for all elements.
|
||||||
|
inline CompactListList_dev(const label nRows, const label nData, const T&);
|
||||||
|
|
||||||
|
//- Construct given list of row-sizes.
|
||||||
|
explicit CompactListList_dev(const UList<label>& rowSizes);
|
||||||
|
|
||||||
|
//- Construct given list of row-sizes
|
||||||
|
CompactListList_dev(const UList<label>& rowSizes, const T&);
|
||||||
|
|
||||||
|
//- Construct by transferring the parameter contents
|
||||||
|
explicit CompactListList_dev(const Xfer<CompactListList_dev<T, Container> >&);
|
||||||
|
|
||||||
|
//- Construct as copy or re-use as specified.
|
||||||
|
CompactListList_dev(CompactListList_dev<T, Container>&, bool reUse);
|
||||||
|
|
||||||
|
//- Construct from Istream.
|
||||||
|
CompactListList_dev(Istream&);
|
||||||
|
|
||||||
|
//- Clone
|
||||||
|
inline autoPtr<CompactListList_dev<T, Container> > clone() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return the primary size, i.e. the number of rows
|
||||||
|
inline label size() const;
|
||||||
|
|
||||||
|
//- Return true if the number of rows is zero
|
||||||
|
inline bool empty() const;
|
||||||
|
|
||||||
|
//- Return the offset table (= size()+1)
|
||||||
|
inline const List<label>& offsets() const;
|
||||||
|
|
||||||
|
//- Return non-const access to the offset table
|
||||||
|
inline List<label>& offsets();
|
||||||
|
|
||||||
|
//- Return the packed matrix of data
|
||||||
|
inline const List<T>& m() const;
|
||||||
|
|
||||||
|
//- Return non-const access to the packed matrix of data
|
||||||
|
inline List<T>& m();
|
||||||
|
|
||||||
|
|
||||||
|
// Edit
|
||||||
|
|
||||||
|
//- Reset size of CompactListList_dev.
|
||||||
|
// This form only allows contraction of the CompactListList_dev.
|
||||||
|
void setSize(const label nRows);
|
||||||
|
|
||||||
|
//- Reset size of CompactListList_dev.
|
||||||
|
void setSize(const label nRows, const label nData);
|
||||||
|
|
||||||
|
//- Reset sizes of CompactListList_dev and value for new elements.
|
||||||
|
void setSize(const label nRows, const label nData, const T&);
|
||||||
|
|
||||||
|
//- Reset size of CompactListList_dev.
|
||||||
|
void setSize(const UList<label>& rowSizes);
|
||||||
|
|
||||||
|
//- Reset size of CompactListList_dev.
|
||||||
|
// This form only allows contraction of the CompactListList_dev.
|
||||||
|
inline void resize(const label nRows);
|
||||||
|
|
||||||
|
//- Reset size of CompactListList_dev.
|
||||||
|
inline void resize(const label nRows, const label nData);
|
||||||
|
|
||||||
|
//- Reset sizes of CompactListList_dev and value for new elements.
|
||||||
|
inline void resize(const label nRows, const label nData, const T&);
|
||||||
|
|
||||||
|
//- Reset size of CompactListList_dev.
|
||||||
|
inline void resize(const UList<label>& rowSizes);
|
||||||
|
|
||||||
|
//- Clear the CompactListList_dev, i.e. set sizes to zero.
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
//- Return sizes (to be used e.g. for construction)
|
||||||
|
labelList sizes() const;
|
||||||
|
|
||||||
|
//- Transfer the contents of the argument CompactListList_dev
|
||||||
|
// into this CompactListList_dev and annul the argument list.
|
||||||
|
void transfer(CompactListList_dev<T, Container>&);
|
||||||
|
|
||||||
|
//- Transfer the contents to the Xfer container
|
||||||
|
inline Xfer<CompactListList_dev<T, Container> > xfer();
|
||||||
|
|
||||||
|
// Other
|
||||||
|
|
||||||
|
//- Return index into m
|
||||||
|
inline label index(const label row, const label col) const;
|
||||||
|
|
||||||
|
//- Get row for index into m.
|
||||||
|
inline label whichRow(const label index) const;
|
||||||
|
|
||||||
|
//- Get column index (j) given above row
|
||||||
|
inline label whichColumn(const label row, const label index) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member operators
|
||||||
|
|
||||||
|
//- Return subscript-checked row as UList.
|
||||||
|
inline UList<T> operator[](const label i);
|
||||||
|
|
||||||
|
//- Return const subscript-checked row as UList.
|
||||||
|
inline const UList<T> operator[](const label i) const;
|
||||||
|
|
||||||
|
//- Return subscript-checked element.
|
||||||
|
inline T& operator()(const label i, const label j);
|
||||||
|
|
||||||
|
//- Return const subscript-checked element.
|
||||||
|
inline const T& operator()(const label i, const label j) const;
|
||||||
|
|
||||||
|
//- Return as List<Container>
|
||||||
|
List<Container> operator()() const;
|
||||||
|
|
||||||
|
//- Assignment of all entries to the given value
|
||||||
|
inline void operator=(const T&);
|
||||||
|
|
||||||
|
|
||||||
|
// Istream operator
|
||||||
|
|
||||||
|
//- Read CompactListList_dev from Istream, discarding contents
|
||||||
|
// of existing CompactListList_dev.
|
||||||
|
friend Istream& operator>> <T, Container>
|
||||||
|
(
|
||||||
|
Istream&,
|
||||||
|
CompactListList_dev<T, Container>&
|
||||||
|
);
|
||||||
|
|
||||||
|
// Write CompactListList_dev to Ostream.
|
||||||
|
friend Ostream& operator<< <T, Container>
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const CompactListList_dev<T, Container>&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
# include "CompactListList_devI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "CompactListList_dev.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,276 @@
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright held by original author
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "ListOps.H"
|
||||||
|
#include "SubList.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::CompactListList_dev<T, Container>::CompactListList_dev()
|
||||||
|
:
|
||||||
|
size_(0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::CompactListList_dev<T, Container>::CompactListList_dev
|
||||||
|
(
|
||||||
|
const label nRows,
|
||||||
|
const label nData
|
||||||
|
)
|
||||||
|
:
|
||||||
|
size_(nRows),
|
||||||
|
offsets_(nRows+1, 0),
|
||||||
|
m_(nData)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::CompactListList_dev<T, Container>::CompactListList_dev
|
||||||
|
(
|
||||||
|
const label nRows,
|
||||||
|
const label nData,
|
||||||
|
const T& t
|
||||||
|
)
|
||||||
|
:
|
||||||
|
size_(nRows),
|
||||||
|
offsets_(nRows+1, 0),
|
||||||
|
m_(nData, t)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::autoPtr<Foam::CompactListList_dev<T, Container> >
|
||||||
|
Foam::CompactListList_dev<T, Container>::clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<CompactListList_dev<T, Container> >
|
||||||
|
(
|
||||||
|
new CompactListList_dev<T, Container>(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline const Foam::CompactListList_dev<T, Container>&
|
||||||
|
Foam::CompactListList_dev<T, Container>::null()
|
||||||
|
{
|
||||||
|
return *reinterpret_cast< CompactListList_dev<T, Container>* >(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::label Foam::CompactListList_dev<T, Container>::size() const
|
||||||
|
{
|
||||||
|
return size_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline bool Foam::CompactListList_dev<T, Container>::empty() const
|
||||||
|
{
|
||||||
|
return !size_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline const Foam::List<Foam::label>&
|
||||||
|
Foam::CompactListList_dev<T, Container>::offsets() const
|
||||||
|
{
|
||||||
|
return offsets_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::List<Foam::label>& Foam::CompactListList_dev<T, Container>::offsets()
|
||||||
|
{
|
||||||
|
return offsets_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline const Foam::List<T>& Foam::CompactListList_dev<T, Container>::m()
|
||||||
|
const
|
||||||
|
{
|
||||||
|
return m_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::List<T>& Foam::CompactListList_dev<T, Container>::m()
|
||||||
|
{
|
||||||
|
return m_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::label Foam::CompactListList_dev<T, Container>::index
|
||||||
|
(
|
||||||
|
const label i,
|
||||||
|
const label j
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return offsets_[i] + j;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::label Foam::CompactListList_dev<T, Container>::whichRow(const label i)
|
||||||
|
const
|
||||||
|
{
|
||||||
|
if (i < 0 || i >= m_.size())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"CompactListList_dev<T, Container>::whichRow(const label) const"
|
||||||
|
) << "Index " << i << " outside 0.." << m_.size()
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return findLower(offsets_, i+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::label Foam::CompactListList_dev<T, Container>::whichColumn
|
||||||
|
(
|
||||||
|
const label row,
|
||||||
|
const label i
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return i - index(row, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::Xfer<Foam::CompactListList_dev<T, Container> >
|
||||||
|
Foam::CompactListList_dev<T, Container>::xfer()
|
||||||
|
{
|
||||||
|
return xferMove(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline void Foam::CompactListList_dev<T, Container>::resize(const label nRows)
|
||||||
|
{
|
||||||
|
this->setSize(nRows);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline void Foam::CompactListList_dev<T, Container>::resize
|
||||||
|
(
|
||||||
|
const label nRows,
|
||||||
|
const label nData
|
||||||
|
)
|
||||||
|
{
|
||||||
|
this->setSize(nRows, nData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline void Foam::CompactListList_dev<T, Container>::resize
|
||||||
|
(
|
||||||
|
const label nRows,
|
||||||
|
const label nData,
|
||||||
|
const T& t
|
||||||
|
)
|
||||||
|
{
|
||||||
|
this->setSize(nRows, nData, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline void Foam::CompactListList_dev<T, Container>::resize
|
||||||
|
(
|
||||||
|
const UList<label>& rowSizes
|
||||||
|
)
|
||||||
|
{
|
||||||
|
this->setSize(rowSizes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline Foam::UList<T> Foam::CompactListList_dev<T, Container>::operator[]
|
||||||
|
(
|
||||||
|
const label i
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label start = offsets_[i];
|
||||||
|
return UList<T>((m_.size() ? &m_[start] : NULL), offsets_[i+1] - start);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline const Foam::UList<T>
|
||||||
|
Foam::CompactListList_dev<T, Container>::operator[]
|
||||||
|
(
|
||||||
|
const label i
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
label start = offsets_[i];
|
||||||
|
return UList<T>
|
||||||
|
(
|
||||||
|
(m_.size() ? const_cast<T*>(&m_[start]) : NULL),
|
||||||
|
offsets_[i+1] - start
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline T& Foam::CompactListList_dev<T, Container>::operator()
|
||||||
|
(
|
||||||
|
const label i,
|
||||||
|
const label j
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return m_[index(i, j)];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline const T& Foam::CompactListList_dev<T, Container>::operator()
|
||||||
|
(
|
||||||
|
const label i,
|
||||||
|
const label j
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return m_[index(i, j)];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
inline void Foam::CompactListList_dev<T, Container>::operator=(const T& t)
|
||||||
|
{
|
||||||
|
m_ = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -24,27 +24,41 @@ License
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "bufferedAccumulator.H"
|
#include "CompactListList_dev.H"
|
||||||
#include "IOstreams.H"
|
#include "Istream.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
Foam::CompactListList_dev<T, Container>::CompactListList_dev(Istream& is)
|
||||||
|
{
|
||||||
|
operator>>(is, *this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class T, class Container>
|
||||||
Foam::Ostream&
|
Foam::Istream& Foam::operator>>(Istream& is, CompactListList_dev<T, Container>& lst)
|
||||||
Foam::operator<<(Ostream& os, const bufferedAccumulator<Type>& bA)
|
|
||||||
{
|
{
|
||||||
|
is >> lst.offsets_ >> lst.m_;
|
||||||
|
// Note: empty list gets output as two empty lists
|
||||||
|
if (lst.offsets_.size() == 0)
|
||||||
|
{
|
||||||
|
lst.size_ = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lst.size_ = lst.offsets_.size()-1;
|
||||||
|
}
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
os<< bA.averagesTaken_
|
|
||||||
<< static_cast<const List< Field<Type> >&>(bA)
|
|
||||||
<< bA.bufferOffsets();
|
|
||||||
|
|
||||||
// Check state of Ostream
|
|
||||||
os.check
|
|
||||||
(
|
|
||||||
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
|
|
||||||
"const Foam::bufferedAccumulator&)"
|
|
||||||
);
|
|
||||||
|
|
||||||
|
template<class T, class Container>
|
||||||
|
Foam::Ostream& Foam::operator<<(Ostream& os, const CompactListList_dev<T, Container>& lst)
|
||||||
|
{
|
||||||
|
os << lst.offsets_ << lst.m_;
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -54,6 +54,7 @@ SourceFiles
|
||||||
#define fvMeshDistribute_H
|
#define fvMeshDistribute_H
|
||||||
|
|
||||||
#include "Field.H"
|
#include "Field.H"
|
||||||
|
//#include "uLabel.H"
|
||||||
#include "fvMeshSubset.H"
|
#include "fvMeshSubset.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
@ -81,58 +82,8 @@ class fvMeshDistribute
|
||||||
const scalar mergeTol_;
|
const scalar mergeTol_;
|
||||||
|
|
||||||
|
|
||||||
// Private classes
|
|
||||||
|
|
||||||
//- Check words are the same. Used in patch type checking of similarly
|
|
||||||
// named patches.
|
|
||||||
class checkEqualType
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
void operator()(word& x, const word& y) const
|
|
||||||
{
|
|
||||||
if (x != y)
|
|
||||||
{
|
|
||||||
FatalErrorIn("checkEqualType()(word&, const word&) const")
|
|
||||||
<< "Patch type " << x << " possibly on processor "
|
|
||||||
<< Pstream::myProcNo()
|
|
||||||
<< " does not equal patch type " << y
|
|
||||||
<< " on some other processor." << nl
|
|
||||||
<< "Please check similarly named patches for"
|
|
||||||
<< " having exactly the same type."
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Hash labelPair. Note non-commutative since p[0] is face, p[1] is
|
|
||||||
// processor.
|
|
||||||
class labelPairHash
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
labelPairHash()
|
|
||||||
{}
|
|
||||||
|
|
||||||
label operator()(const labelPair& p) const
|
|
||||||
{
|
|
||||||
return label(p[0]*p[0]+p[0]+p[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
label operator()(const labelPair& p, const label tableSize) const
|
|
||||||
{
|
|
||||||
return mag(operator()(p)) % tableSize;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Given distribution work out a communication schedule. Is list
|
|
||||||
// of pairs. First element of pair is send processor, second is
|
|
||||||
// receive processor.
|
|
||||||
//static List<labelPair> getSchedule(const labelList&);
|
|
||||||
|
|
||||||
//- Find indices with value
|
//- Find indices with value
|
||||||
static labelList select
|
static labelList select
|
||||||
(
|
(
|
||||||
|
@ -142,7 +93,7 @@ class fvMeshDistribute
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Check all procs have same names and in exactly same order.
|
//- Check all procs have same names and in exactly same order.
|
||||||
static void checkEqualWordList(const wordList&);
|
static void checkEqualWordList(const string&, const wordList&);
|
||||||
|
|
||||||
//- Merge wordlists over all processors
|
//- Merge wordlists over all processors
|
||||||
static wordList mergeWordList(const wordList&);
|
static wordList mergeWordList(const wordList&);
|
||||||
|
@ -183,10 +134,9 @@ class fvMeshDistribute
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Init patch fields of certain type
|
//- Init patch fields of certain type
|
||||||
template<class GeoField>
|
template<class GeoField, class PatchFieldType>
|
||||||
void initPatchFields
|
void initPatchFields
|
||||||
(
|
(
|
||||||
const word& patchFieldType,
|
|
||||||
const typename GeoField::value_type& initVal
|
const typename GeoField::value_type& initVal
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -308,7 +258,8 @@ class fvMeshDistribute
|
||||||
const wordList& cellZoneNames,
|
const wordList& cellZoneNames,
|
||||||
const labelList& sourceFace,
|
const labelList& sourceFace,
|
||||||
const labelList& sourceProc,
|
const labelList& sourceProc,
|
||||||
const labelList& sourceNewProc
|
const labelList& sourceNewProc,
|
||||||
|
OSstream& toDomain
|
||||||
);
|
);
|
||||||
//- Send subset of fields
|
//- Send subset of fields
|
||||||
template<class GeoField>
|
template<class GeoField>
|
||||||
|
@ -316,7 +267,8 @@ class fvMeshDistribute
|
||||||
(
|
(
|
||||||
const label domain,
|
const label domain,
|
||||||
const wordList& fieldNames,
|
const wordList& fieldNames,
|
||||||
const fvMeshSubset&
|
const fvMeshSubset&,
|
||||||
|
OSstream& toNbr
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Receive mesh. Opposite of sendMesh
|
//- Receive mesh. Opposite of sendMesh
|
||||||
|
@ -329,7 +281,8 @@ class fvMeshDistribute
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
labelList& domainSourceFace,
|
labelList& domainSourceFace,
|
||||||
labelList& domainSourceProc,
|
labelList& domainSourceProc,
|
||||||
labelList& domainSourceNewProc
|
labelList& domainSourceNewProc,
|
||||||
|
ISstream& fromNbr
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Receive fields. Opposite of sendFields
|
//- Receive fields. Opposite of sendFields
|
||||||
|
@ -339,7 +292,17 @@ class fvMeshDistribute
|
||||||
const label domain,
|
const label domain,
|
||||||
const wordList& fieldNames,
|
const wordList& fieldNames,
|
||||||
fvMesh&,
|
fvMesh&,
|
||||||
PtrList<GeoField>&
|
PtrList<GeoField>&,
|
||||||
|
const dictionary& fieldDicts
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Do parallel exchange
|
||||||
|
template <class Container, class T>
|
||||||
|
static void exchange
|
||||||
|
(
|
||||||
|
const List<Container >& sendBufs,
|
||||||
|
List<Container >& recvBufs,
|
||||||
|
labelListList& sizes
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
|
|
|
@ -25,9 +25,133 @@ License
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "mapPolyMesh.H"
|
#include "mapPolyMesh.H"
|
||||||
|
#include "PstreamCombineReduceOps.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//- combineReduce operator for lists. Used for counting.
|
||||||
|
class listEq
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void operator()(T& x, const T& y) const
|
||||||
|
{
|
||||||
|
forAll(y, i)
|
||||||
|
{
|
||||||
|
if (y[i].size())
|
||||||
|
{
|
||||||
|
x[i] = y[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <class Container, class T>
|
||||||
|
void Foam::fvMeshDistribute::exchange
|
||||||
|
(
|
||||||
|
const List<Container >& sendBufs,
|
||||||
|
List<Container >& recvBufs,
|
||||||
|
labelListList& sizes
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
if (!contiguous<T>())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"Pstream::exchange(..)"
|
||||||
|
) << "Continuous data only." << Foam::abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sendBufs.size() != Pstream::nProcs())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"Pstream::exchange(..)"
|
||||||
|
) << "Size of list:" << sendBufs.size()
|
||||||
|
<< " does not equal the number of processors:"
|
||||||
|
<< Pstream::nProcs()
|
||||||
|
<< Foam::abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
sizes.setSize(Pstream::nProcs());
|
||||||
|
labelList& nsTransPs = sizes[Pstream::myProcNo()];
|
||||||
|
nsTransPs.setSize(Pstream::nProcs());
|
||||||
|
|
||||||
|
forAll(sendBufs, procI)
|
||||||
|
{
|
||||||
|
nsTransPs[procI] = sendBufs[procI].size();
|
||||||
|
}
|
||||||
|
|
||||||
|
Foam::combineReduce(sizes, listEq());
|
||||||
|
|
||||||
|
|
||||||
|
// Set up receives
|
||||||
|
// ~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
recvBufs.setSize(sendBufs.size());
|
||||||
|
forAll(sizes, procI)
|
||||||
|
{
|
||||||
|
label nRecv = sizes[procI][Pstream::myProcNo()];
|
||||||
|
|
||||||
|
if (procI != Pstream::myProcNo() && nRecv > 0)
|
||||||
|
{
|
||||||
|
recvBufs[procI].setSize(nRecv);
|
||||||
|
IPstream::read
|
||||||
|
(
|
||||||
|
Pstream::nonBlocking,
|
||||||
|
procI,
|
||||||
|
reinterpret_cast<char*>(recvBufs[procI].begin()),
|
||||||
|
nRecv*sizeof(T)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Set up sends
|
||||||
|
// ~~~~~~~~~~~~
|
||||||
|
|
||||||
|
forAll(sendBufs, procI)
|
||||||
|
{
|
||||||
|
if (procI != Pstream::myProcNo() && sendBufs[procI].size() > 0)
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
!OPstream::write
|
||||||
|
(
|
||||||
|
Pstream::nonBlocking,
|
||||||
|
procI,
|
||||||
|
reinterpret_cast<const char*>(sendBufs[procI].begin()),
|
||||||
|
sendBufs[procI].size()*sizeof(T)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalErrorIn("Pstream::exchange(..)")
|
||||||
|
<< "Cannot send outgoing message. "
|
||||||
|
<< "to:" << procI << " nBytes:"
|
||||||
|
<< label(sendBufs[procI].size()*sizeof(T))
|
||||||
|
<< Foam::abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Wait for all to finish
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
IPstream::waitRequests();
|
||||||
|
OPstream::waitRequests();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do myself
|
||||||
|
recvBufs[Pstream::myProcNo()] = sendBufs[Pstream::myProcNo()];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class GeoField>
|
template<class GeoField>
|
||||||
void Foam::fvMeshDistribute::printFieldInfo(const fvMesh& mesh)
|
void Foam::fvMeshDistribute::printFieldInfo(const fvMesh& mesh)
|
||||||
{
|
{
|
||||||
|
@ -184,7 +308,7 @@ void Foam::fvMeshDistribute::mapBoundaryFields
|
||||||
|
|
||||||
if (flds.size() != oldBflds.size())
|
if (flds.size() != oldBflds.size())
|
||||||
{
|
{
|
||||||
FatalErrorIn("fvMeshDistribute::mapBoundaryFields") << "problem"
|
FatalErrorIn("fvMeshDistribute::mapBoundaryFields(..)") << "problem"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,10 +359,9 @@ void Foam::fvMeshDistribute::mapBoundaryFields
|
||||||
|
|
||||||
|
|
||||||
// Init patch fields of certain type
|
// Init patch fields of certain type
|
||||||
template<class GeoField>
|
template<class GeoField, class PatchFieldType>
|
||||||
void Foam::fvMeshDistribute::initPatchFields
|
void Foam::fvMeshDistribute::initPatchFields
|
||||||
(
|
(
|
||||||
const word& patchFieldType,
|
|
||||||
const typename GeoField::value_type& initVal
|
const typename GeoField::value_type& initVal
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -264,7 +387,7 @@ void Foam::fvMeshDistribute::initPatchFields
|
||||||
|
|
||||||
forAll(bfld, patchI)
|
forAll(bfld, patchI)
|
||||||
{
|
{
|
||||||
if (bfld[patchI].type() == patchFieldType)
|
if (isA<PatchFieldType>(bfld[patchI]))
|
||||||
{
|
{
|
||||||
bfld[patchI] == initVal;
|
bfld[patchI] == initVal;
|
||||||
}
|
}
|
||||||
|
@ -274,19 +397,40 @@ void Foam::fvMeshDistribute::initPatchFields
|
||||||
|
|
||||||
|
|
||||||
// Send fields. Note order supplied so we can receive in exactly the same order.
|
// Send fields. Note order supplied so we can receive in exactly the same order.
|
||||||
|
// Note that field gets written as entry in dictionary so we
|
||||||
|
// can construct from subdictionary.
|
||||||
|
// (since otherwise the reading as-a-dictionary mixes up entries from
|
||||||
|
// consecutive fields)
|
||||||
|
// The dictionary constructed is:
|
||||||
|
// volScalarField
|
||||||
|
// {
|
||||||
|
// p {internalField ..; boundaryField ..;}
|
||||||
|
// k {internalField ..; boundaryField ..;}
|
||||||
|
// }
|
||||||
|
// volVectorField
|
||||||
|
// {
|
||||||
|
// U {internalField ... }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// volVectorField {U {internalField ..; boundaryField ..;}}
|
||||||
|
//
|
||||||
template<class GeoField>
|
template<class GeoField>
|
||||||
void Foam::fvMeshDistribute::sendFields
|
void Foam::fvMeshDistribute::sendFields
|
||||||
(
|
(
|
||||||
const label domain,
|
const label domain,
|
||||||
const wordList& fieldNames,
|
const wordList& fieldNames,
|
||||||
const fvMeshSubset& subsetter
|
const fvMeshSubset& subsetter,
|
||||||
|
OSstream& toNbr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
toNbr << GeoField::typeName << token::NL << token::BEGIN_BLOCK << token::NL;
|
||||||
forAll(fieldNames, i)
|
forAll(fieldNames, i)
|
||||||
{
|
{
|
||||||
//Pout<< "Subsetting field " << fieldNames[i]
|
if (debug)
|
||||||
// << " for domain:" << domain
|
{
|
||||||
// << endl;
|
Pout<< "Subsetting field " << fieldNames[i]
|
||||||
|
<< " for domain:" << domain << endl;
|
||||||
|
}
|
||||||
|
|
||||||
// Send all fieldNames. This has to be exactly the same set as is
|
// Send all fieldNames. This has to be exactly the same set as is
|
||||||
// being received!
|
// being received!
|
||||||
|
@ -295,10 +439,12 @@ void Foam::fvMeshDistribute::sendFields
|
||||||
|
|
||||||
tmp<GeoField> tsubfld = subsetter.interpolate(fld);
|
tmp<GeoField> tsubfld = subsetter.interpolate(fld);
|
||||||
|
|
||||||
// Send
|
toNbr
|
||||||
OPstream toNbr(Pstream::blocking, domain);
|
<< fieldNames[i] << token::NL << token::BEGIN_BLOCK
|
||||||
toNbr << tsubfld();
|
<< tsubfld
|
||||||
|
<< token::NL << token::END_BLOCK << token::NL;
|
||||||
}
|
}
|
||||||
|
toNbr << token::END_BLOCK << token::NL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -309,18 +455,25 @@ void Foam::fvMeshDistribute::receiveFields
|
||||||
const label domain,
|
const label domain,
|
||||||
const wordList& fieldNames,
|
const wordList& fieldNames,
|
||||||
fvMesh& mesh,
|
fvMesh& mesh,
|
||||||
PtrList<GeoField>& fields
|
PtrList<GeoField>& fields,
|
||||||
|
const dictionary& fieldDicts
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "Receiving fields " << fieldNames
|
||||||
|
<< " from domain:" << domain << endl;
|
||||||
|
}
|
||||||
|
|
||||||
fields.setSize(fieldNames.size());
|
fields.setSize(fieldNames.size());
|
||||||
|
|
||||||
forAll(fieldNames, i)
|
forAll(fieldNames, i)
|
||||||
{
|
{
|
||||||
//Pout<< "Receiving field " << fieldNames[i]
|
if (debug)
|
||||||
// << " from domain:" << domain
|
{
|
||||||
// << endl;
|
Pout<< "Constructing field " << fieldNames[i]
|
||||||
|
<< " from domain:" << domain << endl;
|
||||||
IPstream fromNbr(Pstream::blocking, domain);
|
}
|
||||||
|
|
||||||
fields.set
|
fields.set
|
||||||
(
|
(
|
||||||
|
@ -336,7 +489,7 @@ void Foam::fvMeshDistribute::receiveFields
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
fromNbr
|
fieldDicts.subDict(fieldNames[i])
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1396,10 +1396,10 @@ Foam::autoPtr<Foam::polyMesh> Foam::polyMeshAdder::add
|
||||||
new polyMesh
|
new polyMesh
|
||||||
(
|
(
|
||||||
io,
|
io,
|
||||||
allPoints,
|
xferMove(allPoints),
|
||||||
allFaces,
|
xferMove(allFaces),
|
||||||
faceOwner,
|
xferMove(faceOwner),
|
||||||
faceNeighbour
|
xferMove(faceNeighbour)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
polyMesh& mesh = tmesh();
|
polyMesh& mesh = tmesh();
|
||||||
|
@ -1700,11 +1700,10 @@ Foam::autoPtr<Foam::mapAddedPolyMesh> Foam::polyMeshAdder::add
|
||||||
mesh0.resetMotion(); // delete any oldPoints.
|
mesh0.resetMotion(); // delete any oldPoints.
|
||||||
mesh0.resetPrimitives
|
mesh0.resetPrimitives
|
||||||
(
|
(
|
||||||
allFaces.size(),
|
xferMove(allPoints),
|
||||||
allPoints,
|
xferMove(allFaces),
|
||||||
allFaces,
|
xferMove(faceOwner),
|
||||||
faceOwner,
|
xferMove(faceNeighbour),
|
||||||
faceNeighbour,
|
|
||||||
patchSizes, // size
|
patchSizes, // size
|
||||||
patchStarts, // patchstarts
|
patchStarts, // patchstarts
|
||||||
validBoundary // boundary valid?
|
validBoundary // boundary valid?
|
||||||
|
|
|
@ -31,7 +31,7 @@ License
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "SortableList.H"
|
#include "SortableList.H"
|
||||||
#include "triSurfaceTools.H"
|
#include "triSurfaceTools.H"
|
||||||
#include "labelHashSet.H"
|
#include "HashSet.H"
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
#include "transform.H"
|
#include "transform.H"
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ Description
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "repatchPolyTopoChanger.H"
|
#include "repatchPolyTopoChanger.H"
|
||||||
#include "directTopoChanger.H"
|
#include "directTopoChange.H"
|
||||||
#include "mapPolyMesh.H"
|
#include "mapPolyMesh.H"
|
||||||
#include "polyModifyFace.H"
|
#include "polyModifyFace.H"
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ Foam::labelHashSet Foam::motionSmoother::getPoints
|
||||||
// Smooth on selected points (usually patch points)
|
// Smooth on selected points (usually patch points)
|
||||||
void Foam::motionSmoother::minSmooth
|
void Foam::motionSmoother::minSmooth
|
||||||
(
|
(
|
||||||
const PackedList<1>& isAffectedPoint,
|
const PackedBoolList& isAffectedPoint,
|
||||||
const labelList& meshPoints,
|
const labelList& meshPoints,
|
||||||
const pointScalarField& fld,
|
const pointScalarField& fld,
|
||||||
pointScalarField& newFld
|
pointScalarField& newFld
|
||||||
|
@ -241,7 +241,7 @@ void Foam::motionSmoother::minSmooth
|
||||||
// Smooth on all internal points
|
// Smooth on all internal points
|
||||||
void Foam::motionSmoother::minSmooth
|
void Foam::motionSmoother::minSmooth
|
||||||
(
|
(
|
||||||
const PackedList<1>& isAffectedPoint,
|
const PackedBoolList& isAffectedPoint,
|
||||||
const pointScalarField& fld,
|
const pointScalarField& fld,
|
||||||
pointScalarField& newFld
|
pointScalarField& newFld
|
||||||
) const
|
) const
|
||||||
|
@ -324,7 +324,7 @@ void Foam::motionSmoother::getAffectedFacesAndPoints
|
||||||
const faceSet& wrongFaces,
|
const faceSet& wrongFaces,
|
||||||
|
|
||||||
labelList& affectedFaces,
|
labelList& affectedFaces,
|
||||||
PackedList<1>& isAffectedPoint
|
PackedBoolList& isAffectedPoint
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
isAffectedPoint.setSize(mesh_.nPoints());
|
isAffectedPoint.setSize(mesh_.nPoints());
|
||||||
|
@ -348,7 +348,7 @@ void Foam::motionSmoother::getAffectedFacesAndPoints
|
||||||
|
|
||||||
forAllConstIter(pointSet, nbrPoints, iter)
|
forAllConstIter(pointSet, nbrPoints, iter)
|
||||||
{
|
{
|
||||||
const labelList& pCells = mesh_.pointCells()[iter.key()];
|
const labelList& pCells = mesh_.pointCells(iter.key());
|
||||||
|
|
||||||
forAll(pCells, pCellI)
|
forAll(pCells, pCellI)
|
||||||
{
|
{
|
||||||
|
@ -507,6 +507,12 @@ const Foam::labelList& Foam::motionSmoother::adaptPatchIDs() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::dictionary& Foam::motionSmoother::paramDict() const
|
||||||
|
{
|
||||||
|
return paramDict_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::pointVectorField& Foam::motionSmoother::displacement()
|
Foam::pointVectorField& Foam::motionSmoother::displacement()
|
||||||
{
|
{
|
||||||
return displacement_;
|
return displacement_;
|
||||||
|
@ -779,15 +785,13 @@ Foam::tmp<Foam::scalarField> Foam::motionSmoother::movePoints
|
||||||
newPoints,
|
newPoints,
|
||||||
minEqOp<point>(), // combine op
|
minEqOp<point>(), // combine op
|
||||||
vector(GREAT,GREAT,GREAT), // null
|
vector(GREAT,GREAT,GREAT), // null
|
||||||
true // separation
|
true, // separation
|
||||||
|
1e-6*mesh_.bounds().mag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp<scalarField> tsweptVol = mesh_.movePoints(newPoints);
|
tmp<scalarField> tsweptVol = mesh_.movePoints(newPoints);
|
||||||
|
|
||||||
//!!! Workaround for movePoints bug
|
|
||||||
const_cast<polyBoundaryMesh&>(mesh_.boundaryMesh()).movePoints(newPoints);
|
|
||||||
|
|
||||||
pp_.movePoints(mesh_.points());
|
pp_.movePoints(mesh_.points());
|
||||||
|
|
||||||
return tsweptVol;
|
return tsweptVol;
|
||||||
|
@ -834,7 +838,29 @@ bool Foam::motionSmoother::scaleMesh
|
||||||
const label nAllowableErrors
|
const label nAllowableErrors
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!smoothMesh && adaptPatchIDs_.size() == 0)
|
return scaleMesh
|
||||||
|
(
|
||||||
|
checkFaces,
|
||||||
|
baffles,
|
||||||
|
paramDict_,
|
||||||
|
paramDict_,
|
||||||
|
smoothMesh,
|
||||||
|
nAllowableErrors
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::motionSmoother::scaleMesh
|
||||||
|
(
|
||||||
|
labelList& checkFaces,
|
||||||
|
const List<labelPair>& baffles,
|
||||||
|
const dictionary& paramDict,
|
||||||
|
const dictionary& meshQualityDict,
|
||||||
|
const bool smoothMesh,
|
||||||
|
const label nAllowableErrors
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (!smoothMesh && adaptPatchIDs_.empty())
|
||||||
{
|
{
|
||||||
FatalErrorIn("motionSmoother::scaleMesh(const bool")
|
FatalErrorIn("motionSmoother::scaleMesh(const bool")
|
||||||
<< "You specified both no movement on the internal mesh points"
|
<< "You specified both no movement on the internal mesh points"
|
||||||
|
@ -867,9 +893,9 @@ bool Foam::motionSmoother::scaleMesh
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalar errorReduction =
|
const scalar errorReduction =
|
||||||
readScalar(paramDict_.lookup("errorReduction"));
|
readScalar(paramDict.lookup("errorReduction"));
|
||||||
const label nSmoothScale =
|
const label nSmoothScale =
|
||||||
readLabel(paramDict_.lookup("nSmoothScale"));
|
readLabel(paramDict.lookup("nSmoothScale"));
|
||||||
|
|
||||||
|
|
||||||
// Note: displacement_ should already be synced already from setDisplacement
|
// Note: displacement_ should already be synced already from setDisplacement
|
||||||
|
@ -911,7 +937,8 @@ bool Foam::motionSmoother::scaleMesh
|
||||||
totalDisplacement,
|
totalDisplacement,
|
||||||
maxMagEqOp(),
|
maxMagEqOp(),
|
||||||
vector::zero, // null value
|
vector::zero, // null value
|
||||||
false // separation
|
false, // separation
|
||||||
|
1e-6*mesh_.bounds().mag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -929,7 +956,7 @@ bool Foam::motionSmoother::scaleMesh
|
||||||
|
|
||||||
// Check. Returns parallel number of incorrect faces.
|
// Check. Returns parallel number of incorrect faces.
|
||||||
faceSet wrongFaces(mesh_, "wrongFaces", mesh_.nFaces()/100+100);
|
faceSet wrongFaces(mesh_, "wrongFaces", mesh_.nFaces()/100+100);
|
||||||
checkMesh(false, mesh_, paramDict_, checkFaces, baffles, wrongFaces);
|
checkMesh(false, mesh_, meshQualityDict, checkFaces, baffles, wrongFaces);
|
||||||
|
|
||||||
if (returnReduce(wrongFaces.size(), sumOp<label>()) <= nAllowableErrors)
|
if (returnReduce(wrongFaces.size(), sumOp<label>()) <= nAllowableErrors)
|
||||||
{
|
{
|
||||||
|
@ -989,7 +1016,7 @@ bool Foam::motionSmoother::scaleMesh
|
||||||
// Grow a few layers to determine
|
// Grow a few layers to determine
|
||||||
// - points to be smoothed
|
// - points to be smoothed
|
||||||
// - faces to be checked in next iteration
|
// - faces to be checked in next iteration
|
||||||
PackedList<1> isAffectedPoint(mesh_.nPoints(), 0);
|
PackedBoolList isAffectedPoint(mesh_.nPoints());
|
||||||
getAffectedFacesAndPoints
|
getAffectedFacesAndPoints
|
||||||
(
|
(
|
||||||
nSmoothScale, // smoothing iterations
|
nSmoothScale, // smoothing iterations
|
||||||
|
@ -1005,7 +1032,7 @@ bool Foam::motionSmoother::scaleMesh
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adaptPatchIDs_.size() != 0)
|
if (adaptPatchIDs_.size())
|
||||||
{
|
{
|
||||||
// Scale conflicting patch points
|
// Scale conflicting patch points
|
||||||
scaleField(pp_.meshPoints(), usedPoints, errorReduction, scale_);
|
scaleField(pp_.meshPoints(), usedPoints, errorReduction, scale_);
|
||||||
|
@ -1018,7 +1045,7 @@ bool Foam::motionSmoother::scaleMesh
|
||||||
|
|
||||||
for (label i = 0; i < nSmoothScale; i++)
|
for (label i = 0; i < nSmoothScale; i++)
|
||||||
{
|
{
|
||||||
if (adaptPatchIDs_.size() != 0)
|
if (adaptPatchIDs_.size())
|
||||||
{
|
{
|
||||||
// Smooth patch values
|
// Smooth patch values
|
||||||
pointScalarField oldScale(scale_);
|
pointScalarField oldScale(scale_);
|
||||||
|
|
|
@ -27,18 +27,18 @@ Class
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Given a displacement moves the mesh by scaling the displacement back
|
Given a displacement moves the mesh by scaling the displacement back
|
||||||
until there are no more mesh errors. Holds displacement field
|
until there are no more mesh errors.
|
||||||
(read upon construction since need boundary conditions) and scaling factor
|
|
||||||
and optional patch number on which to scale back displacement.
|
|
||||||
|
|
||||||
E.g.
|
Holds displacement field (read upon construction since need boundary
|
||||||
|
conditions) and scaling factor and optional patch number on which to
|
||||||
|
scale back displacement.
|
||||||
|
|
||||||
E.g.
|
E.g.
|
||||||
@verbatim
|
@verbatim
|
||||||
// Construct iterative mesh mover.
|
// Construct iterative mesh mover.
|
||||||
motionSmoother meshMover(mesh, labelList(1, patchI));
|
motionSmoother meshMover(mesh, labelList(1, patchI));
|
||||||
|
|
||||||
// Set wanted displacement:
|
// Set desired displacement:
|
||||||
meshMover.displacement() = ..
|
meshMover.displacement() = ..
|
||||||
|
|
||||||
for (label iter = 0; iter < maxIter; iter++)
|
for (label iter = 0; iter < maxIter; iter++)
|
||||||
|
@ -49,21 +49,25 @@ Description
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@envverbatim
|
@endverbatim
|
||||||
|
|
||||||
|
Note
|
||||||
|
- Shared points (parallel): a processor can have points which are part of
|
||||||
|
pp on another processor but have no pp itself (i.e. it has points
|
||||||
|
and/or edges but no faces of pp). Hence we have to be careful when e.g.
|
||||||
|
synchronising displacements that the value from the processor which has
|
||||||
|
faces of pp get priority. This is currently handled in setDisplacement
|
||||||
|
by resetting the internal displacement to zero before doing anything
|
||||||
|
else. The combine operator used will give preference to non-zero
|
||||||
|
values.
|
||||||
|
|
||||||
Note: shared points (parallel). A processor can have points which are
|
- Various routines take baffles. These are sets of boundary faces that
|
||||||
part of pp on another processor but have no pp itself (i.e. it has points
|
are treated as a single internal face. This is a hack used to apply
|
||||||
and/or edges but no faces of pp). Hence we have to be careful when
|
|
||||||
e.g. synchronising displacements that the value from the processor which
|
|
||||||
has faces of pp get priority. This is currently handled in setDisplacement
|
|
||||||
by resetting the internal displacement to zero before doing anything else.
|
|
||||||
The combine operator used will give preference to non-zero values.
|
|
||||||
|
|
||||||
Note: various routines take baffles. These are sets of boundary faces
|
|
||||||
that are treated as a single internal face. This is a hack used to apply
|
|
||||||
movement to internal faces.
|
movement to internal faces.
|
||||||
|
|
||||||
|
- Mesh constraints are looked up from the supplied dictionary. (uses
|
||||||
|
recursive lookup)
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
motionSmoother.C
|
motionSmoother.C
|
||||||
motionSmootherTemplates.C
|
motionSmootherTemplates.C
|
||||||
|
@ -74,8 +78,8 @@ SourceFiles
|
||||||
#define motionSmoother_H
|
#define motionSmoother_H
|
||||||
|
|
||||||
#include "pointFields.H"
|
#include "pointFields.H"
|
||||||
#include "labelHashSet.H"
|
#include "HashSet.H"
|
||||||
#include "PackedList.H"
|
#include "PackedBoolList.H"
|
||||||
#include "indirectPrimitivePatch.H"
|
#include "indirectPrimitivePatch.H"
|
||||||
#include "className.H"
|
#include "className.H"
|
||||||
#include "twoDPointCorrector.H"
|
#include "twoDPointCorrector.H"
|
||||||
|
@ -158,11 +162,11 @@ class motionSmoother
|
||||||
pointField oldPoints_;
|
pointField oldPoints_;
|
||||||
|
|
||||||
//- Is mesh point on boundary or not
|
//- Is mesh point on boundary or not
|
||||||
PackedList<1> isInternalPoint_;
|
PackedBoolList isInternalPoint_;
|
||||||
|
|
||||||
//- Is edge master (always except if on coupled boundary and on
|
//- Is edge master (always except if on coupled boundary and on
|
||||||
// lower processor)
|
// lower processor)
|
||||||
PackedList<1> isMasterEdge_;
|
PackedBoolList isMasterEdge_;
|
||||||
|
|
||||||
//- 2-D motion corrector
|
//- 2-D motion corrector
|
||||||
twoDPointCorrector twoDCorrector_;
|
twoDPointCorrector twoDCorrector_;
|
||||||
|
@ -205,7 +209,8 @@ class motionSmoother
|
||||||
const Field<Type>&,
|
const Field<Type>&,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const Type& zero,
|
const Type& zero,
|
||||||
const bool separation
|
const bool separation,
|
||||||
|
const scalar maxMag
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Assemble tensors for multi-patch constraints
|
//- Assemble tensors for multi-patch constraints
|
||||||
|
@ -219,7 +224,7 @@ class motionSmoother
|
||||||
//- explicit smoothing and min on all affected internal points
|
//- explicit smoothing and min on all affected internal points
|
||||||
void minSmooth
|
void minSmooth
|
||||||
(
|
(
|
||||||
const PackedList<1>& isAffectedPoint,
|
const PackedBoolList& isAffectedPoint,
|
||||||
const pointScalarField& fld,
|
const pointScalarField& fld,
|
||||||
pointScalarField& newFld
|
pointScalarField& newFld
|
||||||
) const;
|
) const;
|
||||||
|
@ -227,7 +232,7 @@ class motionSmoother
|
||||||
//- same but only on selected points (usually patch points)
|
//- same but only on selected points (usually patch points)
|
||||||
void minSmooth
|
void minSmooth
|
||||||
(
|
(
|
||||||
const PackedList<1>& isAffectedPoint,
|
const PackedBoolList& isAffectedPoint,
|
||||||
const labelList& meshPoints,
|
const labelList& meshPoints,
|
||||||
const pointScalarField& fld,
|
const pointScalarField& fld,
|
||||||
pointScalarField& newFld
|
pointScalarField& newFld
|
||||||
|
@ -263,7 +268,7 @@ class motionSmoother
|
||||||
const faceSet& wrongFaces,
|
const faceSet& wrongFaces,
|
||||||
|
|
||||||
labelList& affectedFaces,
|
labelList& affectedFaces,
|
||||||
PackedList<1>& isAffectedPoint
|
PackedBoolList& isAffectedPoint
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
|
@ -290,8 +295,8 @@ public:
|
||||||
const dictionary& paramDict
|
const dictionary& paramDict
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from mesh, patches to work on and smoothing parameters and
|
//- Construct from mesh, patches to work on and smoothing parameters
|
||||||
// displacementfield (only boundary conditions used)
|
// and displacement field (only boundary conditions used)
|
||||||
motionSmoother
|
motionSmoother
|
||||||
(
|
(
|
||||||
polyMesh&,
|
polyMesh&,
|
||||||
|
@ -323,6 +328,8 @@ public:
|
||||||
//- Patch labels that are being adapted
|
//- Patch labels that are being adapted
|
||||||
const labelList& adaptPatchIDs() const;
|
const labelList& adaptPatchIDs() const;
|
||||||
|
|
||||||
|
const dictionary& paramDict() const;
|
||||||
|
|
||||||
//- Reference to displacement field
|
//- Reference to displacement field
|
||||||
pointVectorField& displacement();
|
pointVectorField& displacement();
|
||||||
|
|
||||||
|
@ -394,6 +401,17 @@ public:
|
||||||
const label nAllow = 0
|
const label nAllow = 0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Move mesh with externally provided mesh constraints
|
||||||
|
bool scaleMesh
|
||||||
|
(
|
||||||
|
labelList& checkFaces,
|
||||||
|
const List<labelPair>& baffles,
|
||||||
|
const dictionary& paramDict,
|
||||||
|
const dictionary& meshQualityDict,
|
||||||
|
const bool smoothMesh = true,
|
||||||
|
const label nAllow = 0
|
||||||
|
);
|
||||||
|
|
||||||
//- Update topology
|
//- Update topology
|
||||||
void updateMesh();
|
void updateMesh();
|
||||||
|
|
||||||
|
|
|
@ -28,19 +28,6 @@ License
|
||||||
#include "polyMeshGeometry.H"
|
#include "polyMeshGeometry.H"
|
||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::motionSmoother::checkMesh
|
bool Foam::motionSmoother::checkMesh
|
||||||
|
@ -74,17 +61,50 @@ bool Foam::motionSmoother::checkMesh
|
||||||
labelHashSet& wrongFaces
|
labelHashSet& wrongFaces
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const scalar maxNonOrtho(readScalar(dict.lookup("maxNonOrtho")));
|
const scalar maxNonOrtho
|
||||||
const scalar minVol(readScalar(dict.lookup("minVol")));
|
(
|
||||||
const scalar maxConcave(readScalar(dict.lookup("maxConcave")));
|
readScalar(dict.lookup("maxNonOrtho", true))
|
||||||
const scalar minArea(readScalar(dict.lookup("minArea")));
|
);
|
||||||
const scalar maxIntSkew(readScalar(dict.lookup("maxInternalSkewness")));
|
const scalar minVol
|
||||||
const scalar maxBounSkew(readScalar(dict.lookup("maxBoundarySkewness")));
|
(
|
||||||
const scalar minWeight(readScalar(dict.lookup("minFaceWeight")));
|
readScalar(dict.lookup("minVol", true))
|
||||||
const scalar minVolRatio(readScalar(dict.lookup("minVolRatio")));
|
);
|
||||||
const scalar minTwist(readScalar(dict.lookup("minTwist")));
|
const scalar maxConcave
|
||||||
const scalar minTriangleTwist(readScalar(dict.lookup("minTriangleTwist")));
|
(
|
||||||
const scalar minDet(readScalar(dict.lookup("minDeterminant")));
|
readScalar(dict.lookup("maxConcave", true))
|
||||||
|
);
|
||||||
|
const scalar minArea
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minArea", true))
|
||||||
|
);
|
||||||
|
const scalar maxIntSkew
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("maxInternalSkewness", true))
|
||||||
|
);
|
||||||
|
const scalar maxBounSkew
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("maxBoundarySkewness", true))
|
||||||
|
);
|
||||||
|
const scalar minWeight
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minFaceWeight", true))
|
||||||
|
);
|
||||||
|
const scalar minVolRatio
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minVolRatio", true))
|
||||||
|
);
|
||||||
|
const scalar minTwist
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minTwist", true))
|
||||||
|
);
|
||||||
|
const scalar minTriangleTwist
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minTriangleTwist", true))
|
||||||
|
);
|
||||||
|
const scalar minDet
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minDeterminant", true))
|
||||||
|
);
|
||||||
|
|
||||||
label nWrongFaces = 0;
|
label nWrongFaces = 0;
|
||||||
|
|
||||||
|
@ -389,17 +409,50 @@ bool Foam::motionSmoother::checkMesh
|
||||||
labelHashSet& wrongFaces
|
labelHashSet& wrongFaces
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const scalar maxNonOrtho(readScalar(dict.lookup("maxNonOrtho")));
|
const scalar maxNonOrtho
|
||||||
const scalar minVol(readScalar(dict.lookup("minVol")));
|
(
|
||||||
const scalar maxConcave(readScalar(dict.lookup("maxConcave")));
|
readScalar(dict.lookup("maxNonOrtho", true))
|
||||||
const scalar minArea(readScalar(dict.lookup("minArea")));
|
);
|
||||||
const scalar maxIntSkew(readScalar(dict.lookup("maxInternalSkewness")));
|
const scalar minVol
|
||||||
const scalar maxBounSkew(readScalar(dict.lookup("maxBoundarySkewness")));
|
(
|
||||||
const scalar minWeight(readScalar(dict.lookup("minFaceWeight")));
|
readScalar(dict.lookup("minVol", true))
|
||||||
const scalar minVolRatio(readScalar(dict.lookup("minVolRatio")));
|
);
|
||||||
const scalar minTwist(readScalar(dict.lookup("minTwist")));
|
const scalar maxConcave
|
||||||
const scalar minTriangleTwist(readScalar(dict.lookup("minTriangleTwist")));
|
(
|
||||||
const scalar minDet(readScalar(dict.lookup("minDeterminant")));
|
readScalar(dict.lookup("maxConcave", true))
|
||||||
|
);
|
||||||
|
const scalar minArea
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minArea", true))
|
||||||
|
);
|
||||||
|
const scalar maxIntSkew
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("maxInternalSkewness", true))
|
||||||
|
);
|
||||||
|
const scalar maxBounSkew
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("maxBoundarySkewness", true))
|
||||||
|
);
|
||||||
|
const scalar minWeight
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minFaceWeight", true))
|
||||||
|
);
|
||||||
|
const scalar minVolRatio
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minVolRatio", true))
|
||||||
|
);
|
||||||
|
const scalar minTwist
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minTwist", true))
|
||||||
|
);
|
||||||
|
const scalar minTriangleTwist
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minTriangleTwist", true))
|
||||||
|
);
|
||||||
|
const scalar minDet
|
||||||
|
(
|
||||||
|
readScalar(dict.lookup("minDeterminant", true))
|
||||||
|
);
|
||||||
|
|
||||||
label nWrongFaces = 0;
|
label nWrongFaces = 0;
|
||||||
|
|
||||||
|
|
|
@ -294,7 +294,8 @@ void Foam::motionSmoother::testSyncField
|
||||||
const Field<Type>& fld,
|
const Field<Type>& fld,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const Type& zero,
|
const Type& zero,
|
||||||
const bool separation
|
const bool separation,
|
||||||
|
const scalar maxMag
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
|
@ -316,7 +317,7 @@ void Foam::motionSmoother::testSyncField
|
||||||
|
|
||||||
forAll(syncedFld, i)
|
forAll(syncedFld, i)
|
||||||
{
|
{
|
||||||
if (syncedFld[i] != fld[i])
|
if (mag(syncedFld[i] - fld[i]) > maxMag)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
|
|
|
@ -40,7 +40,7 @@ SourceFiles
|
||||||
#define polyMeshGeometry_H
|
#define polyMeshGeometry_H
|
||||||
|
|
||||||
#include "pointFields.H"
|
#include "pointFields.H"
|
||||||
#include "labelHashSet.H"
|
#include "HashSet.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ SourceFiles
|
||||||
#define polyTopoChange_H
|
#define polyTopoChange_H
|
||||||
|
|
||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
#include "labelHashSet.H"
|
#include "HashSet.H"
|
||||||
#include "polyAddPoint.H"
|
#include "polyAddPoint.H"
|
||||||
#include "polyModifyPoint.H"
|
#include "polyModifyPoint.H"
|
||||||
#include "polyRemovePoint.H"
|
#include "polyRemovePoint.H"
|
||||||
|
|
|
@ -2228,11 +2228,10 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChanger::changeMesh
|
||||||
|
|
||||||
mesh.resetPrimitives
|
mesh.resetPrimitives
|
||||||
(
|
(
|
||||||
nUsedFaces,
|
xferMove(newPointsZeroVol),
|
||||||
newPointsZeroVol,
|
xferMove(newFaces),
|
||||||
newFaces,
|
xferMove(allOwn),
|
||||||
allOwn,
|
xferMove(allNei),
|
||||||
allNei,
|
|
||||||
patchSizes,
|
patchSizes,
|
||||||
patchStarts,
|
patchStarts,
|
||||||
false // The mesh is not complete: no parallel comms
|
false // The mesh is not complete: no parallel comms
|
||||||
|
|
|
@ -39,8 +39,6 @@ Foam::engineTopoChangerMesh::engineTopoChangerMesh(const IOobject& io)
|
||||||
:
|
:
|
||||||
fvMesh(io),
|
fvMesh(io),
|
||||||
topoChanger_(*this),
|
topoChanger_(*this),
|
||||||
pMesh_(*this),
|
|
||||||
vpi_(*this, pMesh_),
|
|
||||||
engineTime_(refCast<const engineTime>(time()))
|
engineTime_(refCast<const engineTime>(time()))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
@ -70,17 +70,10 @@ protected:
|
||||||
|
|
||||||
polyTopoChanger topoChanger_;
|
polyTopoChanger topoChanger_;
|
||||||
|
|
||||||
// Used when spray calculations are performed
|
|
||||||
pointMesh pMesh_;
|
|
||||||
|
|
||||||
// Used when spray calculations are performed
|
|
||||||
volPointInterpolation vpi_;
|
|
||||||
|
|
||||||
//- Engine database
|
//- Engine database
|
||||||
const engineTime& engineTime_;
|
const engineTime& engineTime_;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
@ -127,16 +120,6 @@ public:
|
||||||
return engineTime_;
|
return engineTime_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const volPointInterpolation& vpi() const
|
|
||||||
{
|
|
||||||
return vpi_;
|
|
||||||
}
|
|
||||||
|
|
||||||
volPointInterpolation& vpi()
|
|
||||||
{
|
|
||||||
return vpi_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|
|
@ -45,13 +45,17 @@ Class
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
defineTypeNameAndDebug(Foam::engineValveSliding, 0);
|
defineTypeNameAndDebug(Foam::engineValveSliding, 0);
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
addToRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
Foam::engineTopoChangerMesh,
|
engineTopoChangerMesh,
|
||||||
Foam::engineValveSliding,
|
engineValveSliding,
|
||||||
IOobject
|
IOobject
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
|
@ -40,14 +40,17 @@ License
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineTypeNameAndDebug(Foam::layerAR, 0);
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(layerAR, 0);
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
addToRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
Foam::engineTopoChangerMesh,
|
engineTopoChangerMesh,
|
||||||
Foam::layerAR,
|
layerAR,
|
||||||
IOobject
|
IOobject
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
|
@ -65,8 +65,6 @@ void Foam::pistonLayer::addZonesAndModifiers()
|
||||||
checkAndCalculate();
|
checkAndCalculate();
|
||||||
|
|
||||||
setVirtualPistonPosition();
|
setVirtualPistonPosition();
|
||||||
vpi_.movePoints();
|
|
||||||
vpi_.updateMesh();
|
|
||||||
topoChanger_.writeOpt() = IOobject::AUTO_WRITE;
|
topoChanger_.writeOpt() = IOobject::AUTO_WRITE;
|
||||||
topoChanger_.write();
|
topoChanger_.write();
|
||||||
|
|
||||||
|
|
|
@ -199,13 +199,11 @@ Foam::pistonLayer::pistonLayer
|
||||||
virtualPistonPosition_(-GREAT),
|
virtualPistonPosition_(-GREAT),
|
||||||
deckHeight_(GREAT),
|
deckHeight_(GREAT),
|
||||||
scalePoints_(engTime().engineDict().lookup("scalePoints")),
|
scalePoints_(engTime().engineDict().lookup("scalePoints")),
|
||||||
movePointsBelowPiston_(false)
|
movePointsBelowPiston_
|
||||||
|
(
|
||||||
|
engTime().engineDict().lookupOrDefault("movePointsBelowPiston", false)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if(engTime().engineDict().found("movePointsBelowPiston"))
|
|
||||||
{
|
|
||||||
movePointsBelowPiston_ =
|
|
||||||
engTime().engineDict().lookup("movePointsBelowPiston");
|
|
||||||
}
|
|
||||||
// Add zones and modifiers if not already there.
|
// Add zones and modifiers if not already there.
|
||||||
addZonesAndModifiers();
|
addZonesAndModifiers();
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,7 +247,7 @@ Foam::faMesh::faMesh(const polyMesh& pMesh)
|
||||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||||
boundary_.calcGeometry();
|
boundary_.calcGeometry();
|
||||||
|
|
||||||
if (file(pMesh.time().timePath()/"S0"))
|
if (isFile(pMesh.time().timePath()/"S0"))
|
||||||
{
|
{
|
||||||
S0Ptr_ = new DimensionedField<scalar, areaMesh>
|
S0Ptr_ = new DimensionedField<scalar, areaMesh>
|
||||||
(
|
(
|
||||||
|
@ -617,7 +617,7 @@ Foam::faMesh::faMesh
|
||||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||||
boundary_.calcGeometry();
|
boundary_.calcGeometry();
|
||||||
|
|
||||||
if (file(mesh_.time().timePath()/"S0"))
|
if (isFile(mesh_.time().timePath()/"S0"))
|
||||||
{
|
{
|
||||||
S0Ptr_ = new DimensionedField<scalar, areaMesh>
|
S0Ptr_ = new DimensionedField<scalar, areaMesh>
|
||||||
(
|
(
|
||||||
|
@ -862,9 +862,9 @@ void Foam::faMesh::addFaPatches(const List<faPatch*>& p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::objectRegistry& Foam::faMesh::db() const
|
const Foam::objectRegistry& Foam::faMesh::thisDb() const
|
||||||
{
|
{
|
||||||
return mesh_.db();
|
return mesh_.thisDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -365,7 +365,7 @@ public:
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return reference to the mesh database
|
//- Return reference to the mesh database
|
||||||
virtual const objectRegistry& db() const;
|
virtual const objectRegistry& thisDb() const;
|
||||||
|
|
||||||
//- Return constant reference to boundary mesh
|
//- Return constant reference to boundary mesh
|
||||||
const faBoundaryMesh& boundary() const;
|
const faBoundaryMesh& boundary() const;
|
||||||
|
|
|
@ -36,8 +36,8 @@ Description
|
||||||
#include "processorFaPatch.H"
|
#include "processorFaPatch.H"
|
||||||
#include "wedgeFaPatch.H"
|
#include "wedgeFaPatch.H"
|
||||||
#include "PstreamCombineReduceOps.H"
|
#include "PstreamCombineReduceOps.H"
|
||||||
#include "cartesianCS.H"
|
#include "coordinateSystem.H"
|
||||||
#include "scalarMatrix.H"
|
#include "scalarMatrices.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -1395,14 +1395,14 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
vector dir = (allPoints[0] - points[curPoint]);
|
vector dir = (allPoints[0] - points[curPoint]);
|
||||||
dir -= axis*(axis&dir);
|
dir -= axis*(axis&dir);
|
||||||
dir /= mag(dir);
|
dir /= mag(dir);
|
||||||
cartesianCS cs("cs", origin, axis, dir);
|
coordinateSystem cs("cs", origin, axis, dir);
|
||||||
|
|
||||||
forAll(allPoints, pI)
|
forAll(allPoints, pI)
|
||||||
{
|
{
|
||||||
allPoints[pI] = cs.localPosition(allPoints[pI]);
|
allPoints[pI] = cs.localPosition(allPoints[pI]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix<scalar> M
|
scalarRectangularMatrix M
|
||||||
(
|
(
|
||||||
allPoints.size(),
|
allPoints.size(),
|
||||||
5,
|
5,
|
||||||
|
@ -1418,7 +1418,8 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
M[i][4] = allPoints[i].y();
|
M[i][4] = allPoints[i].y();
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix<scalar> MtM(5, 5, 0.0);
|
scalarSquareMatrix MtM(5, 0.0);
|
||||||
|
|
||||||
for (label i = 0; i < MtM.n(); i++)
|
for (label i = 0; i < MtM.n(); i++)
|
||||||
{
|
{
|
||||||
for (label j = 0; j < MtM.m(); j++)
|
for (label j = 0; j < MtM.m(); j++)
|
||||||
|
@ -1431,6 +1432,7 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarField MtR(5, 0);
|
scalarField MtR(5, 0);
|
||||||
|
|
||||||
for (label i=0; i<MtR.size(); i++)
|
for (label i=0; i<MtR.size(); i++)
|
||||||
{
|
{
|
||||||
for (label j=0; j<M.n(); j++)
|
for (label j=0; j<M.n(); j++)
|
||||||
|
@ -1439,7 +1441,7 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarMatrix::LUsolve(MtM, MtR);
|
scalarSquareMatrix::LUsolve(MtM, MtR);
|
||||||
|
|
||||||
vector curNormal = vector(MtR[3], MtR[4], -1);
|
vector curNormal = vector(MtR[3], MtR[4], -1);
|
||||||
|
|
||||||
|
@ -1681,7 +1683,7 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
vector dir = (allPoints[0] - points[curPoint]);
|
vector dir = (allPoints[0] - points[curPoint]);
|
||||||
dir -= axis*(axis&dir);
|
dir -= axis*(axis&dir);
|
||||||
dir /= mag(dir);
|
dir /= mag(dir);
|
||||||
cartesianCS cs("cs", origin, axis, dir);
|
coordinateSystem cs("cs", origin, axis, dir);
|
||||||
|
|
||||||
scalarField W(allPoints.size(), 1.0);
|
scalarField W(allPoints.size(), 1.0);
|
||||||
|
|
||||||
|
@ -1693,7 +1695,7 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
cs.localPosition(allPoints[pI]);
|
cs.localPosition(allPoints[pI]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix<scalar> M
|
scalarRectangularMatrix M
|
||||||
(
|
(
|
||||||
allPoints.size(),
|
allPoints.size(),
|
||||||
5,
|
5,
|
||||||
|
@ -1709,7 +1711,8 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
M[i][4] = allPoints[i].y();
|
M[i][4] = allPoints[i].y();
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix<scalar> MtM(5, 5, 0.0);
|
scalarSquareMatrix MtM(5, 0.0);
|
||||||
|
|
||||||
for (label i = 0; i < MtM.n(); i++)
|
for (label i = 0; i < MtM.n(); i++)
|
||||||
{
|
{
|
||||||
for (label j = 0; j < MtM.m(); j++)
|
for (label j = 0; j < MtM.m(); j++)
|
||||||
|
@ -1722,6 +1725,7 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarField MtR(5, 0);
|
scalarField MtR(5, 0);
|
||||||
|
|
||||||
for (label i = 0; i < MtR.size(); i++)
|
for (label i = 0; i < MtR.size(); i++)
|
||||||
{
|
{
|
||||||
for (label j = 0; j < M.n(); j++)
|
for (label j = 0; j < M.n(); j++)
|
||||||
|
@ -1730,7 +1734,7 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarMatrix::LUsolve(MtM, MtR);
|
scalarSquareMatrix::LUsolve(MtM, MtR);
|
||||||
|
|
||||||
vector curNormal = vector(MtR[3], MtR[4], -1);
|
vector curNormal = vector(MtR[3], MtR[4], -1);
|
||||||
|
|
||||||
|
@ -1858,7 +1862,7 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
vector dir = (allPoints[0] - points[curPoint]);
|
vector dir = (allPoints[0] - points[curPoint]);
|
||||||
dir -= axis*(axis&dir);
|
dir -= axis*(axis&dir);
|
||||||
dir /= mag(dir);
|
dir /= mag(dir);
|
||||||
cartesianCS cs("cs", origin, axis, dir);
|
coordinateSystem cs("cs", origin, axis, dir);
|
||||||
|
|
||||||
scalarField W(allPoints.size(), 1.0);
|
scalarField W(allPoints.size(), 1.0);
|
||||||
|
|
||||||
|
@ -1871,7 +1875,7 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
cs.localPosition(allPoints[pointI]);
|
cs.localPosition(allPoints[pointI]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix<scalar> M
|
scalarRectangularMatrix M
|
||||||
(
|
(
|
||||||
allPoints.size(),
|
allPoints.size(),
|
||||||
5,
|
5,
|
||||||
|
@ -1887,7 +1891,7 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
M[i][4] = allPoints[i].y();
|
M[i][4] = allPoints[i].y();
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix<scalar> MtM(5, 5, 0.0);
|
scalarSquareMatrix MtM(5, 0.0);
|
||||||
for (label i = 0; i < MtM.n(); i++)
|
for (label i = 0; i < MtM.n(); i++)
|
||||||
{
|
{
|
||||||
for (label j = 0; j < MtM.m(); j++)
|
for (label j = 0; j < MtM.m(); j++)
|
||||||
|
@ -1908,7 +1912,7 @@ void faMesh::calcPointAreaNormalsByQuadricsFit() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarMatrix::LUsolve(MtM, MtR);
|
scalarSquareMatrix::LUsolve(MtM, MtR);
|
||||||
|
|
||||||
vector curNormal = vector(MtR[3], MtR[4], -1);
|
vector curNormal = vector(MtR[3], MtR[4], -1);
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ faPatchField<Type>::faPatchField
|
||||||
template<class Type>
|
template<class Type>
|
||||||
const objectRegistry& faPatchField<Type>::db() const
|
const objectRegistry& faPatchField<Type>::db() const
|
||||||
{
|
{
|
||||||
return patch_.boundaryMesh().mesh().db();
|
return patch_.boundaryMesh().mesh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ faePatchField<Type>::faePatchField
|
||||||
template<class Type>
|
template<class Type>
|
||||||
const objectRegistry& faePatchField<Type>::db() const
|
const objectRegistry& faePatchField<Type>::db() const
|
||||||
{
|
{
|
||||||
return patch_.boundaryMesh().mesh().db();
|
return patch_.boundaryMesh().mesh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,15 +31,7 @@ Description
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::fa, 0);
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(fa, 0)
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
@ -73,7 +73,7 @@ void Foam::leastSquaresFaVectors::makeLeastSquaresVectors() const
|
||||||
(
|
(
|
||||||
"LeastSquaresP",
|
"LeastSquaresP",
|
||||||
mesh_.pointsInstance(),
|
mesh_.pointsInstance(),
|
||||||
mesh_.db(),
|
mesh_.thisDb(),
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
|
@ -89,7 +89,7 @@ void Foam::leastSquaresFaVectors::makeLeastSquaresVectors() const
|
||||||
(
|
(
|
||||||
"LeastSquaresN",
|
"LeastSquaresN",
|
||||||
mesh_.pointsInstance(),
|
mesh_.pointsInstance(),
|
||||||
mesh_.db(),
|
mesh_.thisDb(),
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
|
@ -134,18 +134,7 @@ void Foam::leastSquaresFaVectors::makeLeastSquaresVectors() const
|
||||||
const unallocLabelList& edgeFaces = p.edgeFaces();
|
const unallocLabelList& edgeFaces = p.edgeFaces();
|
||||||
|
|
||||||
// Build the d-vectors
|
// Build the d-vectors
|
||||||
vectorField pd =
|
vectorField pd = p.delta();
|
||||||
mesh_.Le().boundaryField()[patchi]
|
|
||||||
/(
|
|
||||||
mesh_.magLe().boundaryField()[patchi]
|
|
||||||
*mesh_.deltaCoeffs().boundaryField()[patchi]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!mesh_.orthogonal())
|
|
||||||
{
|
|
||||||
pd -= mesh_.correctionVectors().boundaryField()[patchi]
|
|
||||||
/mesh_.deltaCoeffs().boundaryField()[patchi];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p.coupled())
|
if (p.coupled())
|
||||||
{
|
{
|
||||||
|
@ -200,19 +189,7 @@ void Foam::leastSquaresFaVectors::makeLeastSquaresVectors() const
|
||||||
const unallocLabelList& edgeFaces = p.edgeFaces();
|
const unallocLabelList& edgeFaces = p.edgeFaces();
|
||||||
|
|
||||||
// Build the d-vectors
|
// Build the d-vectors
|
||||||
vectorField pd =
|
vectorField pd = p.delta();
|
||||||
mesh_.Le().boundaryField()[patchi]
|
|
||||||
/(
|
|
||||||
mesh_.magLe().boundaryField()[patchi]
|
|
||||||
*mesh_.deltaCoeffs().boundaryField()[patchi]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!mesh_.orthogonal())
|
|
||||||
{
|
|
||||||
pd -= mesh_.correctionVectors().boundaryField()[patchi]
|
|
||||||
/mesh_.deltaCoeffs().boundaryField()[patchi];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (p.coupled())
|
if (p.coupled())
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class blended Declaration
|
Class blendedEdgeInterpolation Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
@ -105,7 +105,7 @@ public:
|
||||||
upwindEdgeInterpolation<Type>
|
upwindEdgeInterpolation<Type>
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
mesh.db().objectRegistry::lookupObject<edgeScalarField>
|
mesh().objectRegistry::lookupObject<edgeScalarField>
|
||||||
(
|
(
|
||||||
word(is)
|
word(is)
|
||||||
)
|
)
|
||||||
|
@ -137,8 +137,10 @@ public:
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
blendingFactor_*linearEdgeInterpolation<Type>::weights(vf)
|
blendingFactor_*
|
||||||
+ (1 - blendingFactor_)*upwindEdgeInterpolation<Type>::weights(vf);
|
linearEdgeInterpolation<Type>::weights(vf)
|
||||||
|
+ (1 - blendingFactor_)*
|
||||||
|
upwindEdgeInterpolation<Type>::weights(vf);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -32,4 +32,5 @@ Description
|
||||||
|
|
||||||
defineTypeNameAndDebug(Foam::fv, 0);
|
defineTypeNameAndDebug(Foam::fv, 0);
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
@ -58,7 +58,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "fvMatrix<Type>::solve(const dictionary& solverControls) : "
|
Info<< "fvMatrix<Type>::solve(const dictionary&) : "
|
||||||
"solving fvMatrix<Type>"
|
"solving fvMatrix<Type>"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,8 @@ Foam::fvMatrix<Foam::scalar>::solver
|
||||||
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::fvSolver::solve
|
Foam::lduMatrix::solverPerformance
|
||||||
|
Foam::fvMatrix<Foam::scalar>::fvSolver::solve
|
||||||
(
|
(
|
||||||
const dictionary& solverControls
|
const dictionary& solverControls
|
||||||
)
|
)
|
||||||
|
|
|
@ -32,4 +32,4 @@ pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDispla
|
||||||
pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
|
pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
|
||||||
pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
|
pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libfvMotionSolvers
|
LIB = $(FOAM_LIBBIN)/libfvMotionSolver
|
||||||
|
|
|
@ -44,7 +44,19 @@ Foam::wordList Foam::fvMotionSolver::cellMotionBoundaryTypes
|
||||||
|
|
||||||
forAll(cmUbf, patchi)
|
forAll(cmUbf, patchi)
|
||||||
{
|
{
|
||||||
if (isA<fixedValuePointPatchField<Type> >(pmUbf[patchi]))
|
if
|
||||||
|
(
|
||||||
|
isA
|
||||||
|
<
|
||||||
|
FixedValuePointPatchField
|
||||||
|
<
|
||||||
|
pointPatchField,
|
||||||
|
pointMesh,
|
||||||
|
pointPatch,
|
||||||
|
DummyMatrix,
|
||||||
|
Type
|
||||||
|
>
|
||||||
|
>(pmUbf[patchi]))
|
||||||
{
|
{
|
||||||
cmUbf[patchi] = cellMotionFvPatchField<Type>::typeName;
|
cmUbf[patchi] = cellMotionFvPatchField<Type>::typeName;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ angularOscillatingDisplacementPointPatchVectorField
|
||||||
const DimensionedField<vector, pointMesh>& iF
|
const DimensionedField<vector, pointMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(p, iF),
|
fixedValuePointPatchVectorField(p, iF),
|
||||||
axis_(vector::zero),
|
axis_(vector::zero),
|
||||||
origin_(vector::zero),
|
origin_(vector::zero),
|
||||||
angle0_(0.0),
|
angle0_(0.0),
|
||||||
|
@ -62,7 +62,7 @@ angularOscillatingDisplacementPointPatchVectorField
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(p, iF, dict),
|
fixedValuePointPatchVectorField(p, iF, dict),
|
||||||
axis_(dict.lookup("axis")),
|
axis_(dict.lookup("axis")),
|
||||||
origin_(dict.lookup("origin")),
|
origin_(dict.lookup("origin")),
|
||||||
angle0_(readScalar(dict.lookup("angle0"))),
|
angle0_(readScalar(dict.lookup("angle0"))),
|
||||||
|
@ -91,16 +91,16 @@ angularOscillatingDisplacementPointPatchVectorField
|
||||||
const angularOscillatingDisplacementPointPatchVectorField& ptf,
|
const angularOscillatingDisplacementPointPatchVectorField& ptf,
|
||||||
const pointPatch& p,
|
const pointPatch& p,
|
||||||
const DimensionedField<vector, pointMesh>& iF,
|
const DimensionedField<vector, pointMesh>& iF,
|
||||||
const pointPatchFieldMapper& mapper
|
const PointPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
|
fixedValuePointPatchVectorField(ptf, p, iF, mapper),
|
||||||
axis_(ptf.axis_),
|
axis_(ptf.axis_),
|
||||||
origin_(ptf.origin_),
|
origin_(ptf.origin_),
|
||||||
angle0_(ptf.angle0_),
|
angle0_(ptf.angle0_),
|
||||||
amplitude_(ptf.amplitude_),
|
amplitude_(ptf.amplitude_),
|
||||||
omega_(ptf.omega_),
|
omega_(ptf.omega_),
|
||||||
p0_(ptf.p0_, mapper)
|
p0_(ptf.p0_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ angularOscillatingDisplacementPointPatchVectorField
|
||||||
const DimensionedField<vector, pointMesh>& iF
|
const DimensionedField<vector, pointMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(ptf, iF),
|
fixedValuePointPatchVectorField(ptf, iF),
|
||||||
axis_(ptf.axis_),
|
axis_(ptf.axis_),
|
||||||
origin_(ptf.origin_),
|
origin_(ptf.origin_),
|
||||||
angle0_(ptf.angle0_),
|
angle0_(ptf.angle0_),
|
||||||
|
@ -123,32 +123,6 @@ angularOscillatingDisplacementPointPatchVectorField
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void angularOscillatingDisplacementPointPatchVectorField::autoMap
|
|
||||||
(
|
|
||||||
const pointPatchFieldMapper& m
|
|
||||||
)
|
|
||||||
{
|
|
||||||
fixedValuePointPatchField<vector>::autoMap(m);
|
|
||||||
|
|
||||||
p0_.autoMap(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void angularOscillatingDisplacementPointPatchVectorField::rmap
|
|
||||||
(
|
|
||||||
const pointPatchField<vector>& ptf,
|
|
||||||
const labelList& addr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const angularOscillatingDisplacementPointPatchVectorField& aODptf =
|
|
||||||
refCast<const angularOscillatingDisplacementPointPatchVectorField>(ptf);
|
|
||||||
|
|
||||||
fixedValuePointPatchField<vector>::rmap(aODptf, addr);
|
|
||||||
|
|
||||||
p0_.rmap(aODptf.p0_, addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void angularOscillatingDisplacementPointPatchVectorField::updateCoeffs()
|
void angularOscillatingDisplacementPointPatchVectorField::updateCoeffs()
|
||||||
{
|
{
|
||||||
if (this->updated())
|
if (this->updated())
|
||||||
|
@ -170,7 +144,7 @@ void angularOscillatingDisplacementPointPatchVectorField::updateCoeffs()
|
||||||
+ (axisHat & p0Rel)*(1 - cos(angle))*axisHat
|
+ (axisHat & p0Rel)*(1 - cos(angle))*axisHat
|
||||||
);
|
);
|
||||||
|
|
||||||
fixedValuePointPatchField<vector>::updateCoeffs();
|
fixedValuePointPatchVectorField::updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -179,7 +153,8 @@ void angularOscillatingDisplacementPointPatchVectorField::write
|
||||||
Ostream& os
|
Ostream& os
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
pointPatchField<vector>::write(os);
|
pointPatchVectorField::write(os);
|
||||||
|
|
||||||
os.writeKeyword("axis")
|
os.writeKeyword("axis")
|
||||||
<< axis_ << token::END_STATEMENT << nl;
|
<< axis_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("origin")
|
os.writeKeyword("origin")
|
||||||
|
|
|
@ -36,7 +36,7 @@ SourceFiles
|
||||||
#ifndef angularOscillatingDisplacementPointPatchVectorField_H
|
#ifndef angularOscillatingDisplacementPointPatchVectorField_H
|
||||||
#define angularOscillatingDisplacementPointPatchVectorField_H
|
#define angularOscillatingDisplacementPointPatchVectorField_H
|
||||||
|
|
||||||
#include "fixedValuePointPatchField.H"
|
#include "fixedValuePointPatchFields.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -49,7 +49,14 @@ namespace Foam
|
||||||
|
|
||||||
class angularOscillatingDisplacementPointPatchVectorField
|
class angularOscillatingDisplacementPointPatchVectorField
|
||||||
:
|
:
|
||||||
public fixedValuePointPatchField<vector>
|
public FixedValuePointPatchField
|
||||||
|
<
|
||||||
|
pointPatchField,
|
||||||
|
pointMesh,
|
||||||
|
pointPatch,
|
||||||
|
DummyMatrix,
|
||||||
|
vector
|
||||||
|
>
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
@ -91,7 +98,7 @@ public:
|
||||||
const angularOscillatingDisplacementPointPatchVectorField&,
|
const angularOscillatingDisplacementPointPatchVectorField&,
|
||||||
const pointPatch&,
|
const pointPatch&,
|
||||||
const DimensionedField<vector, pointMesh>&,
|
const DimensionedField<vector, pointMesh>&,
|
||||||
const pointPatchFieldMapper&
|
const PointPatchFieldMapper&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
|
@ -132,22 +139,6 @@ public:
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
// Mapping functions
|
|
||||||
|
|
||||||
//- Map (and resize as needed) from self given a mapping object
|
|
||||||
virtual void autoMap
|
|
||||||
(
|
|
||||||
const pointPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Reverse map the given pointPatchField onto this pointPatchField
|
|
||||||
virtual void rmap
|
|
||||||
(
|
|
||||||
const pointPatchField<vector>&,
|
|
||||||
const labelList&
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the coefficients associated with the patch field
|
||||||
|
|
|
@ -44,7 +44,7 @@ angularOscillatingVelocityPointPatchVectorField
|
||||||
const DimensionedField<vector, pointMesh>& iF
|
const DimensionedField<vector, pointMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(p, iF),
|
fixedValuePointPatchVectorField(p, iF),
|
||||||
axis_(vector::zero),
|
axis_(vector::zero),
|
||||||
origin_(vector::zero),
|
origin_(vector::zero),
|
||||||
angle0_(0.0),
|
angle0_(0.0),
|
||||||
|
@ -62,7 +62,7 @@ angularOscillatingVelocityPointPatchVectorField
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(p, iF, dict),
|
fixedValuePointPatchVectorField(p, iF, dict),
|
||||||
axis_(dict.lookup("axis")),
|
axis_(dict.lookup("axis")),
|
||||||
origin_(dict.lookup("origin")),
|
origin_(dict.lookup("origin")),
|
||||||
angle0_(readScalar(dict.lookup("angle0"))),
|
angle0_(readScalar(dict.lookup("angle0"))),
|
||||||
|
@ -91,10 +91,10 @@ angularOscillatingVelocityPointPatchVectorField
|
||||||
const angularOscillatingVelocityPointPatchVectorField& ptf,
|
const angularOscillatingVelocityPointPatchVectorField& ptf,
|
||||||
const pointPatch& p,
|
const pointPatch& p,
|
||||||
const DimensionedField<vector, pointMesh>& iF,
|
const DimensionedField<vector, pointMesh>& iF,
|
||||||
const pointPatchFieldMapper& mapper
|
const PointPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
|
fixedValuePointPatchVectorField(ptf, p, iF, mapper),
|
||||||
axis_(ptf.axis_),
|
axis_(ptf.axis_),
|
||||||
origin_(ptf.origin_),
|
origin_(ptf.origin_),
|
||||||
angle0_(ptf.angle0_),
|
angle0_(ptf.angle0_),
|
||||||
|
@ -111,7 +111,7 @@ angularOscillatingVelocityPointPatchVectorField
|
||||||
const DimensionedField<vector, pointMesh>& iF
|
const DimensionedField<vector, pointMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(ptf, iF),
|
fixedValuePointPatchVectorField(ptf, iF),
|
||||||
axis_(ptf.axis_),
|
axis_(ptf.axis_),
|
||||||
origin_(ptf.origin_),
|
origin_(ptf.origin_),
|
||||||
angle0_(ptf.angle0_),
|
angle0_(ptf.angle0_),
|
||||||
|
@ -123,32 +123,6 @@ angularOscillatingVelocityPointPatchVectorField
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void angularOscillatingVelocityPointPatchVectorField::autoMap
|
|
||||||
(
|
|
||||||
const pointPatchFieldMapper& m
|
|
||||||
)
|
|
||||||
{
|
|
||||||
fixedValuePointPatchField<vector>::autoMap(m);
|
|
||||||
|
|
||||||
p0_.autoMap(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void angularOscillatingVelocityPointPatchVectorField::rmap
|
|
||||||
(
|
|
||||||
const pointPatchField<vector>& ptf,
|
|
||||||
const labelList& addr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const angularOscillatingVelocityPointPatchVectorField& aOVptf =
|
|
||||||
refCast<const angularOscillatingVelocityPointPatchVectorField>(ptf);
|
|
||||||
|
|
||||||
fixedValuePointPatchField<vector>::rmap(aOVptf, addr);
|
|
||||||
|
|
||||||
p0_.rmap(aOVptf.p0_, addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void angularOscillatingVelocityPointPatchVectorField::updateCoeffs()
|
void angularOscillatingVelocityPointPatchVectorField::updateCoeffs()
|
||||||
{
|
{
|
||||||
if (this->updated())
|
if (this->updated())
|
||||||
|
@ -172,10 +146,10 @@ void angularOscillatingVelocityPointPatchVectorField::updateCoeffs()
|
||||||
+ (axisHat ^ p0Rel*sin(angle))
|
+ (axisHat ^ p0Rel*sin(angle))
|
||||||
+ (axisHat & p0Rel)*(1 - cos(angle))*axisHat
|
+ (axisHat & p0Rel)*(1 - cos(angle))*axisHat
|
||||||
- p.localPoints()
|
- p.localPoints()
|
||||||
)/t.deltaTValue()
|
)/t.deltaT().value()
|
||||||
);
|
);
|
||||||
|
|
||||||
fixedValuePointPatchField<vector>::updateCoeffs();
|
fixedValuePointPatchVectorField::updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,9 @@ License
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::angularOscillatingVelocityPointPatchVectorField
|
angularOscillatingVelocityPointPatchVectorField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::angularOscillatingVelocityPointPatchVectorField
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
angularOscillatingVelocityPointPatchVectorField.C
|
angularOscillatingVelocityPointPatchVectorField.C
|
||||||
|
@ -36,7 +35,7 @@ SourceFiles
|
||||||
#ifndef angularOscillatingVelocityPointPatchVectorField_H
|
#ifndef angularOscillatingVelocityPointPatchVectorField_H
|
||||||
#define angularOscillatingVelocityPointPatchVectorField_H
|
#define angularOscillatingVelocityPointPatchVectorField_H
|
||||||
|
|
||||||
#include "fixedValuePointPatchField.H"
|
#include "fixedValuePointPatchFields.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -49,7 +48,14 @@ namespace Foam
|
||||||
|
|
||||||
class angularOscillatingVelocityPointPatchVectorField
|
class angularOscillatingVelocityPointPatchVectorField
|
||||||
:
|
:
|
||||||
public fixedValuePointPatchField<vector>
|
public FixedValuePointPatchField
|
||||||
|
<
|
||||||
|
pointPatchField,
|
||||||
|
pointMesh,
|
||||||
|
pointPatch,
|
||||||
|
DummyMatrix,
|
||||||
|
vector
|
||||||
|
>
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
@ -91,7 +97,7 @@ public:
|
||||||
const angularOscillatingVelocityPointPatchVectorField&,
|
const angularOscillatingVelocityPointPatchVectorField&,
|
||||||
const pointPatch&,
|
const pointPatch&,
|
||||||
const DimensionedField<vector, pointMesh>&,
|
const DimensionedField<vector, pointMesh>&,
|
||||||
const pointPatchFieldMapper&
|
const PointPatchFieldMapper&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
|
@ -99,10 +105,7 @@ public:
|
||||||
{
|
{
|
||||||
return autoPtr<pointPatchField<vector> >
|
return autoPtr<pointPatchField<vector> >
|
||||||
(
|
(
|
||||||
new angularOscillatingVelocityPointPatchVectorField
|
new angularOscillatingVelocityPointPatchVectorField(*this)
|
||||||
(
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,33 +124,13 @@ public:
|
||||||
{
|
{
|
||||||
return autoPtr<pointPatchField<vector> >
|
return autoPtr<pointPatchField<vector> >
|
||||||
(
|
(
|
||||||
new angularOscillatingVelocityPointPatchVectorField
|
new angularOscillatingVelocityPointPatchVectorField(*this, iF)
|
||||||
(
|
|
||||||
*this,
|
|
||||||
iF
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
// Mapping functions
|
|
||||||
|
|
||||||
//- Map (and resize as needed) from self given a mapping object
|
|
||||||
virtual void autoMap
|
|
||||||
(
|
|
||||||
const pointPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Reverse map the given pointPatchField onto this pointPatchField
|
|
||||||
virtual void rmap
|
|
||||||
(
|
|
||||||
const pointPatchField<vector>&,
|
|
||||||
const labelList&
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the coefficients associated with the patch field
|
||||||
|
|
|
@ -44,7 +44,7 @@ oscillatingDisplacementPointPatchVectorField
|
||||||
const DimensionedField<vector, pointMesh>& iF
|
const DimensionedField<vector, pointMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(p, iF),
|
fixedValuePointPatchVectorField(p, iF),
|
||||||
amplitude_(vector::zero),
|
amplitude_(vector::zero),
|
||||||
omega_(0.0)
|
omega_(0.0)
|
||||||
{}
|
{}
|
||||||
|
@ -58,7 +58,7 @@ oscillatingDisplacementPointPatchVectorField
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(p, iF, dict),
|
fixedValuePointPatchVectorField(p, iF, dict),
|
||||||
amplitude_(dict.lookup("amplitude")),
|
amplitude_(dict.lookup("amplitude")),
|
||||||
omega_(readScalar(dict.lookup("omega")))
|
omega_(readScalar(dict.lookup("omega")))
|
||||||
{
|
{
|
||||||
|
@ -75,10 +75,10 @@ oscillatingDisplacementPointPatchVectorField
|
||||||
const oscillatingDisplacementPointPatchVectorField& ptf,
|
const oscillatingDisplacementPointPatchVectorField& ptf,
|
||||||
const pointPatch& p,
|
const pointPatch& p,
|
||||||
const DimensionedField<vector, pointMesh>& iF,
|
const DimensionedField<vector, pointMesh>& iF,
|
||||||
const pointPatchFieldMapper& mapper
|
const PointPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
|
fixedValuePointPatchVectorField(ptf, p, iF, mapper),
|
||||||
amplitude_(ptf.amplitude_),
|
amplitude_(ptf.amplitude_),
|
||||||
omega_(ptf.omega_)
|
omega_(ptf.omega_)
|
||||||
{}
|
{}
|
||||||
|
@ -91,7 +91,7 @@ oscillatingDisplacementPointPatchVectorField
|
||||||
const DimensionedField<vector, pointMesh>& iF
|
const DimensionedField<vector, pointMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(ptf, iF),
|
fixedValuePointPatchVectorField(ptf, iF),
|
||||||
amplitude_(ptf.amplitude_),
|
amplitude_(ptf.amplitude_),
|
||||||
omega_(ptf.omega_)
|
omega_(ptf.omega_)
|
||||||
{}
|
{}
|
||||||
|
@ -111,7 +111,7 @@ void oscillatingDisplacementPointPatchVectorField::updateCoeffs()
|
||||||
|
|
||||||
Field<vector>::operator=(amplitude_*sin(omega_*t.value()));
|
Field<vector>::operator=(amplitude_*sin(omega_*t.value()));
|
||||||
|
|
||||||
fixedValuePointPatchField<vector>::updateCoeffs();
|
fixedValuePointPatchVectorField::updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,9 @@ License
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::oscillatingDisplacementPointPatchVectorField
|
oscillatingDisplacementPointPatchVectorField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::oscillatingDisplacementPointPatchVectorField
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
oscillatingDisplacementPointPatchVectorField.C
|
oscillatingDisplacementPointPatchVectorField.C
|
||||||
|
@ -36,7 +35,7 @@ SourceFiles
|
||||||
#ifndef oscillatingDisplacementPointPatchVectorField_H
|
#ifndef oscillatingDisplacementPointPatchVectorField_H
|
||||||
#define oscillatingDisplacementPointPatchVectorField_H
|
#define oscillatingDisplacementPointPatchVectorField_H
|
||||||
|
|
||||||
#include "fixedValuePointPatchField.H"
|
#include "fixedValuePointPatchFields.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -49,7 +48,14 @@ namespace Foam
|
||||||
|
|
||||||
class oscillatingDisplacementPointPatchVectorField
|
class oscillatingDisplacementPointPatchVectorField
|
||||||
:
|
:
|
||||||
public fixedValuePointPatchField<vector>
|
public FixedValuePointPatchField
|
||||||
|
<
|
||||||
|
pointPatchField,
|
||||||
|
pointMesh,
|
||||||
|
pointPatch,
|
||||||
|
DummyMatrix,
|
||||||
|
vector
|
||||||
|
>
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
@ -86,7 +92,7 @@ public:
|
||||||
const oscillatingDisplacementPointPatchVectorField&,
|
const oscillatingDisplacementPointPatchVectorField&,
|
||||||
const pointPatch&,
|
const pointPatch&,
|
||||||
const DimensionedField<vector, pointMesh>&,
|
const DimensionedField<vector, pointMesh>&,
|
||||||
const pointPatchFieldMapper&
|
const PointPatchFieldMapper&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
|
@ -94,10 +100,7 @@ public:
|
||||||
{
|
{
|
||||||
return autoPtr<pointPatchField<vector> >
|
return autoPtr<pointPatchField<vector> >
|
||||||
(
|
(
|
||||||
new oscillatingDisplacementPointPatchVectorField
|
new oscillatingDisplacementPointPatchVectorField(*this)
|
||||||
(
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,11 +119,7 @@ public:
|
||||||
{
|
{
|
||||||
return autoPtr<pointPatchField<vector> >
|
return autoPtr<pointPatchField<vector> >
|
||||||
(
|
(
|
||||||
new oscillatingDisplacementPointPatchVectorField
|
new oscillatingDisplacementPointPatchVectorField(*this, iF)
|
||||||
(
|
|
||||||
*this,
|
|
||||||
iF
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue