37namespace extrudeModels
53 vertices_(coeffDict_.
lookup(
"vertices")),
56 coeffDict_.
lookup(
"edges"),
57 blockEdge::iNew(coeffDict_, geometry_, vertices_)
59 x_(segments_.size() + 1),
60 y_(segments_.size() + 1),
61 relTol_(coeffDict_.getOrDefault<scalar>(
"toleranceCheck", SMALL))
64 for (label i=1; i < segments_.
size(); ++i)
67 const vector x0 = segments_[i-1].position(1);
68 const vector x1 = segments_[i].position(0);
70 if (
mag(x1-x0) > SMALL)
73 <<
"Supplied polyline is not continuous." <<
endl
81 segments_[i-1].position(1)
82 - segments_[i-1].position(1-DELTA)
88 segments_[i].position(DELTA)
89 - segments_[i].position(0)
92 if ((v1 & v0) < (1 - relTol_))
95 <<
"Supplied polyline is not smooth." <<
endl
103 scalar totalLength = 0;
106 totalLength += segments_[i].length();
107 x_[i+1] = totalLength;
120 <<
tab <<
"Polyline start: " << p0_ <<
nl
121 <<
tab <<
"Polyline normal at start: " << n0_ <<
nl
122 <<
tab <<
"Polyline end: "
123 << segments_.
last().position(1) <<
nl
124 <<
tab <<
"Total length: " << totalLength <<
endl;
133 const point& surfacePoint,
134 const vector& surfaceNormal,
139 vector dp = (surfacePoint - p0_);
145 if (
mag((dp/
mag(dp)) & n0_) > relTol_)
148 <<
"The starting point of the polyline does not appear "
149 <<
"to lie of the supplied surface. Apparent absolute "
150 <<
"misalignment is " << (dp & n0_) <<
endl;
157 positionAndDirection(sumThickness(layer),
p,
n);
160 scalar cosTheta = (
n & n0_);
163 if (cosTheta < (1-SMALL))
185 if (i > segments_.
size()-1)
187 i = segments_.
size()-1;
192 p = segments_[i].position(
s);
200 segments_[i].position(
min(
s + DELTA, 1))
201 - segments_[i].position(
max(
s - DELTA, 0))
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
label size() const noexcept
The number of elements in the list.
T & last()
Return reference to the last element of the list.
Define a curved edge that is parameterized for 0<lambda<1 between the start/end points.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Top level extrusion model class.
Extrudes by transforming points along a polyline provided as a series of points and edge segments....
void positionAndDirection(const scalar lambda, vector &p, vector &n) const
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
Quaternion class used to perform rotations in 3D space.
vector transform(const vector &v) const
Rotate the given vector.
Lookup type of boundary radiation properties.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Interpolates y values from one curve to another with a different x distribution.
#define WarningInFunction
Report a warning using Foam::Warning.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< Type > interpolateXY(const scalarField &xNew, const scalarField &xOld, const Field< Type > &yOld)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
constexpr char nl
The newline '\n' character (0x0a)
constexpr char tab
The tab '\t' character(0x09)
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
#define forAll(list, i)
Loop across all elements in list.