54 project_(
coeffDict_.getOrDefault(
"project", false))
62 offsetSurfPtr_.reset(
new triSurface(offsetName));
76 <<
"offsetSurface:\n " << offsetName
77 <<
" has different topology than the baseSurface:\n "
98point offsetSurface::operator()
100 const point& surfacePoint,
101 const vector& surfaceNormal,
114 baseSearchPtr_().findNearest(
samples, nearestDistSqr, info);
116 label triI = info[0].index();
121 const barycentric2D bary = baseTri.pointToBarycentric(surfacePoint);
126 const point offsetPoint
128 bary[0]*offsetTri.a()
129 + bary[1]*offsetTri.b()
130 + bary[2]*offsetTri.c()
133 point interpolatedPoint
135 surfacePoint + sumThickness(layer)*(offsetPoint-surfacePoint)
145 offsetSearchPtr_().findNearest
151 return info[0].hitPoint();
155 return interpolatedPoint;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label nEdges() const
Number of edges in patch.
label nPoints() const
Number of points supporting patch faces.
const Field< point_type > & points() const noexcept
Return reference to global points.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Top level extrusion model class.
extrudeModel(const extrudeModel &)=delete
No copy construct.
const dictionary & coeffDict_
scalar sumThickness(const label layer) const
Helper: calculate cumulative relative thickness for layer.
Extrudes by interpolating points from one surface to the other. Surfaces have to be topologically ide...
virtual ~offsetSurface()
Destructor.
offsetSurface(const dictionary &dict)
Construct from dictionary.
A class for handling file names.
string & expand(const bool allowEmpty=false)
Inplace expand initial tags, tildes, and all occurrences of environment variables as per stringOps::e...
Helper class to search on triSurface.
Triangulated surface description with patch information.
barycentric2D pointToBarycentric(const point &pt) const
Calculate the barycentric coordinates from the given point.
const Point & b() const noexcept
The second vertex.
const Point & c() const noexcept
The third vertex.
const Point & a() const noexcept
The first vertex.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Barycentric2D< scalar > barycentric2D
A scalar version of the templated Barycentric2D.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
vector point
Point is a vector.
triangle< point, const point & > triPointRef
A triangle using referred points.
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
scalarField samples(nIntervals, Zero)