mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy2/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -22,28 +22,21 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
polySplineEdge class : representation of a spline via a polyLine
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "polySplineEdge.H"
|
#include "polySplineEdge.H"
|
||||||
#include "BSpline.H"
|
#include "BSpline.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
defineTypeNameAndDebug(polySplineEdge, 0);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// Add the curvedEdge constructor functions to the hash tables
|
||||||
|
curvedEdge::addIstreamConstructorToTable<polySplineEdge>
|
||||||
defineTypeNameAndDebug(polySplineEdge, 0);
|
|
||||||
|
|
||||||
// Add the curvedEdge constructor functions to the hash tables
|
|
||||||
curvedEdge::addIstreamConstructorToTable<polySplineEdge>
|
|
||||||
addPolySplineEdgeIstreamConstructorToTable_;
|
addPolySplineEdgeIstreamConstructorToTable_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
@ -56,7 +49,7 @@ curvedEdge::addIstreamConstructorToTable<polySplineEdge>
|
|||||||
// note that the points are evenly spaced in the parameter mu, not
|
// note that the points are evenly spaced in the parameter mu, not
|
||||||
// in real space
|
// in real space
|
||||||
|
|
||||||
pointField polySplineEdge::intervening
|
Foam::pointField Foam::polySplineEdge::intervening
|
||||||
(
|
(
|
||||||
const pointField& otherknots,
|
const pointField& otherknots,
|
||||||
const label nbetweenKnots,
|
const label nbetweenKnots,
|
||||||
@ -72,7 +65,7 @@ pointField polySplineEdge::intervening
|
|||||||
|
|
||||||
label N = spl.nKnots();
|
label N = spl.nKnots();
|
||||||
scalar init = 1.0/(N - 1);
|
scalar init = 1.0/(N - 1);
|
||||||
scalar interval = (N - 3)/N;
|
scalar interval = (N - scalar(3))/N;
|
||||||
interval /= otherknots.size() + 1;
|
interval /= otherknots.size() + 1;
|
||||||
interval /= nbetweenKnots + 1;
|
interval /= nbetweenKnots + 1;
|
||||||
|
|
||||||
@ -93,8 +86,7 @@ pointField polySplineEdge::intervening
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
Foam::polySplineEdge::polySplineEdge
|
||||||
polySplineEdge::polySplineEdge
|
|
||||||
(
|
(
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
const label start,
|
const label start,
|
||||||
@ -118,14 +110,13 @@ polySplineEdge::polySplineEdge
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from Istream
|
Foam::polySplineEdge::polySplineEdge
|
||||||
polySplineEdge::polySplineEdge
|
|
||||||
(
|
(
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
Istream& is
|
Istream& is
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
curvedEdge(points, readLabel(is), readLabel(is)),
|
curvedEdge(points, is),
|
||||||
polyLine(pointField(0)),
|
polyLine(pointField(0)),
|
||||||
otherKnots_(is)
|
otherKnots_(is)
|
||||||
{
|
{
|
||||||
@ -144,23 +135,16 @@ polySplineEdge::polySplineEdge
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Return the position of a point on the curve given by
|
Foam::vector Foam::polySplineEdge::position(const scalar mu) const
|
||||||
// the parameter 0 <= lambda <= 1
|
|
||||||
vector polySplineEdge::position(const scalar mu) const
|
|
||||||
{
|
{
|
||||||
return polyLine::position(mu);
|
return polyLine::position(mu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Return the length of the curve
|
Foam::scalar Foam::polySplineEdge::length() const
|
||||||
scalar polySplineEdge::length() const
|
|
||||||
{
|
{
|
||||||
return polyLine::length();
|
return polyLine::length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -157,7 +157,7 @@ endif
|
|||||||
|
|
||||||
switch ("$WM_MPLIB")
|
switch ("$WM_MPLIB")
|
||||||
case OPENMPI:
|
case OPENMPI:
|
||||||
set ompi_version=1.2.5
|
set ompi_version=1.2.6
|
||||||
setenv OPENMPI_HOME $FOAM_SRC/other/openmpi-$ompi_version
|
setenv OPENMPI_HOME $FOAM_SRC/other/openmpi-$ompi_version
|
||||||
setenv OPENMPI_ARCH_PATH $OPENMPI_HOME/platforms/$WM_OPTIONS
|
setenv OPENMPI_ARCH_PATH $OPENMPI_HOME/platforms/$WM_OPTIONS
|
||||||
|
|
||||||
|
|||||||
@ -158,7 +158,7 @@ export FOAMX_CONFIG
|
|||||||
|
|
||||||
case "$WM_MPLIB" in
|
case "$WM_MPLIB" in
|
||||||
OPENMPI)
|
OPENMPI)
|
||||||
ompi_version=1.2.5
|
ompi_version=1.2.6
|
||||||
export OPENMPI_HOME=$FOAM_SRC/other/openmpi-$ompi_version
|
export OPENMPI_HOME=$FOAM_SRC/other/openmpi-$ompi_version
|
||||||
export OPENMPI_ARCH_PATH=$OPENMPI_HOME/platforms/$WM_OPTIONS
|
export OPENMPI_ARCH_PATH=$OPENMPI_HOME/platforms/$WM_OPTIONS
|
||||||
|
|
||||||
|
|||||||
@ -632,9 +632,8 @@ Foam::scalar Foam::face::sweptVol
|
|||||||
// summing their swept volumes.
|
// summing their swept volumes.
|
||||||
// Changed to deal with small concavity by using a central decomposition
|
// Changed to deal with small concavity by using a central decomposition
|
||||||
|
|
||||||
point centreOldPoint = Foam::average(points(oldPoints));
|
point centreOldPoint = centre(oldPoints);
|
||||||
|
point centreNewPoint = centre(newPoints);
|
||||||
point centreNewPoint = Foam::average(points(newPoints));
|
|
||||||
|
|
||||||
label nPoints = size();
|
label nPoints = size();
|
||||||
|
|
||||||
|
|||||||
@ -318,11 +318,15 @@ inline scalar triangle<Point, PointRef>::quality() const
|
|||||||
template<class Point, class PointRef>
|
template<class Point, class PointRef>
|
||||||
inline scalar triangle<Point, PointRef>::sweptVol(const triangle& t) const
|
inline scalar triangle<Point, PointRef>::sweptVol(const triangle& t) const
|
||||||
{
|
{
|
||||||
return (1.0/6.0)*
|
return (1.0/12.0)*
|
||||||
(
|
(
|
||||||
((t.a_ - a_) & ((b_ - a_)^(c_ - a_)))
|
((t.a_ - a_) & ((b_ - a_)^(c_ - a_)))
|
||||||
+ ((t.b_ - b_) & ((c_ - b_)^(t.a_ - b_)))
|
+ ((t.b_ - b_) & ((c_ - b_)^(t.a_ - b_)))
|
||||||
+ ((c_ - t.c_) & ((t.b_ - t.c_)^(t.a_ - t.c_)))
|
+ ((c_ - t.c_) & ((t.b_ - t.c_)^(t.a_ - t.c_)))
|
||||||
|
|
||||||
|
+ ((t.a_ - a_) & ((b_ - a_)^(c_ - a_)))
|
||||||
|
+ ((b_ - t.b_) & ((t.a_ - t.b_)^(t.c_ - t.b_)))
|
||||||
|
+ ((c_ - t.c_) & ((b_ - t.c_)^(t.a_ - t.c_)))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user