mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -346,6 +346,7 @@ $(basicPolyPatches)/generic/genericPolyPatch.C
|
||||
constraintPolyPatches = $(polyPatches)/constraint
|
||||
$(constraintPolyPatches)/cyclic/cyclicPolyPatch.C
|
||||
$(constraintPolyPatches)/cyclicSlip/cyclicSlipPolyPatch.C
|
||||
$(constraintPolyPatches)/oldCyclic/oldCyclicPolyPatch.C
|
||||
$(constraintPolyPatches)/empty/emptyPolyPatch.C
|
||||
$(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C
|
||||
$(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,318 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::oldCyclicPolyPatch
|
||||
|
||||
Description
|
||||
'old' style cyclic polyPatch with all faces in single patch. Does ordering
|
||||
but cannot be used to run. Writes 'type cyclic' so foamUpgradeCyclics
|
||||
can be run afterwards.
|
||||
Used to get cyclics from mesh converters that assume cyclics in single
|
||||
patch (e.g. fluent3DMeshToFoam)
|
||||
|
||||
SourceFiles
|
||||
oldCyclicPolyPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef oldCyclicPolyPatch_H
|
||||
#define oldCyclicPolyPatch_H
|
||||
|
||||
#include "coupledPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class oldCyclicPolyPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class oldCyclicPolyPatch
|
||||
:
|
||||
public coupledPolyPatch
|
||||
{
|
||||
public:
|
||||
|
||||
enum transformType
|
||||
{
|
||||
UNKNOWN,
|
||||
ROTATIONAL,
|
||||
TRANSLATIONAL
|
||||
};
|
||||
static const NamedEnum<transformType, 3> transformTypeNames;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Morph:angle between normals of neighbouring faces.
|
||||
// Used to split cyclic into halves.
|
||||
scalar featureCos_;
|
||||
|
||||
//- Type of transformation - rotational or translational
|
||||
transformType transform_;
|
||||
|
||||
// For rotation
|
||||
|
||||
//- Axis of rotation for rotational cyclics
|
||||
vector rotationAxis_;
|
||||
|
||||
//- point on axis of rotation for rotational cyclics
|
||||
point rotationCentre_;
|
||||
|
||||
// For translation
|
||||
|
||||
//- Translation vector
|
||||
vector separationVector_;
|
||||
|
||||
|
||||
// Private member functions
|
||||
|
||||
//- Find amongst selected faces the one with the largest area
|
||||
static label findMaxArea(const pointField&, const faceList&);
|
||||
|
||||
void calcTransforms();
|
||||
|
||||
//- Calculate face centres
|
||||
static pointField calcFaceCentres
|
||||
(
|
||||
const UList<face>&,
|
||||
const pointField&
|
||||
);
|
||||
|
||||
//- Get f[0] for all faces
|
||||
static pointField getAnchorPoints
|
||||
(
|
||||
const UList<face>&,
|
||||
const pointField&
|
||||
);
|
||||
|
||||
// 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,
|
||||
|
||||
pointField& ppPoints,
|
||||
pointField& half0Ctrs,
|
||||
pointField& half1Ctrs,
|
||||
pointField& anchors0,
|
||||
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
|
||||
) const;
|
||||
|
||||
//- For rotational cases, try to find a unique face on each side
|
||||
// of the cyclic.
|
||||
label getConsistentRotationFace
|
||||
(
|
||||
const pointField& faceCentres
|
||||
) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member functions
|
||||
|
||||
//- Initialise the calculation of the patch geometry
|
||||
virtual void initGeometry(PstreamBuffers&);
|
||||
|
||||
//- Calculate the patch geometry
|
||||
virtual void calcGeometry(PstreamBuffers&);
|
||||
|
||||
//- Initialise the patches for moving points
|
||||
virtual void initMovePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Correct patches after moving points
|
||||
virtual void movePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&);
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("oldCyclic");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
oldCyclicPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const label size,
|
||||
const label start,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm
|
||||
);
|
||||
|
||||
//- Construct from dictionary
|
||||
oldCyclicPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm
|
||||
);
|
||||
|
||||
//- Construct as copy, resetting the boundary mesh
|
||||
oldCyclicPolyPatch(const oldCyclicPolyPatch&, const polyBoundaryMesh&);
|
||||
|
||||
//- Construct given the original patch and resetting the
|
||||
// face list and boundary mesh information
|
||||
oldCyclicPolyPatch
|
||||
(
|
||||
const oldCyclicPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart
|
||||
);
|
||||
|
||||
//- Construct and return a clone, resetting the boundary mesh
|
||||
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
|
||||
{
|
||||
return autoPtr<polyPatch>(new oldCyclicPolyPatch(*this, bm));
|
||||
}
|
||||
|
||||
//- Construct and return a clone, resetting the face list
|
||||
// and boundary mesh
|
||||
virtual autoPtr<polyPatch> clone
|
||||
(
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart
|
||||
) const
|
||||
{
|
||||
return autoPtr<polyPatch>
|
||||
(
|
||||
new oldCyclicPolyPatch(*this, bm, index, newSize, newStart)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~oldCyclicPolyPatch();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Does this side own the patch ?
|
||||
virtual bool owner() const
|
||||
{
|
||||
notImplemented("oldCyclicPolyPatch::owner()");
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Transform a patch-based position from other side to this side
|
||||
virtual void transformPosition(pointField& l) const
|
||||
{
|
||||
notImplemented("transformPosition(pointField&)");
|
||||
}
|
||||
|
||||
//- Calculate the patch geometry
|
||||
virtual void calcGeometry
|
||||
(
|
||||
const primitivePatch& referPatch,
|
||||
const UList<point>& thisCtrs,
|
||||
const UList<point>& thisAreas,
|
||||
const UList<point>& thisCc,
|
||||
const UList<point>& nbrCtrs,
|
||||
const UList<point>& nbrAreas,
|
||||
const UList<point>& nbrCc
|
||||
);
|
||||
|
||||
//- Initialize ordering for primitivePatch. Does not
|
||||
// refer to *this (except for name() and type() etc.)
|
||||
virtual void initOrder
|
||||
(
|
||||
PstreamBuffers&,
|
||||
const primitivePatch&
|
||||
) const;
|
||||
|
||||
//- Return new ordering for primitivePatch.
|
||||
// Ordering is -faceMap: for every face
|
||||
// index of the new face -rotation:for every new face the clockwise
|
||||
// shift of the original face. Return false if nothing changes
|
||||
// (faceMap is identity, rotation is 0), true otherwise.
|
||||
virtual bool order
|
||||
(
|
||||
PstreamBuffers&,
|
||||
const primitivePatch&,
|
||||
labelList& faceMap,
|
||||
labelList& rotation
|
||||
) const;
|
||||
|
||||
//- Write the polyPatch data as a dictionary
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -171,6 +171,23 @@ tmp<Field<Type> > cyclicFvPatchField<Type>::patchNeighbourField() const
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
const cyclicFvPatchField<Type>& cyclicFvPatchField<Type>::neighbourPatchField()
|
||||
const
|
||||
{
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fld =
|
||||
static_cast<const GeometricField<Type, fvPatchField, volMesh>&>
|
||||
(
|
||||
this->internalField()
|
||||
);
|
||||
|
||||
return refCast<const cyclicFvPatchField<Type> >
|
||||
(
|
||||
fld.boundaryField()[this->cyclicPatch().neighbPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void cyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
|
||||
@ -150,9 +150,12 @@ public:
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Return neighbour coupled given internal cell data
|
||||
//- Return neighbour coupled internal cell data
|
||||
tmp<Field<Type> > patchNeighbourField() const;
|
||||
|
||||
//- Return reference to neighbour patchField
|
||||
const cyclicFvPatchField<Type>& neighbourPatchField() const;
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
|
||||
@ -140,7 +140,17 @@ public:
|
||||
//- Return the "jump" across the patch.
|
||||
virtual tmp<Field<Type> > jump() const
|
||||
{
|
||||
return jump_;
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
return jump_;
|
||||
}
|
||||
else
|
||||
{
|
||||
return refCast<const fanFvPatchField<Type> >
|
||||
(
|
||||
this->neighbourPatchField()
|
||||
).jump();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -180,17 +180,31 @@ Foam::label Foam::ptscotchDecomp::decompose
|
||||
// Info<< "Dumping Scotch graph file to " << str.name() << endl
|
||||
// << "Use this in combination with gpart." << endl;
|
||||
//
|
||||
// label version = 0;
|
||||
// // Distributed graph file (.grf)
|
||||
// label version = 2;
|
||||
// str << version << nl;
|
||||
// // Numer of vertices
|
||||
// str << xadj.size()-1 << ' ' << adjncy.size() << nl;
|
||||
// // Number of files
|
||||
|
||||
// // Number of files (procglbnbr)
|
||||
// str << Pstream::nProcs();
|
||||
// // My file number (procloc)
|
||||
// str << ' ' << Pstream::myProcNo() << nl;
|
||||
//
|
||||
// // Total number of vertices (vertglbnbr)
|
||||
// str << returnReduce(mesh.nCells(), sumOp<label>());
|
||||
// // Total number of connections (edgeglbnbr)
|
||||
// str << ' ' << returnReduce(xadj[mesh.nCells()], sumOp<label>())
|
||||
// << nl;
|
||||
// // Local number of vertices (vertlocnbr)
|
||||
// str << mesh.nCells();
|
||||
// // Local number of connections (edgelocnbr)
|
||||
// str << ' ' << xadj[mesh.nCells()] << nl;
|
||||
// // Numbering starts from 0
|
||||
// label baseval = 0;
|
||||
// // Has weights?
|
||||
// label hasEdgeWeights = 0;
|
||||
// label hasVertexWeights = 0;
|
||||
// label numericflag = 10*hasEdgeWeights+hasVertexWeights;
|
||||
// str << baseval << ' ' << numericflag << nl;
|
||||
// // Start of my global vertices (procdsptab[proclocnum])
|
||||
// str << ' ' << globalCells.toGlobal(0);
|
||||
// 100*hasVertlabels+10*hasEdgeWeights+1*hasVertWeighs
|
||||
// str << ' ' << "0" << nl;
|
||||
// for (label cellI = 0; cellI < xadj.size()-1; cellI++)
|
||||
// {
|
||||
// label start = xadj[cellI];
|
||||
|
||||
Reference in New Issue
Block a user