Commit 3ca53842 authored by mattijs's avatar mattijs
Browse files

initial changes to compile src

parent 2dbf4208
......@@ -300,7 +300,11 @@ label mergePatchFaces
const faceZone& fZone = mesh.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(newMasterI)];
}
label patchI = mesh.boundaryMesh().whichPatch(newMasterI);
labelPair patchIDs = polyTopoChange::whichPatch
(
mesh.boundaryMesh(),
newMasterI
);
Pout<< "Restoring new master face " << newMasterI
......@@ -316,10 +320,11 @@ label mergePatchFaces
own, // owner
-1, // neighbour
false, // face flip
patchI, // patch for face
patchIDs[0], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
zoneFlip, // face flip in zone
patchIDs[1] // subPatch
)
);
......@@ -341,9 +346,10 @@ label mergePatchFaces
-1, // masterEdgeID,
newMasterI, // masterFaceID,
false, // flipFaceFlux,
patchI, // patchID,
patchIDs[0], // patchID,
zoneID, // zoneID,
zoneFlip // zoneFlip
zoneFlip, // zoneFlip
patchIDs[1] // subPatch
)
);
}
......
......@@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "cellSplitter.H"
......@@ -51,17 +49,12 @@ defineTypeNameAndDebug(cellSplitter, 0);
void Foam::cellSplitter::getFaceInfo
(
const label faceI,
label& patchID,
labelPair& patchIDs,
label& zoneID,
label& zoneFlip
) const
{
patchID = -1;
if (!mesh_.isInternalFace(faceI))
{
patchID = mesh_.boundaryMesh().whichPatch(faceI);
}
patchIDs = polyTopoChange::whichPatch(mesh_.boundaryMesh(), faceI);
zoneID = mesh_.faceZones().whichZone(faceI);
......@@ -172,17 +165,16 @@ void Foam::cellSplitter::setRefinement
label anchorPoint = mesh_.cellPoints()[cellI][0];
label addedPointI =
meshMod.setAction
label addedPointI = meshMod.setAction
(
polyAddPoint
(
polyAddPoint
(
iter(), // point
anchorPoint, // master point
-1, // zone for point
true // supports a cell
)
);
iter(), // point
anchorPoint, // master point
-1, // zone for point
true // supports a cell
)
);
addedPoints_.insert(cellI, addedPointI);
//Pout<< "Added point " << addedPointI
......@@ -212,18 +204,17 @@ void Foam::cellSplitter::setRefinement
// Add other pyramids
for (label i = 1; i < cFaces.size(); i++)
{
label addedCellI =
meshMod.setAction
label addedCellI = meshMod.setAction
(
polyAddCell
(
polyAddCell
(
-1, // master point
-1, // master edge
-1, // master face
cellI, // master cell
-1 // zone
)
);
-1, // master point
-1, // master edge
-1, // master face
cellI, // master cell
-1 // zone
)
);
newCells[i] = addedCellI;
}
......@@ -310,7 +301,8 @@ void Foam::cellSplitter::setRefinement
false, // flux flip
-1, // patch for face
-1, // zone for face
false // face zone flip
false, // face zone flip
-1 // subPatch
)
);
}
......@@ -356,7 +348,8 @@ void Foam::cellSplitter::setRefinement
false, // flux flip
-1, // patch for face
-1, // zone for face
false // face zone flip
false, // face zone flip
-1 // subPatch
)
);
}
......@@ -411,7 +404,8 @@ void Foam::cellSplitter::setRefinement
-1, // patch for face
false, // remove from zone
-1, // zone for face
false // face zone flip
false, // face zone flip
-1 // subPatch
)
);
}
......@@ -429,7 +423,8 @@ void Foam::cellSplitter::setRefinement
-1, // patch for face
false, // remove from zone
-1, // zone for face
false // face zone flip
false, // face zone flip
-1 // subPatch
)
);
}
......@@ -439,8 +434,9 @@ void Foam::cellSplitter::setRefinement
{
label newOwn = newOwner(faceI, cellToCells);
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
labelPair patchIDs;
label zoneID, zoneFlip;
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
meshMod.setAction
(
......@@ -451,10 +447,11 @@ void Foam::cellSplitter::setRefinement
newOwn, // owner
-1, // neighbour
false, // flux flip
patchID, // patch for face
patchIDs[0], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
zoneFlip, // face zone flip
patchIDs[1]
)
);
}
......
......@@ -39,6 +39,7 @@ SourceFiles
#include "Map.H"
#include "edge.H"
#include "labelPair.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -73,7 +74,7 @@ class cellSplitter
void getFaceInfo
(
const label faceI,
label& patchID,
labelPair& patchIDs,
label& zoneID,
label& zoneFlip
) const;
......
......@@ -1124,7 +1124,8 @@ int main(int argc, char *argv[])
false, // flipFaceFlux
-1, // patchID
faceZonei, // zoneID
false // zoneFlip
false, // zoneFlip
-1 // subPatchID
);
// Mark face as being done
......@@ -1158,7 +1159,8 @@ int main(int argc, char *argv[])
false, // flipFaceFlux
patchi, // patchID
-1, // zoneID
false // zoneFlip
false, // zoneFlip
-1 // subPatchID
);
// For baffles create the opposite face
......@@ -1175,7 +1177,8 @@ int main(int argc, char *argv[])
false, // flipFaceFlux
patchi, // patchID
-1, // zoneID
false // zoneFlip
false, // zoneFlip
-1 // subPatchID
);
}
......@@ -1203,13 +1206,14 @@ int main(int argc, char *argv[])
faces[facei],
owner[facei],
neighbour[facei],
-1, //masterPointID
-1, //masterEdgeID
facei, //masterFace
false, //flipFaceFlux
-1, //patchID
-1, //zoneID
false //zoneFlip
-1, // masterPointID
-1, // masterEdgeID
facei, // masterFace
false, // flipFaceFlux
-1, // patchID
-1, // zoneID
false, // zoneFlip
-1 // subPatchID
);
}
}
......
......@@ -136,7 +136,8 @@ void Foam::extrude2DMesh::setRefinement
false, // flipFaceFlux
-1, // patchID
zoneID, // zoneID
zoneFlip // zoneFlip
zoneFlip, // zoneFlip
-1 // subPatchID
);
}
......@@ -173,7 +174,8 @@ void Foam::extrude2DMesh::setRefinement
false, // flipFaceFlux
patchI, // patchID
zoneID, // zoneID
zoneFlip // zoneFlip
zoneFlip, // zoneFlip
-1 //?TBD subPatchID
);
}
}
......@@ -236,7 +238,8 @@ void Foam::extrude2DMesh::setRefinement
false, // flipFaceFlux
frontPatchI, // patchID
-1, // zoneID
false // zoneFlip
false, // zoneFlip
-1 //?TDB subPatchID
);
// Offset to create front face.
......@@ -255,7 +258,8 @@ void Foam::extrude2DMesh::setRefinement
false, // flipFaceFlux
frontPatchI, // patchID
-1, // zoneID
false // zoneFlip
false, // zoneFlip
-1 //?TDB subPatchID
);
}
}
......
......@@ -9,5 +9,4 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-L$(FOAM_MPI_LIBBIN) -lparMetisDecompositionMethod \
-lautoMesh
......@@ -18,16 +18,16 @@ wmake libso finiteVolume
( cd decompositionAgglomeration && ./Allwmake )
#wmake libso sampling
wmake libso sampling
wmake libso dynamicMesh
#wmake libso dynamicFvMesh
#wmake libso topoChangerFvMesh
#wmake libso fvMotionSolver
#wmake libso engine
#
#wmake libso ODE
#wmake libso randomProcesses
wmake libso dynamicFvMesh
wmake libso topoChangerFvMesh
wmake libso fvMotionSolver
wmake libso engine
wmake libso ODE
wmake libso randomProcesses
( cd thermophysicalModels && ./Allwmake )
( cd transportModels && ./Allwmake )
......@@ -36,7 +36,7 @@ wmake libso dynamicMesh
( cd postProcessing && ./Allwmake )
( cd conversion && ./Allwmake )
#wmake libso autoMesh
#wmake libso errorEstimation
wmake libso autoMesh
wmake libso errorEstimation
# ----------------------------------------------------------------- end-of-file
......@@ -26,6 +26,7 @@ License
#include "cyclicPointPatchField.H"
#include "Swap.H"
#include "transformField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -124,6 +125,13 @@ cyclicPointPatchField<Type>::cyclicPointPatchField
template<class Type>
void cyclicPointPatchField<Type>::swapAdd(Field<Type>& pField) const
{
// Get neighbouring pointPatch
const cyclicPointPatch& nbrPatch = cyclicPatch_.neighbPatch();
// Get neighbouring patch internal field. Written out since cannot get
// access to neighbouring patch field.
Field<Type> nbrPf(pField, nbrPatch.meshPoints());
Field<Type> pf(this->patchInternalField(pField));
const edgeList& pairs = cyclicPatch_.transformPairs();
......@@ -132,16 +140,14 @@ void cyclicPointPatchField<Type>::swapAdd(Field<Type>& pField) const
{
forAll(pairs, pairi)
{
Type tmp = pf[pairs[pairi][0]];
pf[pairs[pairi][0]] = transform(forwardT(), pf[pairs[pairi][1]]);
pf[pairs[pairi][1]] = transform(reverseT(), tmp);
pf[pairs[pairi][0]] = transform(forwardT(), nbrPf[pairs[pairi][1]]);
}
}
else
{
forAll(pairs, pairi)
{
Swap(pf[pairs[pairi][0]], pf[pairs[pairi][1]]);
pf[pairs[pairi][0]] = nbrPf[pairs[pairi][1]];
}
}
......
......@@ -144,15 +144,7 @@ tmp<Field<Type1> > pointPatchField<Type>::patchInternalField
// get addressing
const labelList& meshPoints = patch().meshPoints();
tmp<Field<Type1> > tvalues(new Field<Type1>(meshPoints.size()));
Field<Type1>& values = tvalues();
forAll (meshPoints, pointI)
{
values[pointI] = iF[meshPoints[pointI]];
}
return tvalues;
return tmp<Field<Type1> >(new Field<Type1>(iF, meshPoints));
}
......
......@@ -38,6 +38,7 @@ SourceFiles
#include "coupledFacePointPatch.H"
#include "cyclicPolyPatch.H"
#include "pointBoundaryMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -123,6 +124,14 @@ public:
return cyclicPolyPatch_;
}
//- Return neighbour point patch
const cyclicPointPatch& neighbPatch() const
{
label patchI = cyclicPolyPatch_.neighbPatchID();
const pointPatch& pp = this->boundaryMesh()[patchI];
return refCast<const cyclicPointPatch>(pp);
}
//- Are the cyclic planes parallel
bool parallel() const
{
......@@ -145,7 +154,8 @@ public:
// Access functions for demand driven data
//- Return the set of pairs of points that require transformation
// and/or mapping
// and/or mapping. First index is on this patch, second on the
// neighbour patch.
virtual const edgeList& transformPairs() const;
};
......
......@@ -132,7 +132,7 @@ public:
// associated with any faces
virtual const labelList& loneMeshPoints() const;
//- Return point unit normals. Not impelemented.
//- Return point unit normals. Not implemented.
virtual const vectorField& pointNormals() const;
};
......
......@@ -39,6 +39,7 @@ SourceFiles
#define coupledPolyPatch_H
#include "polyPatch.H"
#include "diagTensorField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -231,20 +232,34 @@ public:
return true;
}
//- Are the planes separated.
virtual bool separated() const = 0;
//- Transform a patch-based field.
//!! TDB with macros?
virtual void transform(scalarField& l) const = 0;
virtual void transform(vectorField& l) const = 0;
virtual void transform(sphericalTensorField& l) const = 0;
virtual void transform(diagTensorField& l) const = 0;
virtual void transform(symmTensorField& l) const = 0;
virtual void transform(tensorField& l) const = 0;
//- If the planes are separated the separation vector.
virtual const vector& separation() const = 0;
//- Transform a patch-based position
virtual void transformPosition(pointField& l) const = 0;
//- Are the cyclic planes parallel.
virtual bool parallel() const = 0;
// Low level geometric information
//- Return face transformation tensor.
virtual const tensor& forwardT() const = 0;
//- Are the planes separated.
virtual bool separated() const = 0;
//- Return neighbour-cell transformation tensor.
virtual const tensor& reverseT() const = 0;
//- If the planes are separated the separation vector.
virtual const vector& separation() const = 0;
//- Are the cyclic planes parallel.
virtual bool parallel() const = 0;
//- Return face transformation tensor.
virtual const tensor& forwardT() const = 0;
//- Return neighbour-cell transformation tensor.
virtual const tensor& reverseT() const = 0;
//- Initialise the calculation of the patch geometry
......
......@@ -30,11 +30,10 @@ Description
Note: morph patch face ordering uses geometric matching so with the
following restrictions:
-halves should be flat planes.
-coupled patches should be flat planes.
-no rotation in patch plane
Uses a featureCos to find the two halves (or should be fully
disconnected). Uses coupledPolyPatch::calcFaceTol to calculate
Uses coupledPolyPatch::calcFaceTol to calculate
tolerance per face which might need tweaking.
Switch on 'cyclicPolyPatch' debug flag to write .obj files to show
......@@ -49,11 +48,12 @@ SourceFiles
#define cyclicPolyPatch_H
#include "coupledPolyPatch.H"
#include "SubField.H"
#include "FixedList.H"
//#include "SubField.H"
//#include "FixedList.H"
#include "edgeList.H"
#include "transform.H"
//#include "transform.H"
#include "polyBoundaryMesh.H"
#include "diagTensorField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -92,19 +92,6 @@ private:
mutable label neighbPatchID_;
//- List of edges formed from connected points. e[0] is the point on
// the first half of the patch, e[1] the corresponding point on the
// second half.
mutable edgeList* coupledPointsPtr_;
//- List of connected edges. e[0] is the edge on the first half of the
// patch, e[1] the corresponding edge on the second half.
mutable edgeList* coupledEdgesPtr_;
//- Morph:angle between normals of neighbouring faces.
// Used to split cyclic into halves.
scalar featureCos_;
//- Type of transformation - rotational or translational
transformType transform_;
......@@ -115,6 +102,18 @@ private:
point rotationCentre_;
//- List of edges formed from connected points. e[0] is the point on
// the first half of the patch, e[1] the corresponding point on the
// second half.
mutable edgeList* coupledPointsPtr_;
//- List of connected edges. e[0] is the edge on the first half of the
// patch, e[1] the corresponding edge on the second half.
mutable edgeList* coupledEdgesPtr_;
//- Temporary storage of owner side patch during ordering.
mutable autoPtr<primitivePatch> ownerPatchPtr_;
// Transformation
//- Has non-zero separation
......@@ -152,21 +151,11 @@ private:
// Face ordering
//- Find the two parts of the faces of pp using feature edges.
// Returns true if successfull.
bool getGeometricHalves
(
const primitivePatch&,
labelList&,
labelList&
) const;
//- Calculate geometric factors of the two halves.
void getCentresAndAnchors
(
const primitivePatch&,
const faceList& half0Faces,
const faceList& half1Faces,
const primitivePatch& pp0,
const primitivePatch& pp1,
pointField& half0Ctrs,
pointField& half1Ctrs,
......@@ -174,29 +163,9 @@ private:
scalarField& tols
) const;
//- Given matched faces matches the anchor point. Sets faceMap,
// rotation. Returns true if all matched.
bool matchAnchors
(
const bool report,
const primitivePatch&,
const labelList&,
const pointField&,
const labelList&,
const faceList&,
const labelList&,
const scalarField&,
labelList& faceMap,
labelList& rotation