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\`"
# Set the OpenFOAM compilation flags
setenv PINC \`echo \$OPENMPI_COMPILE_FLAGS\`
setenv PLIBS \`echo \$OPENMPI_LINK_FLAGS\`
setenv PINC "\$OPENMPI_COMPILE_FLAGS"
setenv PLIBS "\$OPENMPI_LINK_FLAGS"
if (\$?FOAM_VERBOSE && \$?prompt) then

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,6 @@
EXE_INC = \
-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_LIBS = -lfiniteVolume
EXE_LIBS = \
-lfiniteVolume \
-llduSolvers

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2007 Z. Tukovic and H. Jasak
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,6 +28,11 @@ License
#include "freeSurface.H"
#include "primitivePatchInterpolation.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 * * * * * * * * * * * //
tmp<vectorField> freeSurface::pointDisplacement(const scalarField& deltaH)
{
const pointField& points = aMesh().patch().localPoints();
const labelListList& pointFaces = aMesh().patch().pointFaces();
controlPoints() += facesDisplacementDir()*deltaH;
tmp<vectorField> tdisplacement
(
new vectorField
@ -60,9 +62,8 @@ tmp<vectorField> freeSurface::pointDisplacement(const scalarField& deltaH)
// Calculate displacement of internal points
const vectorField& pointNormals = aMesh().pointAreaNormals();
const edgeList& edges = aMesh().patch().edges();
labelList internalPoints = aMesh().internalPoints();
forAll (internalPoints, pointI)
@ -71,64 +72,88 @@ tmp<vectorField> freeSurface::pointDisplacement(const scalarField& deltaH)
const labelList& curPointFaces = pointFaces[curPoint];
tensor M = tensor::zero;
vectorField lsPoints(curPointFaces.size(), vector::zero);
vector S = vector::zero;
scalarField w(curPointFaces.size(), 0.0);
forAll (curPointFaces, faceI)
for (label i=0; i<curPointFaces.size(); i++)
{
label curFace = curPointFaces[faceI];
w[faceI] = 1.0/mag
label curFace = curPointFaces[i];
lsPoints[i] = controlPoints()[curFace];
}
vectorField pointAndNormal =
lsPlanePointAndNormal
(
controlPoints()[curFace]
- points[curPoint]
lsPoints,
points[curPoint],
pointNormals[curPoint]
);
}
w /= sum(w);
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));
vector& P = pointAndNormal[0];
vector& N = pointAndNormal[1];
displacement[curPoint] =
pointsDisplacementDir()[curPoint]*
(p - (points[curPoint]&N))/
(pointsDisplacementDir()[curPoint]&N);
pointsDisplacementDir()[curPoint]
*((P - points[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();
const labelListList& edgeFaces = aMesh().patch().edgeFaces();
const labelListList& pointEdges = aMesh().patch().pointEdges();
vectorField pointNormals = aMesh().pointAreaNormals();
forAll (boundaryPoints, pointI)
{
label curPoint = boundaryPoints[pointI];
if (motionPointsMask()[curPoint])
if (motionPointsMask()[curPoint] == 1)
{
// Calculating mirror points
const labelList& curPointEdges = pointEdges[curPoint];
@ -140,146 +165,380 @@ tmp<vectorField> freeSurface::pointDisplacement(const scalarField& deltaH)
forAll (curPointEdges, edgeI)
{
label curEdge = curPointEdges[edgeI];
if(edgeFaces[curEdge].size() == 1)
{
vector nE =
pointNormals[edges[curEdge].start()]
+ pointNormals[edges[curEdge].end()];
label patchID = -1;
label edgeID = -1;
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);
vector eP =
controlPoints()[edgeFaces[curEdge][0]]
- edges[curEdge].centre(points);
mirrorPoints[++counter] =
edges[curEdge].centre(points)
+ ((2.0*nE*nE - I)&eP);
mirrorPoints[++counter] =
patchMirrorPoints[patchID][edgeID];
}
}
// Calculating LS plane interpolation
// Calculating LS plane fit
const labelList& curPointFaces = pointFaces[curPoint];
tensor M = tensor::zero;
vectorField lsPoints
(
curPointFaces.size() + mirrorPoints.size(),
vector::zero
);
vector S = vector::zero;
scalarField w(curPointFaces.size() + 2, 0.0);
forAll (curPointFaces, faceI)
counter = -1;
for (label i=0; i<curPointFaces.size(); i++)
{
label curFace = curPointFaces[faceI];
w[faceI] = 1.0/mag
(
controlPoints()[curFace]
- points[curPoint]
);
label curFace = curPointFaces[i];
lsPoints[++counter] = controlPoints()[curFace];
}
forAll (mirrorPoints, pI)
for (label i=0; i<mirrorPoints.size(); i++)
{
w[curPointFaces.size() + pI] = 1.0/mag
(
mirrorPoints[pI]
- points[curPoint]
);
lsPoints[++counter] = mirrorPoints[i];
}
w /= sum(w);
vectorField pointAndNormal =
lsPlanePointAndNormal
(
lsPoints,
points[curPoint],
pointNormals[curPoint]
);
forAll (curPointFaces, faceI)
{
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));
vector& P = pointAndNormal[0];
vector& N = pointAndNormal[1];
displacement[curPoint] =
pointsDisplacementDir()[curPoint]*
(p - (points[curPoint]&N))/
(pointsDisplacementDir()[curPoint]&N);
pointsDisplacementDir()[curPoint]
*((P - points[curPoint])&N)
/(pointsDisplacementDir()[curPoint]&N);
}
}
forAll(aMesh().boundary(), patchI)
// Calculate displacement of axis point
forAll (aMesh().boundary(), patchI)
{
bool fixedPatch = false;
forAll(fixedFreeSurfacePatches_, fpI)
{
label fixedPatchID = aMesh().boundary().findPatchID
(
fixedFreeSurfacePatches_[fpI]
);
if (fixedPatchID == patchI)
{
fixedPatch = true;
}
}
if
if
(
(
aMesh().boundary()[patchI].type()
!= emptyFaPatch::typeName
)
&& !fixedPatch
aMesh().boundary()[patchI].type()
== wedgeFaPatch::typeName
)
{
labelList patchPoints =
aMesh().boundary()[patchI].pointLabels();
const wedgeFaPatch& wedgePatch =
refCast<const wedgeFaPatch>(aMesh().boundary()[patchI]);
labelListList patchPointEdges =
aMesh().boundary()[patchI].pointEdges();
unallocLabelList patchEdgeFaces =
aMesh().boundary()[patchI].edgeFaces();
forAll(patchPoints, pointI)
if(wedgePatch.axisPoint() > -1)
{
forAll(patchPointEdges[pointI], edgeI)
{
label curEdge = patchPointEdges[pointI][edgeI];
displacement[patchPoints[pointI]] +=
pointsDisplacementDir()[patchPoints[pointI]]*
deltaH[patchEdgeFaces[curEdge]];
}
displacement[patchPoints[pointI]] /=
patchPointEdges[pointI].size();
label axisPoint = wedgePatch.axisPoint();
displacement[axisPoint] =
pointsDisplacementDir()[axisPoint]
*(
pointsDisplacementDir()[axisPoint]
&(
controlPoints()[pointFaces[axisPoint][0]]
- points[axisPoint]
)
);
}
}
}
// 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;
}
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()
// {

View file

@ -12,4 +12,5 @@ EXE_LIBS = \
-ldynamicMesh \
-lmeshTools \
-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 "BisectionRoot.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[])
{
testFunction tf;
testFunction tf;
testFunctionDerivative df;
Info<< setprecision(10)
<< "Bisection root "
<< BisectionRoot<testFunction>(tf, 1e-5).root(0, 10) << nl
<< "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;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,7 +5,7 @@
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# License
# 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
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#
# Functions
#
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
printUsage() {
cat << LABEL
@ -98,11 +98,11 @@ leftStr() {
echo "$2" | sed -e "s/\(.\{$1\}\).*/\1/"
}
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#
# Main
#
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
if [ ! "$FOAM_JOB_DIR" ]; then
echo "$PROGNAME : FOAM_JOB_DIR environment variable not set."

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -107,4 +107,29 @@ cloneCase ()
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 |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#

View file

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

View file

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

View file

@ -5,7 +5,7 @@
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# License
# 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}'
# location of the jobControl directory
setenv FOAM_JOB_DIR $HOME/$WM_PROJECT/jobControl
setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
# wmake configuration
setenv WM_DIR $WM_PROJECT_DIR/wmake
@ -52,18 +52,18 @@ setenv WM_DECOMP_LIBS "-lfaceDecompFiniteElement -lfaceDecompositionMotionSolver
# base configuration
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_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
setenv FOAM_SRC $WM_PROJECT_DIR/src
# 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_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib
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/$WM_OPTIONS
# user configuration
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
# convenience
setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials

View file

@ -70,7 +70,7 @@ _foamSource()
}
# location of the jobControl directory
export FOAM_JOB_DIR=$HOME/$WM_PROJECT/jobControl
export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl
# wmake configuration
export WM_DIR=$WM_PROJECT_DIR/wmake
@ -85,18 +85,18 @@ export WM_DECOMP_LIBS="-lfaceDecompFiniteElement -lfaceDecompositionMotionSolver
# base configuration
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_LIBBIN=$WM_PROJECT_DIR/lib
export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS
export FOAM_SRC=$WM_PROJECT_DIR/src
# 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_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib
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/$WM_OPTIONS
# user configuration
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
# convenience
export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials

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