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:
@ -32,14 +32,12 @@ parallel/decompose/AllwmakeLnInclude
|
||||
# dummyThirdParty (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools
|
||||
dummyThirdParty/Allwmake
|
||||
|
||||
# Build the proper scotchDecomp, metisDecomp etc.
|
||||
parallel/decompose/Allwmake
|
||||
|
||||
wmake libso meshTools
|
||||
wmake libso finiteVolume
|
||||
wmake libso genericPatchFields
|
||||
|
||||
parallel/reconstruct/Allwmake
|
||||
# Build the proper scotchDecomp, metisDecomp etc.
|
||||
parallel/Allwmake
|
||||
|
||||
wmake libso sampling
|
||||
|
||||
|
||||
@ -530,6 +530,7 @@ $(constraintPointPatchFields)/processorCyclic/processorCyclicPointPatchFields.C
|
||||
|
||||
derivedPointPatchFields = $(pointPatchFields)/derived
|
||||
$(derivedPointPatchFields)/slip/slipPointPatchFields.C
|
||||
$(derivedPointPatchFields)/fixedNormalSlip/fixedNormalSlipPointPatchFields.C
|
||||
/*
|
||||
$(derivedPointPatchFields)/global/globalPointPatchFields.C
|
||||
*/
|
||||
|
||||
@ -66,7 +66,7 @@ template<class Type>
|
||||
Field<Type>::Field
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
)
|
||||
:
|
||||
List<Type>(mapAddressing.size())
|
||||
@ -78,7 +78,7 @@ template<class Type>
|
||||
Field<Type>::Field
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
)
|
||||
:
|
||||
List<Type>(mapAddressing.size())
|
||||
@ -297,7 +297,7 @@ template<class Type>
|
||||
void Field<Type>::map
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
)
|
||||
{
|
||||
Field<Type>& f = *this;
|
||||
@ -326,7 +326,7 @@ template<class Type>
|
||||
void Field<Type>::map
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
)
|
||||
{
|
||||
map(tmapF(), mapAddressing);
|
||||
@ -455,7 +455,7 @@ template<class Type>
|
||||
void Field<Type>::rmap
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
)
|
||||
{
|
||||
Field<Type>& f = *this;
|
||||
@ -475,7 +475,7 @@ template<class Type>
|
||||
void Field<Type>::rmap
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
)
|
||||
{
|
||||
rmap(tmapF(), mapAddressing);
|
||||
@ -487,8 +487,8 @@ template<class Type>
|
||||
void Field<Type>::rmap
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const labelList& mapAddressing,
|
||||
const scalarList& mapWeights
|
||||
const UList<label>& mapAddressing,
|
||||
const UList<scalar>& mapWeights
|
||||
)
|
||||
{
|
||||
Field<Type>& f = *this;
|
||||
@ -505,8 +505,8 @@ template<class Type>
|
||||
void Field<Type>::rmap
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const labelList& mapAddressing,
|
||||
const scalarList& mapWeights
|
||||
const UList<label>& mapAddressing,
|
||||
const UList<scalar>& mapWeights
|
||||
)
|
||||
{
|
||||
rmap(tmapF(), mapAddressing, mapWeights);
|
||||
|
||||
@ -127,14 +127,14 @@ public:
|
||||
Field
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
);
|
||||
|
||||
//- Construct by 1 to 1 mapping from the given tmp field
|
||||
Field
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
);
|
||||
|
||||
//- Construct by interpolative mapping from the given field
|
||||
@ -208,14 +208,14 @@ public:
|
||||
void map
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
);
|
||||
|
||||
//- 1 to 1 map from the given tmp field
|
||||
void map
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
);
|
||||
|
||||
//- Interpolative map from the given field
|
||||
@ -258,30 +258,30 @@ public:
|
||||
void rmap
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
);
|
||||
|
||||
//- 1 to 1 reverse-map from the given tmp field
|
||||
void rmap
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const labelList& mapAddressing
|
||||
const UList<label>& mapAddressing
|
||||
);
|
||||
|
||||
//- Interpolative reverse map from the given field
|
||||
void rmap
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const labelList& mapAddressing,
|
||||
const scalarList& weights
|
||||
const UList<label>& mapAddressing,
|
||||
const UList<scalar>& weights
|
||||
);
|
||||
|
||||
//- Interpolative reverse map from the given tmp field
|
||||
void rmap
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const labelList& mapAddressing,
|
||||
const scalarList& weights
|
||||
const UList<label>& mapAddressing,
|
||||
const UList<scalar>& weights
|
||||
);
|
||||
|
||||
//- Negate this field
|
||||
|
||||
@ -0,0 +1,114 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fixedNormalSlipPointPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField
|
||||
(
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
slipPointPatchField<Type>(p, iF),
|
||||
n_(vector::max)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField
|
||||
(
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
slipPointPatchField<Type>(p, iF, dict),
|
||||
n_(dict.lookup("n"))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField
|
||||
(
|
||||
const fixedNormalSlipPointPatchField<Type>& ptf,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const pointPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
slipPointPatchField<Type>(ptf, p, iF, mapper),
|
||||
n_(ptf.n_)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField
|
||||
(
|
||||
const fixedNormalSlipPointPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
slipPointPatchField<Type>(ptf, iF),
|
||||
n_(ptf.n_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void fixedNormalSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes)
|
||||
{
|
||||
tmp<Field<Type> > tvalues =
|
||||
transform(I - n_*n_, this->patchInternalField());
|
||||
|
||||
// Get internal field to insert values into
|
||||
Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
|
||||
|
||||
setInInternalField(iF, tvalues());
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void fixedNormalSlipPointPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
slipPointPatchField<Type>::write(os);
|
||||
os.writeKeyword("n")
|
||||
<< n_ << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,170 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::fixedNormalSlipPointPatchField
|
||||
|
||||
Description
|
||||
slip with user-specified normal
|
||||
|
||||
SourceFiles
|
||||
fixedNormalSlipPointPatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef fixedNormalSlipPointPatchField_H
|
||||
#define fixedNormalSlipPointPatchField_H
|
||||
|
||||
#include "slipPointPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
template<class Type>
|
||||
class fixedNormalSlipPointPatchField;
|
||||
|
||||
template<class Type>
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const fixedNormalSlipPointPatchField<Type>&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class fixedNormalSlipPointPatchField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class fixedNormalSlipPointPatchField
|
||||
:
|
||||
public slipPointPatchField<Type>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- User specified normal
|
||||
vector n_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("fixedNormalSlip");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
fixedNormalSlipPointPatchField
|
||||
(
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
fixedNormalSlipPointPatchField
|
||||
(
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given patchField<Type> onto a new patch
|
||||
fixedNormalSlipPointPatchField
|
||||
(
|
||||
const fixedNormalSlipPointPatchField<Type>&,
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&,
|
||||
const pointPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<pointPatchField<Type> > clone() const
|
||||
{
|
||||
return autoPtr<pointPatchField<Type> >
|
||||
(
|
||||
new fixedNormalSlipPointPatchField<Type>
|
||||
(
|
||||
*this
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
fixedNormalSlipPointPatchField
|
||||
(
|
||||
const fixedNormalSlipPointPatchField<Type>&,
|
||||
const DimensionedField<Type, pointMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual autoPtr<pointPatchField<Type> > clone
|
||||
(
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
) const
|
||||
{
|
||||
return autoPtr<pointPatchField<Type> >
|
||||
(
|
||||
new fixedNormalSlipPointPatchField<Type>
|
||||
(
|
||||
*this,
|
||||
iF
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Member functions
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
);
|
||||
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "fixedNormalSlipPointPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fixedNormalSlipPointPatchFields.H"
|
||||
#include "pointPatchFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFields(fixedNormalSlip);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,49 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef fixedNormalSlipPointPatchFields_H
|
||||
#define fixedNormalSlipPointPatchFields_H
|
||||
|
||||
#include "fixedNormalSlipPointPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFieldTypedefs(fixedNormalSlip);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -65,6 +65,16 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
|
||||
|
||||
// Map the list
|
||||
newMotionPoints.map(oldMotionPoints, mpm.pointMap());
|
||||
|
||||
// Any points created out-of-nothing get set to the current coordinate
|
||||
// for lack of anything better.
|
||||
forAll(mpm.pointMap(), newPointI)
|
||||
{
|
||||
if (mpm.pointMap()[newPointI] == -1)
|
||||
{
|
||||
newMotionPoints[newPointI] = points_[newPointI];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reset valid directions (could change by faces put into empty patches)
|
||||
|
||||
@ -624,7 +624,18 @@ void Foam::cyclicPolyPatch::transformPosition(pointField& l) const
|
||||
}
|
||||
else if (separated())
|
||||
{
|
||||
l -= separation();
|
||||
const vectorField& s = separation();
|
||||
if (s.size() == 1)
|
||||
{
|
||||
forAll(l, i)
|
||||
{
|
||||
l[i] -= s[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
l -= s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -100,6 +100,14 @@ public:
|
||||
//- Construct given SymmTensor
|
||||
inline Tensor(const SymmTensor<Cmpt>&);
|
||||
|
||||
//- Construct given the three vector components
|
||||
inline Tensor
|
||||
(
|
||||
const Vector<Cmpt>& x,
|
||||
const Vector<Cmpt>& y,
|
||||
const Vector<Cmpt>& z
|
||||
);
|
||||
|
||||
//- Construct given the nine components
|
||||
inline Tensor
|
||||
(
|
||||
@ -116,14 +124,6 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
inline const Vector<Cmpt>& x() const;
|
||||
inline const Vector<Cmpt>& y() const;
|
||||
inline const Vector<Cmpt>& z() const;
|
||||
|
||||
inline Vector<Cmpt>& x();
|
||||
inline Vector<Cmpt>& y();
|
||||
inline Vector<Cmpt>& z();
|
||||
|
||||
inline const Cmpt& xx() const;
|
||||
inline const Cmpt& xy() const;
|
||||
inline const Cmpt& xz() const;
|
||||
@ -144,6 +144,13 @@ public:
|
||||
inline Cmpt& zy();
|
||||
inline Cmpt& zz();
|
||||
|
||||
// Access vector components.
|
||||
// Note: returning const only to find out lhs usage
|
||||
|
||||
inline const Vector<Cmpt> x() const;
|
||||
inline const Vector<Cmpt> y() const;
|
||||
inline const Vector<Cmpt> z() const;
|
||||
|
||||
//- Transpose
|
||||
inline Tensor<Cmpt> T() const;
|
||||
|
||||
|
||||
@ -64,6 +64,21 @@ inline Tensor<Cmpt>::Tensor(const SymmTensor<Cmpt>& st)
|
||||
}
|
||||
|
||||
|
||||
//- Construct given the three vector components
|
||||
template <class Cmpt>
|
||||
inline Tensor<Cmpt>::Tensor
|
||||
(
|
||||
const Vector<Cmpt>& x,
|
||||
const Vector<Cmpt>& y,
|
||||
const Vector<Cmpt>& z
|
||||
)
|
||||
{
|
||||
this->v_[XX] = x.x(); this->v_[XY] = x.y(); this->v_[XZ] = x.z();
|
||||
this->v_[YX] = y.x(); this->v_[YY] = y.y(); this->v_[YZ] = y.z();
|
||||
this->v_[ZX] = z.x(); this->v_[ZY] = z.y(); this->v_[ZZ] = z.z();
|
||||
}
|
||||
|
||||
|
||||
//- Construct from components
|
||||
template <class Cmpt>
|
||||
inline Tensor<Cmpt>::Tensor
|
||||
@ -90,40 +105,21 @@ inline Tensor<Cmpt>::Tensor(Istream& is)
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template <class Cmpt>
|
||||
inline const Vector<Cmpt>& Tensor<Cmpt>::x() const
|
||||
inline const Vector<Cmpt> Tensor<Cmpt>::x() const
|
||||
{
|
||||
return reinterpret_cast<const Vector<Cmpt>&>(this->v_[XX]);
|
||||
return Vector<Cmpt>(this->v_[XX], this->v_[XY], this->v_[XZ]);
|
||||
}
|
||||
|
||||
template <class Cmpt>
|
||||
inline const Vector<Cmpt>& Tensor<Cmpt>::y() const
|
||||
inline const Vector<Cmpt> Tensor<Cmpt>::y() const
|
||||
{
|
||||
return reinterpret_cast<const Vector<Cmpt>&>(this->v_[YX]);
|
||||
return Vector<Cmpt>(this->v_[YX], this->v_[YY], this->v_[YZ]);
|
||||
}
|
||||
|
||||
template <class Cmpt>
|
||||
inline const Vector<Cmpt>& Tensor<Cmpt>::z() const
|
||||
inline const Vector<Cmpt> Tensor<Cmpt>::z() const
|
||||
{
|
||||
return reinterpret_cast<const Vector<Cmpt>&>(this->v_[ZX]);
|
||||
}
|
||||
|
||||
|
||||
template <class Cmpt>
|
||||
inline Vector<Cmpt>& Tensor<Cmpt>::x()
|
||||
{
|
||||
return reinterpret_cast<Vector<Cmpt>&>(this->v_[XX]);
|
||||
}
|
||||
|
||||
template <class Cmpt>
|
||||
inline Vector<Cmpt>& Tensor<Cmpt>::y()
|
||||
{
|
||||
return reinterpret_cast<Vector<Cmpt>&>(this->v_[YX]);
|
||||
}
|
||||
|
||||
template <class Cmpt>
|
||||
inline Vector<Cmpt>& Tensor<Cmpt>::z()
|
||||
{
|
||||
return reinterpret_cast<Vector<Cmpt>&>(this->v_[ZX]);
|
||||
return Vector<Cmpt>(this->v_[ZX], this->v_[ZY], this->v_[ZZ]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -269,10 +269,12 @@ tensor eigenVectors(const tensor& t)
|
||||
{
|
||||
vector evals(eigenValues(t));
|
||||
|
||||
tensor evs;
|
||||
evs.x() = eigenVector(t, evals.x());
|
||||
evs.y() = eigenVector(t, evals.y());
|
||||
evs.z() = eigenVector(t, evals.z());
|
||||
tensor evs
|
||||
(
|
||||
eigenVector(t, evals.x()),
|
||||
eigenVector(t, evals.y()),
|
||||
eigenVector(t, evals.z())
|
||||
);
|
||||
|
||||
return evs;
|
||||
}
|
||||
@ -468,10 +470,12 @@ tensor eigenVectors(const symmTensor& t)
|
||||
{
|
||||
vector evals(eigenValues(t));
|
||||
|
||||
tensor evs;
|
||||
evs.x() = eigenVector(t, evals.x());
|
||||
evs.y() = eigenVector(t, evals.y());
|
||||
evs.z() = eigenVector(t, evals.z());
|
||||
tensor evs
|
||||
(
|
||||
eigenVector(t, evals.x()),
|
||||
eigenVector(t, evals.y()),
|
||||
eigenVector(t, evals.z())
|
||||
);
|
||||
|
||||
return evs;
|
||||
}
|
||||
|
||||
@ -92,7 +92,14 @@ public:
|
||||
//- Construct given SphericalTensor2D
|
||||
inline Tensor2D(const SphericalTensor2D<Cmpt>&);
|
||||
|
||||
//- Construct given the nine components
|
||||
//- Construct given the two vectors
|
||||
inline Tensor2D
|
||||
(
|
||||
const Vector2D<Cmpt>& x,
|
||||
const Vector2D<Cmpt>& y
|
||||
);
|
||||
|
||||
//- Construct given the four components
|
||||
inline Tensor2D
|
||||
(
|
||||
const Cmpt txx, const Cmpt txy,
|
||||
@ -107,12 +114,6 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
inline const Vector2D<Cmpt>& x() const;
|
||||
inline const Vector2D<Cmpt>& y() const;
|
||||
|
||||
inline Vector2D<Cmpt>& x();
|
||||
inline Vector2D<Cmpt>& y();
|
||||
|
||||
inline const Cmpt& xx() const;
|
||||
inline const Cmpt& xy() const;
|
||||
inline const Cmpt& yx() const;
|
||||
@ -123,6 +124,11 @@ public:
|
||||
inline Cmpt& yx();
|
||||
inline Cmpt& yy();
|
||||
|
||||
// Access vector components.
|
||||
|
||||
inline Vector2D<Cmpt> x() const;
|
||||
inline Vector2D<Cmpt> y() const;
|
||||
|
||||
//- Transpose
|
||||
inline Tensor2D<Cmpt> T() const;
|
||||
|
||||
|
||||
@ -50,6 +50,18 @@ inline Tensor2D<Cmpt>::Tensor2D(const SphericalTensor2D<Cmpt>& st)
|
||||
}
|
||||
|
||||
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt>::Tensor2D
|
||||
(
|
||||
const Vector2D<Cmpt>& x,
|
||||
const Vector2D<Cmpt>& y
|
||||
)
|
||||
{
|
||||
this->v_[XX] = x.x(); this->v_[XY] = x.y();
|
||||
this->v_[YX] = y.x(); this->v_[YY] = y.y();
|
||||
}
|
||||
|
||||
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt>::Tensor2D
|
||||
(
|
||||
@ -72,51 +84,38 @@ inline Tensor2D<Cmpt>::Tensor2D(Istream& is)
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template <class Cmpt>
|
||||
inline const Vector2D<Cmpt>& Tensor2D<Cmpt>::x() const
|
||||
inline Vector2D<Cmpt> Tensor2D<Cmpt>::x() const
|
||||
{
|
||||
return reinterpret_cast<const Vector2D<Cmpt>&>(this->v_[XX]);
|
||||
return Vector2D<Cmpt>(this->v_[XX], this->v_[XY]);
|
||||
}
|
||||
|
||||
template <class Cmpt>
|
||||
inline const Vector2D<Cmpt>& Tensor2D<Cmpt>::y() const
|
||||
inline Vector2D<Cmpt> Tensor2D<Cmpt>::y() const
|
||||
{
|
||||
return reinterpret_cast<const Vector2D<Cmpt>&>(this->v_[YX]);
|
||||
return Vector2D<Cmpt>(this->v_[YX], this->v_[YY]);
|
||||
}
|
||||
|
||||
|
||||
template <class Cmpt>
|
||||
inline Vector2D<Cmpt>& Tensor2D<Cmpt>::x()
|
||||
{
|
||||
return reinterpret_cast<Vector2D<Cmpt>&>(this->v_[XX]);
|
||||
}
|
||||
|
||||
template <class Cmpt>
|
||||
inline Vector2D<Cmpt>& Tensor2D<Cmpt>::y()
|
||||
{
|
||||
return reinterpret_cast<Vector2D<Cmpt>&>(this->v_[YX]);
|
||||
}
|
||||
|
||||
|
||||
template <class Cmpt>
|
||||
inline const Cmpt& Tensor2D<Cmpt>::xx() const
|
||||
inline const Cmpt& Tensor2D<Cmpt>::xx() const
|
||||
{
|
||||
return this->v_[XX];
|
||||
}
|
||||
|
||||
template <class Cmpt>
|
||||
inline const Cmpt& Tensor2D<Cmpt>::xy() const
|
||||
inline const Cmpt& Tensor2D<Cmpt>::xy() const
|
||||
{
|
||||
return this->v_[XY];
|
||||
}
|
||||
|
||||
template <class Cmpt>
|
||||
inline const Cmpt& Tensor2D<Cmpt>::yx() const
|
||||
inline const Cmpt& Tensor2D<Cmpt>::yx() const
|
||||
{
|
||||
return this->v_[YX];
|
||||
}
|
||||
|
||||
template <class Cmpt>
|
||||
inline const Cmpt& Tensor2D<Cmpt>::yy() const
|
||||
inline const Cmpt& Tensor2D<Cmpt>::yy() const
|
||||
{
|
||||
return this->v_[YY];
|
||||
}
|
||||
|
||||
@ -158,9 +158,11 @@ tensor2D eigenVectors(const tensor2D& t)
|
||||
{
|
||||
vector2D evals(eigenValues(t));
|
||||
|
||||
tensor2D evs;
|
||||
evs.x() = eigenVector(t, evals.x());
|
||||
evs.y() = eigenVector(t, evals.y());
|
||||
tensor2D evs
|
||||
(
|
||||
eigenVector(t, evals.x()),
|
||||
eigenVector(t, evals.y())
|
||||
);
|
||||
|
||||
return evs;
|
||||
}
|
||||
|
||||
@ -196,6 +196,8 @@ $(interpolation)/interpolationCellPoint/makeInterpolationCellPoint.C
|
||||
$(interpolation)/interpolationCellPointFace/makeInterpolationCellPointFace.C
|
||||
$(interpolation)/interpolationCellPointWallModified/cellPointWeightWallModified/cellPointWeightWallModified.C
|
||||
$(interpolation)/interpolationCellPointWallModified/makeInterpolationCellPointWallModified.C
|
||||
$(interpolation)/interpolationPoint/pointMVCWeight.C
|
||||
$(interpolation)/interpolationPoint/makeInterpolationPoint.C
|
||||
|
||||
volPointInterpolation = interpolation/volPointInterpolation
|
||||
/*
|
||||
|
||||
@ -71,7 +71,7 @@ void Foam::MRFZone::relativeRhoFlux
|
||||
|
||||
phi.boundaryField()[patchi][patchFacei] -=
|
||||
rho.boundaryField()[patchi][patchFacei]
|
||||
*(Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
|
||||
* (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
|
||||
& Sf.boundaryField()[patchi][patchFacei];
|
||||
}
|
||||
}
|
||||
@ -95,7 +95,7 @@ void Foam::MRFZone::absoluteRhoFlux
|
||||
forAll(internalFaces_, i)
|
||||
{
|
||||
label facei = internalFaces_[i];
|
||||
phi[facei] += (Omega ^ (Cf[facei] - origin)) & Sf[facei];
|
||||
phi[facei] += rho[facei]*(Omega ^ (Cf[facei] - origin)) & Sf[facei];
|
||||
}
|
||||
|
||||
// Included patches
|
||||
@ -106,7 +106,8 @@ void Foam::MRFZone::absoluteRhoFlux
|
||||
label patchFacei = includedFaces_[patchi][i];
|
||||
|
||||
phi.boundaryField()[patchi][patchFacei] +=
|
||||
(Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
|
||||
rho.boundaryField()[patchi][patchFacei]
|
||||
* (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
|
||||
& Sf.boundaryField()[patchi][patchFacei];
|
||||
}
|
||||
}
|
||||
@ -119,7 +120,8 @@ void Foam::MRFZone::absoluteRhoFlux
|
||||
label patchFacei = excludedFaces_[patchi][i];
|
||||
|
||||
phi.boundaryField()[patchi][patchFacei] +=
|
||||
(Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
|
||||
rho.boundaryField()[patchi][patchFacei]
|
||||
* (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
|
||||
& Sf.boundaryField()[patchi][patchFacei];
|
||||
}
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ public:
|
||||
}
|
||||
|
||||
//- Return axis
|
||||
const vector& axis() const
|
||||
vector axis() const
|
||||
{
|
||||
return coordSys_.axis();
|
||||
}
|
||||
|
||||
@ -168,9 +168,11 @@ void wedgeFvPatchField<Type>::evaluate(const Pstream::commsTypes)
|
||||
template<class Type>
|
||||
tmp<Field<Type> > wedgeFvPatchField<Type>::snGradTransformDiag() const
|
||||
{
|
||||
diagTensor diagT =
|
||||
const diagTensor diagT =
|
||||
0.5*diag(I - refCast<const wedgeFvPatch>(this->patch()).cellT());
|
||||
|
||||
const vector diagV(diagT.xx(), diagT.yy(), diagT.zz());
|
||||
|
||||
return tmp<Field<Type> >
|
||||
(
|
||||
new Field<Type>
|
||||
@ -180,7 +182,7 @@ tmp<Field<Type> > wedgeFvPatchField<Type>::snGradTransformDiag() const
|
||||
(
|
||||
pow
|
||||
(
|
||||
reinterpret_cast<const vector&>(diagT),
|
||||
diagV,
|
||||
pTraits<typename powProduct<vector, pTraits<Type>::rank>
|
||||
::type>::zero
|
||||
)
|
||||
|
||||
@ -346,9 +346,12 @@ Foam::fv::cellLimitedGrad<Foam::vector>::calcGrad
|
||||
|
||||
forAll(gIf, celli)
|
||||
{
|
||||
gIf[celli].x() = cmptMultiply(limiter[celli], gIf[celli].x());
|
||||
gIf[celli].y() = cmptMultiply(limiter[celli], gIf[celli].y());
|
||||
gIf[celli].z() = cmptMultiply(limiter[celli], gIf[celli].z());
|
||||
gIf[celli] = tensor
|
||||
(
|
||||
cmptMultiply(limiter[celli], gIf[celli].x()),
|
||||
cmptMultiply(limiter[celli], gIf[celli].y()),
|
||||
cmptMultiply(limiter[celli], gIf[celli].z())
|
||||
);
|
||||
}
|
||||
|
||||
g.correctBoundaryConditions();
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "interpolationPoint.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::interpolationPoint<Type>::interpolationPoint
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
)
|
||||
:
|
||||
interpolation<Type>(psi),
|
||||
psip_(volPointInterpolation::New(psi.mesh()).interpolate(psi))
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,108 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::interpolationPoint
|
||||
|
||||
Description
|
||||
Given cell centre values interpolates to vertices and uses these to
|
||||
do a Mean Value Coordinates interpolation.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef interpolationPoint_H
|
||||
#define interpolationPoint_H
|
||||
|
||||
#include "interpolation.H"
|
||||
#include "pointMVCWeight.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class interpolationPoint Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class interpolationPoint
|
||||
:
|
||||
public interpolation<Type>
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Interpolated volfield
|
||||
const GeometricField<Type, pointPatchField, pointMesh> psip_;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("cellPoint");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
interpolationPoint
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Interpolate field for the given cellPointWeight
|
||||
inline Type interpolate(const pointMVCWeight& cpw) const;
|
||||
|
||||
//- Interpolate field to the given point in the given cell
|
||||
inline Type interpolate
|
||||
(
|
||||
const vector& position,
|
||||
const label nCell,
|
||||
const label facei = -1
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "interpolationPointI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "interpolationPoint.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
inline Type Foam::interpolationPoint<Type>::interpolate
|
||||
(
|
||||
const pointMVCWeight& cpw
|
||||
) const
|
||||
{
|
||||
return cpw.interpolate(psip_);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
inline Type Foam::interpolationPoint<Type>::interpolate
|
||||
(
|
||||
const vector& position,
|
||||
const label celli,
|
||||
const label facei
|
||||
) const
|
||||
{
|
||||
return interpolate
|
||||
(
|
||||
pointMVCWeight(this->pMesh_, position, celli, facei)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,35 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "interpolationPoint.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeInterpolation(interpolationPoint);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,324 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pointMVCWeight.H"
|
||||
#include "polyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
int Foam::pointMVCWeight::debug
|
||||
(
|
||||
debug::debugSwitch("pointMVCWeight", 0)
|
||||
);
|
||||
|
||||
Foam::scalar Foam::pointMVCWeight::tol(SMALL);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void Foam::pointMVCWeight::calcWeights
|
||||
(
|
||||
const Map<label>& toLocal,
|
||||
const face& f,
|
||||
const DynamicList<point>& u,
|
||||
const scalarField& dist,
|
||||
scalarField& weights
|
||||
) const
|
||||
{
|
||||
weights.setSize(toLocal.size());
|
||||
weights = 0.0;
|
||||
|
||||
scalarField theta(f.size());
|
||||
|
||||
// recompute theta, the theta computed previously are not robust
|
||||
forAll(f, j)
|
||||
{
|
||||
label jPlus1 = f.fcIndex(j);
|
||||
scalar l = mag(u[j]-u[jPlus1]);
|
||||
theta[j] = 2.0*Foam::asin(l/2.0);
|
||||
}
|
||||
|
||||
scalar sumWeight = 0;
|
||||
forAll(f, j)
|
||||
{
|
||||
label pid = toLocal[f[j]];
|
||||
label jMin1 = f.rcIndex(j);
|
||||
weights[pid] =
|
||||
1.0
|
||||
/ dist[pid]
|
||||
* (Foam::tan(theta[jMin1]/2.0)+Foam::tan(theta[j]/2.0));
|
||||
sumWeight += weights[pid];
|
||||
}
|
||||
|
||||
if (sumWeight >= tol)
|
||||
{
|
||||
weights /= sumWeight;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::pointMVCWeight::calcWeights
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& toGlobal,
|
||||
const Map<label>& toLocal,
|
||||
const vector& position,
|
||||
const vectorField& uVec,
|
||||
const scalarField& dist,
|
||||
scalarField& weights
|
||||
) const
|
||||
{
|
||||
// Loop over all triangles of all polygons of cell to compute weights
|
||||
DynamicList<scalar> alpha(100);
|
||||
DynamicList<scalar> theta(100);
|
||||
DynamicList<point> u(100);
|
||||
|
||||
const Foam::cell& cFaces = mesh.cells()[cellIndex_];
|
||||
|
||||
forAll(cFaces, iter)
|
||||
{
|
||||
label faceI = cFaces[iter];
|
||||
const face& f = mesh.faces()[faceI];
|
||||
|
||||
//Pout<< "face:" << faceI << " at:"
|
||||
// << pointField(mesh.points(), f)
|
||||
// << endl;
|
||||
|
||||
// Collect the uVec for the face
|
||||
forAll(f, j)
|
||||
{
|
||||
u(j) = uVec[toLocal[f[j]]];
|
||||
}
|
||||
|
||||
vector v(point::zero);
|
||||
forAll(f, j)
|
||||
{
|
||||
label jPlus1 = f.fcIndex(j);
|
||||
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1] << endl;
|
||||
|
||||
vector temp = u[j] ^ u[jPlus1];
|
||||
temp /= mag(temp);
|
||||
|
||||
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1]
|
||||
// << " temp:" << temp << endl;
|
||||
|
||||
scalar l = mag(u[j]-u[jPlus1]);
|
||||
scalar angle = 2.0*Foam::asin(l/2.0);
|
||||
|
||||
//Pout<< " j:" << j << " l:" << l
|
||||
// << " angle:" << angle << endl;
|
||||
|
||||
v += 0.5*angle*temp;
|
||||
}
|
||||
|
||||
scalar vNorm = mag(v);
|
||||
v /= vNorm;
|
||||
|
||||
// Make sure v points towards the polygon
|
||||
//if (((v&u[0]) < 0) != (mesh.faceOwner()[faceI] != cellIndex_))
|
||||
//{
|
||||
// FatalErrorIn("pointMVCWeight::calcWeights(..)")
|
||||
// << "v:" << v << " u[0]:" << u[0]
|
||||
// << exit(FatalError);
|
||||
//}
|
||||
|
||||
if ((v&u[0]) < 0)
|
||||
{
|
||||
v = -v;
|
||||
}
|
||||
|
||||
//Pout<< " v:" << v << endl;
|
||||
|
||||
// angles between edges
|
||||
forAll(f, j)
|
||||
{
|
||||
label jPlus1 = f.fcIndex(j);
|
||||
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1] << endl;
|
||||
|
||||
vector n0 = u[j] ^ v;
|
||||
n0 /= mag(n0);
|
||||
vector n1 = u[jPlus1] ^ v;
|
||||
n1 /= mag(n1);
|
||||
|
||||
scalar l = mag(n0-n1);
|
||||
//Pout<< " l:" << l << endl;
|
||||
alpha(j) = 2.0*Foam::asin(l/2.0);
|
||||
|
||||
vector temp = n0 ^ n1;
|
||||
if ((temp&v) < 0.0)
|
||||
{
|
||||
alpha[j] = -alpha[j];
|
||||
}
|
||||
|
||||
l = mag(u[j]-v);
|
||||
//Pout<< " l:" << l << endl;
|
||||
theta(j) = 2.0*Foam::asin(l/2.0);
|
||||
}
|
||||
|
||||
|
||||
bool outlierFlag = false;
|
||||
forAll(f, j)
|
||||
{
|
||||
if (mag(theta[j]) < tol)
|
||||
{
|
||||
outlierFlag = true;
|
||||
|
||||
label pid = toLocal[f[j]];
|
||||
weights[pid] += vNorm / dist[pid];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (outlierFlag)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
scalar sum = 0.0;
|
||||
forAll(f, j)
|
||||
{
|
||||
label jMin1 = f.rcIndex(j);
|
||||
sum +=
|
||||
1.0
|
||||
/ Foam::tan(theta[j])
|
||||
* (Foam::tan(alpha[j]/2.0)+Foam::tan(alpha[jMin1]/2.0));
|
||||
}
|
||||
|
||||
// The special case when x lies on the polygon, handle it using 2D mvc.
|
||||
// In the 2D case, alpha = theta
|
||||
if (mag(sum) < tol)
|
||||
{
|
||||
// Calculate weights using face vertices only
|
||||
calcWeights(toLocal, f, u, dist, weights);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Normal 3D case
|
||||
forAll(f, j)
|
||||
{
|
||||
label pid = toLocal[f[j]];
|
||||
label jMin1 = f.rcIndex(j);
|
||||
weights[pid] +=
|
||||
vNorm
|
||||
/ sum
|
||||
/ dist[pid]
|
||||
/ Foam::sin(theta[j])
|
||||
* (Foam::tan(alpha[j]/2.0)+Foam::tan(alpha[jMin1]/2.0));
|
||||
}
|
||||
}
|
||||
|
||||
// normalise weights
|
||||
scalar sumWeight = sum(weights);
|
||||
|
||||
if (mag(sumWeight) < tol)
|
||||
{
|
||||
return;
|
||||
}
|
||||
weights /= sumWeight;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::pointMVCWeight::pointMVCWeight
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
const label cellIndex,
|
||||
const label faceIndex
|
||||
)
|
||||
:
|
||||
cellIndex_((cellIndex != -1) ? cellIndex : mesh.faceOwner()[faceIndex])
|
||||
{
|
||||
// Addressing - face vertices to local points and vice versa
|
||||
const labelList& toGlobal = mesh.cellPoints()[cellIndex_];
|
||||
Map<label> toLocal(2*toGlobal.size());
|
||||
forAll(toGlobal, i)
|
||||
{
|
||||
toLocal.insert(toGlobal[i], i);
|
||||
}
|
||||
|
||||
|
||||
// Initialise weights
|
||||
weights_.setSize(toGlobal.size());
|
||||
weights_ = 0.0;
|
||||
|
||||
|
||||
// Point-to-vertex vectors and distances
|
||||
vectorField uVec(toGlobal.size());
|
||||
scalarField dist(toGlobal.size());
|
||||
|
||||
forAll(toGlobal, pid)
|
||||
{
|
||||
const point& pt = mesh.points()[toGlobal[pid]];
|
||||
|
||||
uVec[pid] = pt-position;
|
||||
dist[pid] = mag(uVec[pid]);
|
||||
|
||||
// Special case: point is close to vertex
|
||||
if (dist[pid] < tol)
|
||||
{
|
||||
weights_[pid] = 1.0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Project onto unit sphere
|
||||
uVec /= dist;
|
||||
|
||||
|
||||
if (faceIndex < 0)
|
||||
{
|
||||
// Face data not supplied
|
||||
calcWeights
|
||||
(
|
||||
mesh,
|
||||
toGlobal,
|
||||
toLocal,
|
||||
position,
|
||||
uVec,
|
||||
dist,
|
||||
|
||||
weights_
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
DynamicList<point> u(100);
|
||||
const face& f = mesh.faces()[faceIndex];
|
||||
// Collect the uVec for the face
|
||||
forAll(f, j)
|
||||
{
|
||||
u(j) = uVec[toLocal[f[j]]];
|
||||
}
|
||||
|
||||
// Calculate weights for face only
|
||||
calcWeights(toLocal, f, u, dist, weights_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,162 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::pointMVCWeight
|
||||
|
||||
Description
|
||||
Container to calculate weights for interpolating directly from vertices
|
||||
of cell using Mean Value Coordinates.
|
||||
|
||||
Based on (VTK's vtkMeanValueCoordinatesInterpolator's) implementation
|
||||
of "Spherical Barycentric Coordinates"
|
||||
2006 paper Eurographics Symposium on Geometry Processing
|
||||
by Torsten Langer, Alexander Belyaev and Hans-Peter Seide
|
||||
|
||||
|
||||
|
||||
SourceFiles
|
||||
pointMVCWeight.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef pointMVCWeight_H
|
||||
#define pointMVCWeight_H
|
||||
|
||||
#include "scalarField.H"
|
||||
#include "vectorField.H"
|
||||
#include "Map.H"
|
||||
#include "DynamicList.H"
|
||||
#include "point.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class polyMesh;
|
||||
class pointMesh;
|
||||
template<class T> class pointPatchField;
|
||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||
class GeometricField;
|
||||
class face;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pointMVCWeight Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class pointMVCWeight
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Cell index
|
||||
const label cellIndex_;
|
||||
|
||||
//- Weights applied to cell vertices
|
||||
scalarField weights_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Calculate weights from single face's vertices only
|
||||
void calcWeights
|
||||
(
|
||||
const Map<label>& toLocal,
|
||||
const face& f,
|
||||
const DynamicList<point>& u,
|
||||
const scalarField& dist,
|
||||
scalarField& weights
|
||||
) const;
|
||||
|
||||
//- Calculate weights from all cell's vertices
|
||||
void calcWeights
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& toGlobal,
|
||||
const Map<label>& toLocal,
|
||||
const vector& position,
|
||||
const vectorField& uVec,
|
||||
const scalarField& dist,
|
||||
scalarField& weights
|
||||
) const;
|
||||
|
||||
public:
|
||||
|
||||
//- Debug switch
|
||||
static int debug;
|
||||
|
||||
//- Tolerance used in calculating barycentric co-ordinates
|
||||
// (applied to normalised values)
|
||||
static scalar tol;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
pointMVCWeight
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
const label nCell,
|
||||
const label facei = -1
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Cell index
|
||||
inline label cell() const
|
||||
{
|
||||
return cellIndex_;
|
||||
}
|
||||
|
||||
//- interpolation weights (in order of cellPoints)
|
||||
inline const scalarField& weights() const
|
||||
{
|
||||
return weights_;
|
||||
}
|
||||
|
||||
//- Interpolate field
|
||||
template<class Type>
|
||||
inline Type interpolate
|
||||
(
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& psip
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "pointMVCWeightI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,48 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pointFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
inline Type Foam::pointMVCWeight::interpolate
|
||||
(
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& psip
|
||||
) const
|
||||
{
|
||||
const labelList& vertices = psip.mesh()().cellPoints()[cellIndex_];
|
||||
|
||||
Type t = pTraits<Type>::zero;
|
||||
forAll(vertices, i)
|
||||
{
|
||||
t += psip[vertices[i]]*weights_[i];
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -220,6 +220,7 @@ void Foam::FreeStream<CloudType>::inflow()
|
||||
|
||||
// Cumulative triangle area fractions
|
||||
List<scalar> cTriAFracs(nVertices);
|
||||
cTriAFracs[0] = 0.0;
|
||||
|
||||
for (label v = 0; v < nVertices - 1; v++)
|
||||
{
|
||||
|
||||
@ -13,4 +13,5 @@ LIB_LIBS = \
|
||||
-llagrangian \
|
||||
-lmeshTools \
|
||||
-ledgeMesh \
|
||||
-ltriSurface
|
||||
-ltriSurface \
|
||||
-ldistributed
|
||||
|
||||
@ -55,7 +55,6 @@ indexedOctree/treeDataPrimitivePatchName.C
|
||||
indexedOctree/treeDataTriSurface.C
|
||||
|
||||
searchableSurface = searchableSurface
|
||||
$(searchableSurface)/distributedTriSurfaceMesh.C
|
||||
$(searchableSurface)/searchableBox.C
|
||||
$(searchableSurface)/searchableCylinder.C
|
||||
$(searchableSurface)/searchablePlane.C
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-ltriSurface \
|
||||
-ldecompositionMethods \
|
||||
-llagrangian
|
||||
|
||||
@ -66,27 +66,23 @@ void Foam::coordinateRotation::calcTransform
|
||||
switch (order)
|
||||
{
|
||||
case e1e2:
|
||||
Rtr.x() = a;
|
||||
Rtr.y() = b;
|
||||
Rtr.z() = c;
|
||||
Rtr = tensor(a, b, c);
|
||||
break;
|
||||
|
||||
case e2e3:
|
||||
Rtr.x() = c;
|
||||
Rtr.y() = a;
|
||||
Rtr.z() = b;
|
||||
Rtr = tensor(c, a, b);
|
||||
break;
|
||||
|
||||
case e3e1:
|
||||
Rtr.x() = b;
|
||||
Rtr.y() = c;
|
||||
Rtr.z() = a;
|
||||
Rtr = tensor(b, c, a);
|
||||
break;
|
||||
|
||||
default:
|
||||
FatalErrorIn("coordinateRotation::calcTransform()")
|
||||
<< "programmer error" << endl
|
||||
<< abort(FatalError);
|
||||
// To satisfy compiler warnings
|
||||
Rtr = tensor::zero;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -172,19 +172,19 @@ public:
|
||||
}
|
||||
|
||||
//- Return local Cartesian x-axis
|
||||
vector& e1() const
|
||||
const vector e1() const
|
||||
{
|
||||
return tensor::T().x();
|
||||
}
|
||||
|
||||
//- Return local Cartesian y-axis
|
||||
vector& e2() const
|
||||
const vector e2() const
|
||||
{
|
||||
return tensor::T().y();
|
||||
}
|
||||
|
||||
//- Return local Cartesian z-axis
|
||||
vector& e3() const
|
||||
const vector e3() const
|
||||
{
|
||||
return tensor::T().z();
|
||||
}
|
||||
|
||||
@ -346,33 +346,33 @@ public:
|
||||
}
|
||||
|
||||
//- Return local Cartesian x-axis
|
||||
const vector& e1() const
|
||||
const vector e1() const
|
||||
{
|
||||
return Rtr_.x();
|
||||
}
|
||||
|
||||
//- Return local Cartesian y-axis
|
||||
const vector& e2() const
|
||||
const vector e2() const
|
||||
{
|
||||
return Rtr_.y();
|
||||
}
|
||||
|
||||
//- Return local Cartesian z-axis
|
||||
const vector& e3() const
|
||||
const vector e3() const
|
||||
{
|
||||
return Rtr_.z();
|
||||
}
|
||||
|
||||
//- Return axis (e3: local Cartesian z-axis)
|
||||
// @deprecated method e3 is preferred (deprecated Apr 2008)
|
||||
const vector& axis() const
|
||||
const vector axis() const
|
||||
{
|
||||
return Rtr_.z();
|
||||
}
|
||||
|
||||
//- Return direction (e1: local Cartesian x-axis)
|
||||
// @deprecated method e1 is preferred (deprecated Apr 2008)
|
||||
const vector& direction() const
|
||||
const vector direction() const
|
||||
{
|
||||
return Rtr_.x();
|
||||
}
|
||||
|
||||
10
src/parallel/Allwmake
Executable file
10
src/parallel/Allwmake
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
set -x
|
||||
|
||||
decompose/Allwmake
|
||||
reconstruct/Allwmake
|
||||
wmake libso distributed
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
@ -4,5 +4,7 @@ simpleGeomDecomp/simpleGeomDecomp.C
|
||||
hierarchGeomDecomp/hierarchGeomDecomp.C
|
||||
manualDecomp/manualDecomp.C
|
||||
multiLevelDecomp/multiLevelDecomp.C
|
||||
structuredDecomp/topoDistanceData.C
|
||||
structuredDecomp/structuredDecomp.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libdecompositionMethods
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
EXE_INC =
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
LIB_LIBS =
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
const dictionary& decompositionDict_;
|
||||
const dictionary decompositionDict_;
|
||||
label nProcessors_;
|
||||
|
||||
|
||||
|
||||
@ -269,10 +269,10 @@ void Foam::hierarchGeomDecomp::findBinary
|
||||
|
||||
while (true)
|
||||
{
|
||||
label weightedSize = returnReduce
|
||||
scalar weightedSize = returnReduce
|
||||
(
|
||||
sortedWeightedSizes[mid] - sortedWeightedSizes[minIndex],
|
||||
sumOp<label>()
|
||||
sumOp<scalar>()
|
||||
);
|
||||
|
||||
if (debug)
|
||||
|
||||
@ -0,0 +1,201 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "structuredDecomp.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "IFstream.H"
|
||||
#include "FaceCellWave.H"
|
||||
#include "topoDistanceData.H"
|
||||
#include "fvMeshSubset.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(structuredDecomp, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
decompositionMethod,
|
||||
structuredDecomp,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::structuredDecomp::structuredDecomp(const dictionary& decompositionDict)
|
||||
:
|
||||
decompositionMethod(decompositionDict)
|
||||
{
|
||||
dictionary myDict = decompositionDict_.subDict(typeName + "Coeffs");
|
||||
myDict.set("numberOfSubdomains", nDomains());
|
||||
method_ = decompositionMethod::New(myDict);
|
||||
patches_ = wordList(myDict.lookup("patches"));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::structuredDecomp::parallelAware() const
|
||||
{
|
||||
return method_().parallelAware();
|
||||
}
|
||||
|
||||
|
||||
Foam::labelList Foam::structuredDecomp::decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
{
|
||||
labelList patchIDs(patches_.size());
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
|
||||
label nFaces = 0;
|
||||
forAll(patches_, i)
|
||||
{
|
||||
patchIDs[i] = pbm.findPatchID(patches_[i]);
|
||||
|
||||
if (patchIDs[i] == -1)
|
||||
{
|
||||
FatalErrorIn("structuredDecomp::decompose(..)")
|
||||
<< "Cannot find patch " << patches_[i] << endl
|
||||
<< "Valid patches are " << pbm.names()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
nFaces += pbm[patchIDs[i]].size();
|
||||
}
|
||||
|
||||
// Extract a submesh.
|
||||
labelHashSet patchCells(2*nFaces);
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
const unallocLabelList& fc = pbm[patchIDs[i]].faceCells();
|
||||
forAll(fc, i)
|
||||
{
|
||||
patchCells.insert(fc[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Subset the layer of cells next to the patch
|
||||
fvMeshSubset subsetter(dynamic_cast<const fvMesh&>(mesh));
|
||||
subsetter.setLargeCellSubset(patchCells);
|
||||
const fvMesh& subMesh = subsetter.subMesh();
|
||||
pointField subCc(cc, subsetter.cellMap());
|
||||
scalarField subWeights(cWeights, subsetter.cellMap());
|
||||
|
||||
// Decompose the layer of cells
|
||||
labelList subDecomp(method_().decompose(subMesh, subCc, subWeights));
|
||||
|
||||
|
||||
// Transfer to final decomposition
|
||||
labelList finalDecomp(cc.size(), -1);
|
||||
forAll(subDecomp, i)
|
||||
{
|
||||
finalDecomp[subsetter.cellMap()[i]] = subDecomp[i];
|
||||
}
|
||||
|
||||
// Field on cells and faces.
|
||||
List<topoDistanceData> cellData(mesh.nCells());
|
||||
List<topoDistanceData> faceData(mesh.nFaces());
|
||||
|
||||
// Start of changes
|
||||
labelList patchFaces(nFaces);
|
||||
List<topoDistanceData> patchData(nFaces);
|
||||
nFaces = 0;
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
const polyPatch& pp = pbm[patchIDs[i]];
|
||||
const unallocLabelList& fc = pp.faceCells();
|
||||
forAll(fc, i)
|
||||
{
|
||||
patchFaces[nFaces] = pp.start()+i;
|
||||
patchData[nFaces] = topoDistanceData(finalDecomp[fc[i]], 0);
|
||||
nFaces++;
|
||||
}
|
||||
}
|
||||
|
||||
// Propagate information inwards
|
||||
FaceCellWave<topoDistanceData> deltaCalc
|
||||
(
|
||||
mesh,
|
||||
patchFaces,
|
||||
patchData,
|
||||
faceData,
|
||||
cellData,
|
||||
mesh.globalData().nTotalCells()
|
||||
);
|
||||
|
||||
// And extract
|
||||
bool haveWarned = false;
|
||||
forAll(finalDecomp, cellI)
|
||||
{
|
||||
if (!cellData[cellI].valid())
|
||||
{
|
||||
if (!haveWarned)
|
||||
{
|
||||
WarningIn("structuredDecomp::decompose(..)")
|
||||
<< "Did not visit some cells, e.g. cell " << cellI
|
||||
<< " at " << mesh.cellCentres()[cellI] << endl
|
||||
<< "Assigning these cells to domain 0." << endl;
|
||||
haveWarned = true;
|
||||
}
|
||||
finalDecomp[cellI] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
finalDecomp[cellI] = cellData[cellI].data();
|
||||
}
|
||||
}
|
||||
|
||||
return finalDecomp;
|
||||
}
|
||||
|
||||
|
||||
Foam::labelList Foam::structuredDecomp::decompose
|
||||
(
|
||||
const labelListList& globalPointPoints,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"structuredDecomp::decompose\n"
|
||||
"(\n"
|
||||
" const labelListList&,\n"
|
||||
" const pointField&,\n"
|
||||
" const scalarField&\n"
|
||||
")\n"
|
||||
);
|
||||
|
||||
return labelList::null();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,142 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-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::structuredDecomp
|
||||
|
||||
Description
|
||||
Decomposition given using consecutive application of decomposers.
|
||||
|
||||
SourceFiles
|
||||
structuredDecomp.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef structuredDecomp_H
|
||||
#define structuredDecomp_H
|
||||
|
||||
#include "decompositionMethod.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class structuredDecomp Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class structuredDecomp
|
||||
:
|
||||
public decompositionMethod
|
||||
{
|
||||
// Private data
|
||||
|
||||
autoPtr<decompositionMethod> method_;
|
||||
|
||||
wordList patches_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Given connectivity across processors work out connectivity
|
||||
// for a (consistent) subset
|
||||
void subsetGlobalCellCells
|
||||
(
|
||||
const label nDomains,
|
||||
const label domainI,
|
||||
const labelList& dist,
|
||||
|
||||
const labelListList& cellCells,
|
||||
const labelList& set,
|
||||
labelListList& subCellCells,
|
||||
labelList& cutConnections
|
||||
) const;
|
||||
|
||||
//- Decompose level methodI without addressing
|
||||
void decompose
|
||||
(
|
||||
const labelListList& pointPoints,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights,
|
||||
const labelList& pointMap, // map back to original points
|
||||
const label levelI,
|
||||
|
||||
labelField& finalDecomp
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const structuredDecomp&);
|
||||
structuredDecomp(const structuredDecomp&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("structured");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given the decomposition dictionary
|
||||
structuredDecomp(const dictionary& decompositionDict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~structuredDecomp()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Is method parallel aware (i.e. does it synchronize domains across
|
||||
// proc boundaries)
|
||||
virtual bool parallelAware() const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Use the
|
||||
// mesh connectivity (if needed)
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
);
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Explicitly
|
||||
// provided connectivity - does not use mesh_.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,51 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "topoDistanceData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Foam::Ostream& os,
|
||||
const Foam::topoDistanceData& wDist
|
||||
)
|
||||
{
|
||||
return os << wDist.data_ << token::SPACE << wDist.distance_;
|
||||
}
|
||||
|
||||
|
||||
Foam::Istream& Foam::operator>>
|
||||
(
|
||||
Foam::Istream& is,
|
||||
Foam::topoDistanceData& wDist
|
||||
)
|
||||
{
|
||||
return is >> wDist.data_ >> wDist.distance_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,192 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::topoDistanceData
|
||||
|
||||
Description
|
||||
For use with FaceCellWave. Determines topological distance to starting faces
|
||||
|
||||
SourceFiles
|
||||
topoDistanceDataI.H
|
||||
topoDistanceData.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef topoDistanceData_H
|
||||
#define topoDistanceData_H
|
||||
|
||||
#include "point.H"
|
||||
#include "tensor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class polyPatch;
|
||||
class polyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class topoDistanceData Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class topoDistanceData
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Starting data
|
||||
label data_;
|
||||
|
||||
//- Distance
|
||||
label distance_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
inline topoDistanceData();
|
||||
|
||||
//- Construct from count
|
||||
inline topoDistanceData
|
||||
(
|
||||
const label data,
|
||||
const label distance
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
|
||||
inline label data() const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
inline label distance() const
|
||||
{
|
||||
return distance_;
|
||||
}
|
||||
|
||||
|
||||
// Needed by FaceCellWave
|
||||
|
||||
//- Check whether origin has been changed at all or
|
||||
// still contains original (invalid) value.
|
||||
inline bool valid() const;
|
||||
|
||||
//- Check for identical geometrical data. Used for cyclics checking.
|
||||
inline bool sameGeometry
|
||||
(
|
||||
const polyMesh&,
|
||||
const topoDistanceData&,
|
||||
const scalar
|
||||
) const;
|
||||
|
||||
//- Convert any absolute coordinates into relative to (patch)face
|
||||
// centre
|
||||
inline void leaveDomain
|
||||
(
|
||||
const polyMesh&,
|
||||
const polyPatch&,
|
||||
const label patchFaceI,
|
||||
const point& faceCentre
|
||||
);
|
||||
|
||||
//- Reverse of leaveDomain
|
||||
inline void enterDomain
|
||||
(
|
||||
const polyMesh&,
|
||||
const polyPatch&,
|
||||
const label patchFaceI,
|
||||
const point& faceCentre
|
||||
);
|
||||
|
||||
//- Apply rotation matrix to any coordinates
|
||||
inline void transform
|
||||
(
|
||||
const polyMesh&,
|
||||
const tensor&
|
||||
);
|
||||
|
||||
//- Influence of neighbouring face.
|
||||
inline bool updateCell
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisCellI,
|
||||
const label neighbourFaceI,
|
||||
const topoDistanceData& neighbourInfo,
|
||||
const scalar tol
|
||||
);
|
||||
|
||||
//- Influence of neighbouring cell.
|
||||
inline bool updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisFaceI,
|
||||
const label neighbourCellI,
|
||||
const topoDistanceData& neighbourInfo,
|
||||
const scalar tol
|
||||
);
|
||||
|
||||
//- Influence of different value on same face.
|
||||
inline bool updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisFaceI,
|
||||
const topoDistanceData& neighbourInfo,
|
||||
const scalar tol
|
||||
);
|
||||
|
||||
// Member Operators
|
||||
|
||||
// Needed for List IO
|
||||
inline bool operator==(const topoDistanceData&) const;
|
||||
|
||||
inline bool operator!=(const topoDistanceData&) const;
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Ostream& operator<<(Ostream&, const topoDistanceData&);
|
||||
friend Istream& operator>>(Istream&, topoDistanceData&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "topoDistanceDataI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,194 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "polyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Null constructor
|
||||
inline Foam::topoDistanceData::topoDistanceData()
|
||||
:
|
||||
data_(-1),
|
||||
distance_(-1)
|
||||
{}
|
||||
|
||||
|
||||
// Construct from components
|
||||
inline Foam::topoDistanceData::topoDistanceData
|
||||
(
|
||||
const label data,
|
||||
const label distance
|
||||
)
|
||||
:
|
||||
data_(data),
|
||||
distance_(distance)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline bool Foam::topoDistanceData::valid() const
|
||||
{
|
||||
return distance_ != -1;
|
||||
}
|
||||
|
||||
|
||||
// No geometric data so never any problem on cyclics
|
||||
inline bool Foam::topoDistanceData::sameGeometry
|
||||
(
|
||||
const polyMesh&,
|
||||
const topoDistanceData&,
|
||||
const scalar
|
||||
) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// No geometric data.
|
||||
inline void Foam::topoDistanceData::leaveDomain
|
||||
(
|
||||
const polyMesh&,
|
||||
const polyPatch& patch,
|
||||
const label patchFaceI,
|
||||
const point& faceCentre
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// No geometric data.
|
||||
inline void Foam::topoDistanceData::transform
|
||||
(
|
||||
const polyMesh&,
|
||||
const tensor& rotTensor
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// No geometric data.
|
||||
inline void Foam::topoDistanceData::enterDomain
|
||||
(
|
||||
const polyMesh&,
|
||||
const polyPatch& patch,
|
||||
const label patchFaceI,
|
||||
const point& faceCentre
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// Update cell with neighbouring face information
|
||||
inline bool Foam::topoDistanceData::updateCell
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisCellI,
|
||||
const label neighbourFaceI,
|
||||
const topoDistanceData& neighbourInfo,
|
||||
const scalar tol
|
||||
)
|
||||
{
|
||||
if (distance_ == -1)
|
||||
{
|
||||
data_ = neighbourInfo.data_;
|
||||
distance_ = neighbourInfo.distance_ + 1;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Update face with neighbouring cell information
|
||||
inline bool Foam::topoDistanceData::updateFace
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label thisFaceI,
|
||||
const label neighbourCellI,
|
||||
const topoDistanceData& neighbourInfo,
|
||||
const scalar tol
|
||||
)
|
||||
{
|
||||
// From cell to its faces.
|
||||
|
||||
if (distance_ == -1)
|
||||
{
|
||||
operator=(neighbourInfo);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Update face with coupled face information
|
||||
inline bool Foam::topoDistanceData::updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisFaceI,
|
||||
const topoDistanceData& neighbourInfo,
|
||||
const scalar tol
|
||||
)
|
||||
{
|
||||
// From face to face (e.g. coupled faces)
|
||||
if (distance_ == -1)
|
||||
{
|
||||
operator=(neighbourInfo);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline bool Foam::topoDistanceData::operator==
|
||||
(
|
||||
const Foam::topoDistanceData& rhs
|
||||
) const
|
||||
{
|
||||
return data() == rhs.data() && distance() == rhs.distance();
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::topoDistanceData::operator!=
|
||||
(
|
||||
const Foam::topoDistanceData& rhs
|
||||
) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
3
src/parallel/distributed/Make/files
Normal file
3
src/parallel/distributed/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
distributedTriSurfaceMesh/distributedTriSurfaceMesh.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libdistributed
|
||||
9
src/parallel/distributed/Make/options
Normal file
9
src/parallel/distributed/Make/options
Normal file
@ -0,0 +1,9 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-ltriSurface \
|
||||
-ldecompositionMethods \
|
||||
-lmeshTools
|
||||
@ -313,7 +313,7 @@ void Foam::cuttingPlane::walkCellCuts
|
||||
face f(faceVerts);
|
||||
|
||||
// Orient face to point in the same direction as the plane normal
|
||||
if ((f.normal(cutPoints) && normal()) < 0)
|
||||
if ((f.normal(cutPoints) & normal()) < 0)
|
||||
{
|
||||
f = f.reverseFace();
|
||||
}
|
||||
|
||||
@ -1008,7 +1008,7 @@ Foam::surfaceFilmModels::kinematicSingleLayer::T() const
|
||||
"const volScalarField& kinematicSingleLayer::T() const"
|
||||
) << "T field not available for " << type() << abort(FatalError);
|
||||
|
||||
return reinterpret_cast<const volScalarField&>(null);
|
||||
return volScalarField::null();
|
||||
}
|
||||
|
||||
|
||||
@ -1020,7 +1020,7 @@ Foam::surfaceFilmModels::kinematicSingleLayer::cp() const
|
||||
"const volScalarField& kinematicSingleLayer::cp() const"
|
||||
) << "cp field not available for " << type() << abort(FatalError);
|
||||
|
||||
return reinterpret_cast<const volScalarField&>(null);
|
||||
return volScalarField::null();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -137,7 +137,7 @@ const Foam::volVectorField& Foam::surfaceFilmModels::noFilm::U() const
|
||||
"const volScalarField& noFilm::U() const"
|
||||
) << "U field not available for " << type() << abort(FatalError);
|
||||
|
||||
return reinterpret_cast<const volVectorField&>(null);
|
||||
return volVectorField::null();
|
||||
}
|
||||
|
||||
|
||||
@ -148,7 +148,7 @@ const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::rho() const
|
||||
"const volScalarField& noFilm::rho() const"
|
||||
) << "rho field not available for " << type() << abort(FatalError);
|
||||
|
||||
return reinterpret_cast<const volScalarField&>(null);
|
||||
return volScalarField::null();
|
||||
}
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::T() const
|
||||
"const Foam::volScalarField& Foam::noFilm::T() const"
|
||||
) << "T field not available for " << type() << abort(FatalError);
|
||||
|
||||
return reinterpret_cast<const volScalarField&>(null);
|
||||
return volScalarField::null();
|
||||
}
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::cp() const
|
||||
"const volScalarField& noFilm::cp() const"
|
||||
) << "cp field not available for " << type() << abort(FatalError);
|
||||
|
||||
return reinterpret_cast<const volScalarField&>(null);
|
||||
return volScalarField::null();
|
||||
}
|
||||
|
||||
|
||||
@ -183,7 +183,7 @@ Foam::surfaceFilmModels::noFilm::massForPrimary() const
|
||||
) << "massForPrimary field not available for " << type()
|
||||
<< abort(FatalError);
|
||||
|
||||
return reinterpret_cast<const volScalarField&>(null);
|
||||
return volScalarField::null();
|
||||
}
|
||||
|
||||
|
||||
@ -196,7 +196,7 @@ Foam::surfaceFilmModels::noFilm::diametersForPrimary() const
|
||||
) << "diametersForPrimary field not available for " << type()
|
||||
<< abort(FatalError);
|
||||
|
||||
return reinterpret_cast<const volScalarField&>(null);
|
||||
return volScalarField::null();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -75,6 +75,12 @@ tmp<volScalarField> SpalartAllmarasDDES::fd(const volScalarField& S) const
|
||||
}
|
||||
|
||||
|
||||
tmp<volScalarField> SpalartAllmarasDDES::S(const volTensorField& gradU) const
|
||||
{
|
||||
return sqrt(2.0)*mag(symm(gradU));
|
||||
}
|
||||
|
||||
|
||||
tmp<volScalarField> SpalartAllmarasDDES::dTilda(const volScalarField& S) const
|
||||
{
|
||||
return max
|
||||
|
||||
@ -81,6 +81,8 @@ protected:
|
||||
//- Length scale
|
||||
virtual tmp<volScalarField> dTilda(const volScalarField& S) const;
|
||||
|
||||
virtual tmp<volScalarField> S(const volTensorField& gradU) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user