Merge branch 'HrvojeJasak'

This commit is contained in:
Hrvoje Jasak 2011-01-13 20:52:40 +00:00
commit 33dc790f18
144 changed files with 1217 additions and 472 deletions

View file

@ -204,8 +204,8 @@ setenv OPENMPI_COMPILE_FLAGS "\`mpicc --showme:compile\`"
setenv OPENMPI_LINK_FLAGS "\`mpicc --showme:link\`" setenv OPENMPI_LINK_FLAGS "\`mpicc --showme:link\`"
# Set the OpenFOAM compilation flags # Set the OpenFOAM compilation flags
setenv PINC \`echo \$OPENMPI_COMPILE_FLAGS\` setenv PINC "\$OPENMPI_COMPILE_FLAGS"
setenv PLIBS \`echo \$OPENMPI_LINK_FLAGS\` setenv PLIBS "\$OPENMPI_LINK_FLAGS"
if (\$?FOAM_VERBOSE && \$?prompt) then if (\$?FOAM_VERBOSE && \$?prompt) then

View file

@ -7,4 +7,5 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lrandomProcesses \ -lrandomProcesses \
-lsampling \ -lsampling \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -8,4 +8,5 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lrhoCentralFoam -lrhoCentralFoam \
-llduSolvers

View file

@ -11,4 +11,5 @@ EXE_LIBS = \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -11,4 +11,5 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels -lcompressibleLESModels \
-llduSolvers

View file

@ -13,4 +13,5 @@ EXE_LIBS = \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -11,4 +11,5 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -4,4 +4,5 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lrhopSonicFoam -lrhopSonicFoam \
-llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -6,4 +6,5 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -1,4 +1,6 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = -lfiniteVolume EXE_LIBS = \
-lfiniteVolume \
-llduSolvers

View file

@ -1,3 +1,5 @@
EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = -lfiniteVolume EXE_LIBS = \
-lfiniteVolume \
-llduSolvers

View file

@ -1,4 +1,6 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = -lfiniteVolume EXE_LIBS = \
-lfiniteVolume \
-llduSolvers

View file

@ -13,4 +13,5 @@ EXE_LIBS = \
-ltopoChangerFvMesh \ -ltopoChangerFvMesh \
-lmeshTools \ -lmeshTools \
-lfiniteVolume \ -lfiniteVolume \
$(WM_DECOMP_LIBS) $(WM_DECOMP_LIBS) \
-llduSolvers

View file

@ -18,4 +18,5 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lmeshTools \ -lmeshTools \
-lfiniteVolume \ -lfiniteVolume \
$(WM_DECOMP_LIBS) $(WM_DECOMP_LIBS) \
-llduSolvers

View file

@ -20,4 +20,5 @@ EXE_LIBS = \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume \ -lfiniteVolume \
$(WM_DECOMP_LIBS) $(WM_DECOMP_LIBS) \
-llduSolvers

View file

@ -5,4 +5,5 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lsampling \ -lsampling \
-lmeshTools \ -lmeshTools \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -2,4 +2,5 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -11,4 +11,5 @@ EXE_LIBS = \
-lincompressibleTurbulenceModel \ -lincompressibleTurbulenceModel \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lincompressibleTransportModels -lincompressibleTransportModels \
-llduSolvers

View file

@ -9,4 +9,5 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels -lincompressibleTransportModels \
-llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -14,4 +14,5 @@ EXE_LIBS = \
-lradiation \ -lradiation \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -15,4 +15,5 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -14,4 +14,5 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels -lcompressibleLESModels \
-llduSolvers

View file

@ -11,4 +11,5 @@ EXE_LIBS = \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lsampling -lsampling \
-llduSolvers

View file

@ -11,4 +11,5 @@ EXE_LIBS = \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -5,4 +5,5 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lincompressibleTransportModels -lincompressibleTransportModels \
-llduSolvers

View file

@ -16,4 +16,5 @@ EXE_LIBS = \
-lincompressibleTurbulenceModel \ -lincompressibleTurbulenceModel \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -11,4 +11,5 @@ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -2,4 +2,5 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -8,4 +8,5 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -37,4 +37,5 @@ EXE_LIBS = \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiation \
-lODE -lODE \
-llduSolvers

View file

@ -36,4 +36,5 @@ EXE_LIBS = \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiation \
-lODE -lODE \
-llduSolvers

View file

@ -35,4 +35,5 @@ EXE_LIBS = \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiation \
-lODE -lODE \
-llduSolvers

View file

@ -20,4 +20,5 @@ EXE_LIBS = \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -2,4 +2,5 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -12,4 +12,5 @@ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lfiniteVolume \ -lfiniteVolume \
-lbarotropicCompressibilityModel -lbarotropicCompressibilityModel \
-llduSolvers

View file

@ -17,5 +17,6 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools \ -lmeshTools \
-ldynamicFvMesh -ldynamicFvMesh \
-llduSolvers

View file

@ -11,4 +11,5 @@ EXE_LIBS = \
-lincompressibleTurbulenceModel \ -lincompressibleTurbulenceModel \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -15,4 +15,5 @@ EXE_LIBS = \
-lincompressibleTurbulenceModel \ -lincompressibleTurbulenceModel \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -16,5 +16,6 @@ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-llduSolvers

View file

@ -2,4 +2,5 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -11,4 +11,5 @@ EXE_LIBS = \
-lincompressibleTurbulenceModel \ -lincompressibleTurbulenceModel \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lfiniteVolume -lfiniteVolume \
-llduSolvers

View file

@ -12,4 +12,5 @@ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools \ -lmeshTools \
-lfiniteVolume \ -lfiniteVolume \
-lfiniteArea -lfiniteArea \
-llduSolvers

View file

@ -13,5 +13,4 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-ldynamicMesh \ -ldynamicMesh \
$(WM_DECOMP_LIBS) \ $(WM_DECOMP_LIBS)
-llduSolvers

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2007 Z. Tukovic and H. Jasak \\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,6 +28,11 @@ License
#include "freeSurface.H" #include "freeSurface.H"
#include "primitivePatchInterpolation.H" #include "primitivePatchInterpolation.H"
#include "emptyFaPatch.H" #include "emptyFaPatch.H"
#include "wedgeFaPatch.H"
#include "PstreamCombineReduceOps.H"
#include "coordinateSystem.H"
#include "scalarMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -37,16 +42,13 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
tmp<vectorField> freeSurface::pointDisplacement(const scalarField& deltaH) tmp<vectorField> freeSurface::pointDisplacement(const scalarField& deltaH)
{ {
const pointField& points = aMesh().patch().localPoints(); const pointField& points = aMesh().patch().localPoints();
const labelListList& pointFaces = aMesh().patch().pointFaces(); const labelListList& pointFaces = aMesh().patch().pointFaces();
controlPoints() += facesDisplacementDir()*deltaH; controlPoints() += facesDisplacementDir()*deltaH;
tmp<vectorField> tdisplacement tmp<vectorField> tdisplacement
( (
new vectorField new vectorField
@ -60,9 +62,8 @@ tmp<vectorField> freeSurface::pointDisplacement(const scalarField& deltaH)
// Calculate displacement of internal points // Calculate displacement of internal points
const vectorField& pointNormals = aMesh().pointAreaNormals();
const edgeList& edges = aMesh().patch().edges(); const edgeList& edges = aMesh().patch().edges();
labelList internalPoints = aMesh().internalPoints(); labelList internalPoints = aMesh().internalPoints();
forAll (internalPoints, pointI) forAll (internalPoints, pointI)
@ -71,64 +72,88 @@ tmp<vectorField> freeSurface::pointDisplacement(const scalarField& deltaH)
const labelList& curPointFaces = pointFaces[curPoint]; const labelList& curPointFaces = pointFaces[curPoint];
tensor M = tensor::zero; vectorField lsPoints(curPointFaces.size(), vector::zero);
vector S = vector::zero; for (label i=0; i<curPointFaces.size(); i++)
scalarField w(curPointFaces.size(), 0.0);
forAll (curPointFaces, faceI)
{ {
label curFace = curPointFaces[faceI]; label curFace = curPointFaces[i];
w[faceI] = 1.0/mag lsPoints[i] = controlPoints()[curFace];
}
vectorField pointAndNormal =
lsPlanePointAndNormal
( (
controlPoints()[curFace] lsPoints,
- points[curPoint] points[curPoint],
pointNormals[curPoint]
); );
}
w /= sum(w); vector& P = pointAndNormal[0];
vector& N = pointAndNormal[1];
forAll (curPointFaces, faceI)
{
label curFace = curPointFaces[faceI];
M = M + sqr(w[faceI])*sqr(controlPoints()[curFace]);
S += sqr(w[faceI])*controlPoints()[curFace];
}
vector N = inv(M) & S;
N /= mag(N);
scalar p = (S&N)/sum(sqr(w));
displacement[curPoint] = displacement[curPoint] =
pointsDisplacementDir()[curPoint]* pointsDisplacementDir()[curPoint]
(p - (points[curPoint]&N))/ *((P - points[curPoint])&N)
(pointsDisplacementDir()[curPoint]&N); /(pointsDisplacementDir()[curPoint]&N);
} }
// Mirror control points
FieldField<Field, vector> patchMirrorPoints(aMesh().boundary().size());
// Calculate displacement of points which belonge to empty patches forAll(patchMirrorPoints, patchI)
{
patchMirrorPoints.set
(
patchI,
new vectorField
(
aMesh().boundary()[patchI].faPatch::size(),
vector::zero
)
);
vectorField N =
aMesh().boundary()[patchI].ngbPolyPatchFaceNormals();
const labelList peFaces =
labelList::subList
(
aMesh().edgeOwner(),
aMesh().boundary()[patchI].faPatch::size(),
aMesh().boundary()[patchI].start()
);
const labelList& pEdges = aMesh().boundary()[patchI];
vectorField peCentres(pEdges.size(), vector::zero);
forAll(peCentres, edgeI)
{
peCentres[edgeI] =
edges[pEdges[edgeI]].centre(points);
}
vectorField delta =
vectorField(controlPoints(), peFaces)
- peCentres;
patchMirrorPoints[patchI] =
peCentres + ((I - 2*N*N)&delta);
}
// Calculate displacement of boundary points
labelList boundaryPoints = aMesh().boundaryPoints(); labelList boundaryPoints = aMesh().boundaryPoints();
const labelListList& edgeFaces = aMesh().patch().edgeFaces(); const labelListList& edgeFaces = aMesh().patch().edgeFaces();
const labelListList& pointEdges = aMesh().patch().pointEdges(); const labelListList& pointEdges = aMesh().patch().pointEdges();
vectorField pointNormals = aMesh().pointAreaNormals();
forAll (boundaryPoints, pointI) forAll (boundaryPoints, pointI)
{ {
label curPoint = boundaryPoints[pointI]; label curPoint = boundaryPoints[pointI];
if (motionPointsMask()[curPoint]) if (motionPointsMask()[curPoint] == 1)
{ {
// Calculating mirror points // Calculating mirror points
const labelList& curPointEdges = pointEdges[curPoint]; const labelList& curPointEdges = pointEdges[curPoint];
@ -140,146 +165,380 @@ tmp<vectorField> freeSurface::pointDisplacement(const scalarField& deltaH)
forAll (curPointEdges, edgeI) forAll (curPointEdges, edgeI)
{ {
label curEdge = curPointEdges[edgeI]; label curEdge = curPointEdges[edgeI];
if(edgeFaces[curEdge].size() == 1) if(edgeFaces[curEdge].size() == 1)
{ {
vector nE = label patchID = -1;
pointNormals[edges[curEdge].start()] label edgeID = -1;
+ pointNormals[edges[curEdge].end()]; forAll(aMesh().boundary(), patchI)
{
const labelList& pEdges =
aMesh().boundary()[patchI];
label index = findIndex(pEdges, curEdge);
if (index != -1)
{
patchID = patchI;
edgeID = index;
break;
}
}
nE /= mag(nE); mirrorPoints[++counter] =
patchMirrorPoints[patchID][edgeID];
vector eP =
controlPoints()[edgeFaces[curEdge][0]]
- edges[curEdge].centre(points);
mirrorPoints[++counter] =
edges[curEdge].centre(points)
+ ((2.0*nE*nE - I)&eP);
} }
} }
// Calculating LS plane fit
// Calculating LS plane interpolation
const labelList& curPointFaces = pointFaces[curPoint]; const labelList& curPointFaces = pointFaces[curPoint];
tensor M = tensor::zero; vectorField lsPoints
(
curPointFaces.size() + mirrorPoints.size(),
vector::zero
);
vector S = vector::zero; counter = -1;
scalarField w(curPointFaces.size() + 2, 0.0); for (label i=0; i<curPointFaces.size(); i++)
forAll (curPointFaces, faceI)
{ {
label curFace = curPointFaces[faceI]; label curFace = curPointFaces[i];
w[faceI] = 1.0/mag lsPoints[++counter] = controlPoints()[curFace];
(
controlPoints()[curFace]
- points[curPoint]
);
} }
forAll (mirrorPoints, pI) for (label i=0; i<mirrorPoints.size(); i++)
{ {
w[curPointFaces.size() + pI] = 1.0/mag lsPoints[++counter] = mirrorPoints[i];
(
mirrorPoints[pI]
- points[curPoint]
);
} }
w /= sum(w); vectorField pointAndNormal =
lsPlanePointAndNormal
(
lsPoints,
points[curPoint],
pointNormals[curPoint]
);
vector& P = pointAndNormal[0];
forAll (curPointFaces, faceI) vector& N = pointAndNormal[1];
{
label curFace = curPointFaces[faceI];
M = M + sqr(w[faceI])*sqr(controlPoints()[curFace]);
S += sqr(w[faceI])*controlPoints()[curFace];
}
forAll (mirrorPoints, pI)
{
M = M + sqr(w[curPointFaces.size()+pI])*sqr(mirrorPoints[pI]);
S += sqr(w[curPointFaces.size()+pI])*mirrorPoints[pI];
}
vector N = inv(M)&S;
N /= mag(N);
scalar p = (S&N)/sum(sqr(w));
displacement[curPoint] = displacement[curPoint] =
pointsDisplacementDir()[curPoint]* pointsDisplacementDir()[curPoint]
(p - (points[curPoint]&N))/ *((P - points[curPoint])&N)
(pointsDisplacementDir()[curPoint]&N); /(pointsDisplacementDir()[curPoint]&N);
} }
} }
forAll(aMesh().boundary(), patchI)
// Calculate displacement of axis point
forAll (aMesh().boundary(), patchI)
{ {
bool fixedPatch = false; if
forAll(fixedFreeSurfacePatches_, fpI)
{
label fixedPatchID = aMesh().boundary().findPatchID
(
fixedFreeSurfacePatches_[fpI]
);
if (fixedPatchID == patchI)
{
fixedPatch = true;
}
}
if
( (
( aMesh().boundary()[patchI].type()
aMesh().boundary()[patchI].type() == wedgeFaPatch::typeName
!= emptyFaPatch::typeName
)
&& !fixedPatch
) )
{ {
labelList patchPoints = const wedgeFaPatch& wedgePatch =
aMesh().boundary()[patchI].pointLabels(); refCast<const wedgeFaPatch>(aMesh().boundary()[patchI]);
labelListList patchPointEdges = if(wedgePatch.axisPoint() > -1)
aMesh().boundary()[patchI].pointEdges();
unallocLabelList patchEdgeFaces =
aMesh().boundary()[patchI].edgeFaces();
forAll(patchPoints, pointI)
{ {
forAll(patchPointEdges[pointI], edgeI) label axisPoint = wedgePatch.axisPoint();
{
label curEdge = patchPointEdges[pointI][edgeI]; displacement[axisPoint] =
pointsDisplacementDir()[axisPoint]
displacement[patchPoints[pointI]] += *(
pointsDisplacementDir()[patchPoints[pointI]]* pointsDisplacementDir()[axisPoint]
deltaH[patchEdgeFaces[curEdge]]; &(
} controlPoints()[pointFaces[axisPoint][0]]
- points[axisPoint]
displacement[patchPoints[pointI]] /= )
patchPointEdges[pointI].size(); );
} }
} }
} }
// Calculate displacement of processor patch points
forAll (aMesh().boundary(), patchI)
{
if
(
aMesh().boundary()[patchI].type()
== processorFaPatch::typeName
)
{
const processorFaPatch& procPatch =
refCast<const processorFaPatch>(aMesh().boundary()[patchI]);
const labelList& patchPointLabels =
procPatch.pointLabels();
FieldField<Field, vector> lsPoints(patchPointLabels.size());
forAll(lsPoints, pointI)
{
lsPoints.set(pointI, new vectorField(0, vector::zero));
}
const labelList& nonGlobalPatchPoints =
procPatch.nonGlobalPatchPoints();
forAll(nonGlobalPatchPoints, pointI)
{
label curPatchPoint =
nonGlobalPatchPoints[pointI];
label curPoint =
patchPointLabels[curPatchPoint];
const labelList& curPointFaces = pointFaces[curPoint];
lsPoints[curPatchPoint].setSize(curPointFaces.size());
forAll(curPointFaces, faceI)
{
label curFace = curPointFaces[faceI];
lsPoints[curPatchPoint][faceI] = controlPoints()[curFace];
}
# include "boundaryProcessorFaPatchPoints.H"
}
scalar lsPointsSize = 0;
forAll(lsPoints, pointI)
{
lsPointsSize +=
2*lsPoints[pointI].size()*sizeof(vector);
}
// Parallel data exchange
{
OPstream toNeighbProc
(
Pstream::blocking,
procPatch.neighbProcNo(),
lsPointsSize
);
toNeighbProc << lsPoints;
}
FieldField<Field, vector> ngbLsPoints(patchPointLabels.size());
{
IPstream fromNeighbProc
(
Pstream::blocking,
procPatch.neighbProcNo(),
lsPointsSize
);
fromNeighbProc >> ngbLsPoints;
}
forAll(nonGlobalPatchPoints, pointI)
{
label curPatchPoint =
nonGlobalPatchPoints[pointI];
label curPoint =
patchPointLabels[curPatchPoint];
label curNgbPoint = procPatch.neighbPoints()[curPatchPoint];
vectorField allLsPoints
(
lsPoints[curPatchPoint].size()
+ ngbLsPoints[curNgbPoint].size(),
vector::zero
);
label counter = -1;
forAll(lsPoints[curPatchPoint], pointI)
{
allLsPoints[++counter] = lsPoints[curPatchPoint][pointI];
}
forAll(ngbLsPoints[curNgbPoint], pointI)
{
allLsPoints[++counter] = ngbLsPoints[curNgbPoint][pointI];
}
vectorField pointAndNormal =
lsPlanePointAndNormal
(
allLsPoints,
points[curPoint],
pointNormals[curPoint]
);
vector& P = pointAndNormal[0];
vector& N = pointAndNormal[1];
if (motionPointsMask()[curPoint] != 0)
{
displacement[curPoint] =
pointsDisplacementDir()[curPoint]
*((P - points[curPoint])&N)
/(pointsDisplacementDir()[curPoint]&N);
}
}
}
}
// Calculate displacement of global processor patch points
if (aMesh().globalData().nGlobalPoints() > 0)
{
const labelList& spLabels =
aMesh().globalData().sharedPointLabels();
const labelList& addr = aMesh().globalData().sharedPointAddr();
for (label k=0; k<aMesh().globalData().nGlobalPoints(); k++)
{
List<List<vector> > procLsPoints(Pstream::nProcs());
label curSharedPointIndex = findIndex(addr, k);
if (curSharedPointIndex != -1)
{
label curPoint = spLabels[curSharedPointIndex];
const labelList& curPointFaces = pointFaces[curPoint];
procLsPoints[Pstream::myProcNo()] =
List<vector>(curPointFaces.size());
forAll (curPointFaces, faceI)
{
label curFace = curPointFaces[faceI];
procLsPoints[Pstream::myProcNo()][faceI] =
controlPoints()[curFace];
}
}
Pstream::gatherList(procLsPoints);
Pstream::scatterList(procLsPoints);
if (curSharedPointIndex != -1)
{
label curPoint = spLabels[curSharedPointIndex];
label nAllPoints = 0;
forAll(procLsPoints, procI)
{
nAllPoints += procLsPoints[procI].size();
}
vectorField allPoints(nAllPoints, vector::zero);
label counter = 0;
forAll(procLsPoints, procI)
{
forAll(procLsPoints[procI], pointI)
{
allPoints[counter++] =
procLsPoints[procI][pointI];
}
}
vectorField pointAndNormal =
lsPlanePointAndNormal
(
allPoints,
points[curPoint],
pointNormals[curPoint]
);
const vector& P = pointAndNormal[0];
const vector& N = pointAndNormal[1];
displacement[curPoint] =
pointsDisplacementDir()[curPoint]
*((P - points[curPoint])&N)
/(pointsDisplacementDir()[curPoint]&N);
}
}
}
return tdisplacement; return tdisplacement;
} }
tmp<vectorField> freeSurface::lsPlanePointAndNormal
(
const vectorField& points,
const vector& origin,
const vector& axis
) const
{
// LS in local CS
vector dir = (points[0] - origin);
dir -= axis*(axis&dir);
dir /= mag(dir);
coordinateSystem cs("cs", origin, axis, dir);
vectorField localPoints = cs.localPosition(points);
scalarField W = 1.0/(mag(points - origin) + SMALL);
scalarRectangularMatrix M
(
points.size(),
3,
0.0
);
for (label i=0; i<localPoints.size(); i++)
{
M[i][0] = localPoints[i].x();
M[i][1] = localPoints[i].y();
M[i][2] = 1.0;
}
scalarSquareMatrix MtM(3, 0.0);
for (label i = 0; i < MtM.n(); i++)
{
for (label j = 0; j < MtM.m(); j++)
{
for (label k = 0; k < M.n(); k++)
{
MtM[i][j] += M[k][i]*M[k][j]*W[k];
}
}
}
scalarField MtR(3, 0);
for (label i = 0; i < MtR.size(); i++)
{
for (label j = 0; j < M.n(); j++)
{
MtR[i] += M[j][i]*localPoints[j].z()*W[j];
}
}
scalarSquareMatrix::LUsolve(MtM, MtR);
vector n0 = vector(-MtR[0], -MtR[1], 1);
n0 = cs.globalVector(n0);
n0 /= mag(n0);
vector p0 = vector(0, 0, MtR[2]);
p0 = cs.globalPosition(p0);
tmp<vectorField> pointAndNormal
(
new vectorField(2, vector::zero)
);
pointAndNormal()[0] = p0;
pointAndNormal()[1] = n0;
return pointAndNormal;
}
// tmp<vectorField> freeSurface::pointDisplacementSM() // tmp<vectorField> freeSurface::pointDisplacementSM()
// { // {

View file

@ -12,4 +12,5 @@ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools \ -lmeshTools \
-lfiniteVolume \ -lfiniteVolume \
-lfiniteArea -lfiniteArea \
-llduSolvers

View file

@ -1,3 +1,3 @@
moveDyEngineMesh.C moveDyMEngineMesh.C
EXE = $(FOAM_APPBIN)/moveDyEngineMesh EXE = $(FOAM_APPBIN)/moveDyMEngineMesh

View file

@ -34,6 +34,7 @@ Description
#include "IOmanip.H" #include "IOmanip.H"
#include "BisectionRoot.H" #include "BisectionRoot.H"
#include "RiddersRoot.H" #include "RiddersRoot.H"
#include "NewtonSecantRoot.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,15 +51,38 @@ public:
} }
}; };
class testFunctionDerivative
{
public:
testFunctionDerivative()
{}
scalar operator()(const scalar& x) const
{
return 0.5*Foam::pow(x,-1.5) - Foam::cos(x);
}
};
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
testFunction tf; testFunction tf;
testFunctionDerivative df;
Info<< setprecision(10) Info<< setprecision(10)
<< "Bisection root " << "Bisection root "
<< BisectionRoot<testFunction>(tf, 1e-5).root(0, 10) << nl << BisectionRoot<testFunction>(tf, 1e-5).root(0, 10) << nl
<< "Ridders root " << "Ridders root "
<< RiddersRoot<testFunction>(tf, 1e-5).root(0, 10) << endl; << RiddersRoot<testFunction>(tf, 1e-5).root(0, 10) << nl
<< "NewtonSecant root "
<< NewtonSecantRoot<testFunction,testFunctionDerivative>
(
tf,
df,
1e-5
).root(1.5) << endl;
Info<< "End\n" << endl; Info<< "End\n" << endl;

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #
@ -40,12 +40,12 @@
PROGNAME=${0##*/} PROGNAME=${0##*/}
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
#- User settings #- User settings
#- Number of days for files to be considered old #- Number of days for files to be considered old
NDAYSLIMIT=7 NDAYSLIMIT=7
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
#- work file #- work file
TMPFILE=/tmp/${PROGNAME}$$.tmp TMPFILE=/tmp/${PROGNAME}$$.tmp
@ -62,11 +62,11 @@ else
fi fi
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# #
# Functions # Functions
# #
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# getRawEntry dictionary entry # getRawEntry dictionary entry
# Prints value of dictionary entry # Prints value of dictionary entry
@ -169,11 +169,11 @@ LABEL
} }
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# #
# Main # Main
# #
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
#- Check a few things #- Check a few things

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #
@ -35,16 +35,16 @@
# - controlDict modified # - controlDict modified
# to restore controlDict # to restore controlDict
# #
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
PROGNAME=`basename $0` PROGNAME=`basename $0`
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# #
# Functions # Functions
# #
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# getNumberedLine dictionary entry # getNumberedLine dictionary entry
# Prints dictionary entry line + lineno # Prints dictionary entry line + lineno
@ -185,11 +185,11 @@ restoreDict() {
} }
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# #
# Main # Main
# #
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
ARCH=`uname -s` ARCH=`uname -s`

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #
@ -38,7 +38,7 @@
# && _foamSource $foamPrefs # && _foamSource $foamPrefs
# @endverbatim # @endverbatim
# #
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
usage() { usage() {
[ "$quietOpt" = true ] && exit 1 [ "$quietOpt" = true ] && exit 1
@ -76,7 +76,7 @@ USAGE
# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/ # This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version) # or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
# #
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# the bindir: # the bindir:
binDir="${0%/*}" binDir="${0%/*}"

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #
@ -38,11 +38,11 @@ JOBSTRING='%4s %8s %20s %10s %8s %4s %12s %12s %20s\n'
DEFSTATEFILE=$HOME/.OpenFOAM/foamCheckJobs.out DEFSTATEFILE=$HOME/.OpenFOAM/foamCheckJobs.out
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# #
# Functions # Functions
# #
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
printUsage() { printUsage() {
cat << LABEL cat << LABEL
@ -98,11 +98,11 @@ leftStr() {
echo "$2" | sed -e "s/\(.\{$1\}\).*/\1/" echo "$2" | sed -e "s/\(.\{$1\}\).*/\1/"
} }
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# #
# Main # Main
# #
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
if [ ! "$FOAM_JOB_DIR" ]; then if [ ! "$FOAM_JOB_DIR" ]; then
echo "$PROGNAME : FOAM_JOB_DIR environment variable not set." echo "$PROGNAME : FOAM_JOB_DIR environment variable not set."

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #
@ -37,7 +37,7 @@
# #
# Tested on Linux,IRIX,SunOS # Tested on Linux,IRIX,SunOS
# #
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
PROGNAME=`basename $0` PROGNAME=`basename $0`
TMPFILE=/tmp/${PROGNAME}$$.tmp TMPFILE=/tmp/${PROGNAME}$$.tmp

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -107,4 +107,29 @@ cloneCase ()
fi fi
} }
makeFsiCaseLinks ()
{
cd $1
cd system
ln -s ../../$2/system $2
cd ../constant
ln -s ../../$2/constant $2
cd ../0
ln -s ../../$2/0 $2
cd ../..
}
makeFsiResultsLinks ()
{
cd $1
TIME_DIRS=`foamInfoExec -times | sed '1,/constant/d'`
echo "makeFsiResultsLinks for" $TIME_DIRS
cd ../$2
for T in $TIME_DIRS
do
ln -s ../$1/${T}/solid ${T}
done
cd ..
}
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -5,7 +5,7 @@
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright held by original author # \\ / A nd | Copyright held by original author
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
# #

View file

@ -37,7 +37,7 @@ alias _foamAddPath 'set path=(\!* $path)'
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}' alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
# location of the jobControl directory # location of the jobControl directory
setenv FOAM_JOB_DIR $HOME/$WM_PROJECT/jobControl setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
# wmake configuration # wmake configuration
setenv WM_DIR $WM_PROJECT_DIR/wmake setenv WM_DIR $WM_PROJECT_DIR/wmake
@ -52,18 +52,18 @@ setenv WM_DECOMP_LIBS "-lfaceDecompFiniteElement -lfaceDecompositionMotionSolver
# base configuration # base configuration
setenv FOAM_APP $WM_PROJECT_DIR/applications setenv FOAM_APP $WM_PROJECT_DIR/applications
setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
setenv FOAM_LIB $WM_PROJECT_DIR/lib setenv FOAM_LIB $WM_PROJECT_DIR/lib
setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
setenv FOAM_SRC $WM_PROJECT_DIR/src setenv FOAM_SRC $WM_PROJECT_DIR/src
# shared site configuration - similar naming convention as ~OpenFOAM expansion # shared site configuration - similar naming convention as ~OpenFOAM expansion
setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
# user configuration # user configuration
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
# convenience # convenience
setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials

View file

@ -70,7 +70,7 @@ _foamSource()
} }
# location of the jobControl directory # location of the jobControl directory
export FOAM_JOB_DIR=$HOME/$WM_PROJECT/jobControl export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl
# wmake configuration # wmake configuration
export WM_DIR=$WM_PROJECT_DIR/wmake export WM_DIR=$WM_PROJECT_DIR/wmake
@ -85,18 +85,18 @@ export WM_DECOMP_LIBS="-lfaceDecompFiniteElement -lfaceDecompositionMotionSolver
# base configuration # base configuration
export FOAM_APP=$WM_PROJECT_DIR/applications export FOAM_APP=$WM_PROJECT_DIR/applications
export FOAM_APPBIN=$WM_PROJECT_DIR/applications/bin export FOAM_APPBIN=$WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
export FOAM_LIB=$WM_PROJECT_DIR/lib export FOAM_LIB=$WM_PROJECT_DIR/lib
export FOAM_LIBBIN=$WM_PROJECT_DIR/lib export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS
export FOAM_SRC=$WM_PROJECT_DIR/src export FOAM_SRC=$WM_PROJECT_DIR/src
# shared site configuration - similar naming convention as ~OpenFOAM expansion # shared site configuration - similar naming convention as ~OpenFOAM expansion
export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
# user configuration # user configuration
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
# convenience # convenience
export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials

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