20 #ifndef POLYNOMIAL_FRUSTUM_H_ 21 #define POLYNOMIAL_FRUSTUM_H_ 23 #include <mbsim/contours/contour.h> 24 #include <mbsim/contours/plate.h> 25 #include <mbsim/utils/colors.h> 26 #include <fmatvec/fmatvec.h> 27 #include <mbsim/functions/function.h> 28 #include <mbsim/utils/boost_parameters.h> 53 void init(
InitStage stage,
const InitConfigSet &config)
override;
62 fmatvec::Vec2
evalZeta(
const fmatvec::Vec3 &WrPoint)
override;
87 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBV, tag, (optional (
polynomialPoints,(
int),0)(
circularPoints,(
int),25)(diffuseColor,(
const fmatvec::Vec3&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(
transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) { enableOpenMBV_(diffuseColor,
transparency,
polynomialPoints,
circularPoints); }
107 double evalValue(
const double & x)
const;
153 fmatvec::Vec3
evalKrPS(
const fmatvec::Vec2 &zeta)
override;
158 fmatvec::Vec3
evalKn(
const fmatvec::Vec2 &zeta)
override;
163 fmatvec::Vec3
evalKu(
const fmatvec::Vec2 &zeta)
override;
168 fmatvec::Vec3
evalKv(
const fmatvec::Vec2 &zeta)
override;
179 fmatvec::Vec3
evalWn(
const fmatvec::Vec2 &zeta)
override;
180 fmatvec::Vec3
evalWu(
const fmatvec::Vec2 &zeta)
override;
181 fmatvec::Vec3
evalWv(
const fmatvec::Vec2 &zeta)
override;
230 void enableOpenMBV_(
const fmatvec::Vec3 &dc,
double tp,
int polynomialPoints_,
int circularPoints_);
246 double operator()(
const double &x)
override;
247 void initializeUsingXML() {
fmatvec::Vec3 evalKn(const fmatvec::Vec2 &zeta) override
returns the normal in local coordinates of the frustum at the position (x, phi)
Definition: polynomial_frustum.cc:176
fmatvec::Vec3 evalWv(const fmatvec::Vec2 &zeta) override
Definition: polynomial_frustum.cc:234
basic class for rigid contours
Definition: rigid_contour.h:37
MBSim::RGBColor color
color values for the iv-body
Definition: polynomial_frustum.h:208
double getHeight() const
return height of frustum
Definition: polynomial_frustum.h:79
double transparency
transparency value for the body
Definition: polynomial_frustum.h:213
fmatvec::Vec3 getEnclosingSphereCenter()
return the center of the enclosing sphere
Definition: polynomial_frustum.cc:156
PolynomialFrustum(const std::string &name, const fmatvec::Vec ¶m_)
Constructor.
Definition: polynomial_frustum.cc:34
void updateEnclosingSphere()
Definition: polynomial_frustum.cc:209
double evalValueD2(const double &x)
get value at position of second derivative
Definition: polynomial_frustum.cc:126
void setHeight(const double &height_)
set height of frustum
Definition: polynomial_frustum.h:69
double height
height of the frustum
Definition: polynomial_frustum.h:198
fmatvec::Vec3 evalKu(const fmatvec::Vec2 &zeta) override
returns the tangent in radial direction in local coordinates of the frustum at the position (x,...
Definition: polynomial_frustum.cc:187
double sphereRadius
radius of the enclosing sphere
Definition: polynomial_frustum.h:203
double getEnclosingSphereRadius()
take the largest one among the distance from ((a+b)/2,0) to (a,f(a)),(b,f(b)) and (x,...
Definition: polynomial_frustum.cc:152
double getXPolyMax()
get inner peak value of the polynomial
Definition: polynomial_frustum.cc:142
Frustum contour with a polynomial radius over height course.
Definition: polynomial_frustum.h:38
void setColor(const MBSim::RGBColor &color_)
set color of body
Definition: polynomial_frustum.cc:86
fmatvec::Vec3 evalKv(const fmatvec::Vec2 &zeta) override
returns the tangent in azimuthal direction in local coordinates of the frustum at the point x,...
Definition: polynomial_frustum.cc:198
fmatvec::Vec3 evalWu(const fmatvec::Vec2 &zeta) override
Definition: polynomial_frustum.cc:230
InitStage
The stages of the initialization.
Definition: element.h:62
const fmatvec::Vec & getPolynomialParameters()
get coefficient vector of the polynomial
Definition: polynomial_frustum.cc:162
~PolynomialFrustum() override=default
Destructor.
Definition: contact_kinematics.h:32
BOOST_PARAMETER_MEMBER_FUNCTION((void), enableOpenMBV, tag,(optional(polynomialPoints,(int), 0)(circularPoints,(int), 25)(diffuseColor,(const fmatvec::Vec3 &), fmatvec::Vec3(std::vector< double >{-1, 1, 1}))(transparency,(double), 0)(pointSize,(double), 0)(lineWidth,(double), 0)))
enable visualisation
Definition: polynomial_frustum.h:87
std::string name
name of element
Definition: element.h:249
double evalValueD1(const double &x)
get value at position of first derivative
Definition: polynomial_frustum.cc:110
fmatvec::Vec parameters
vector holding our parameters of the polynom describing the frustum (radius over height) parameters=[...
Definition: polynomial_frustum.h:193
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: polynomial_frustum.cc:41
void createInventorFile()
create inventor file for visualisation
Definition: polynomial_frustum.cc:238
fmatvec::Vec3 evalKrPS(const fmatvec::Vec2 &zeta) override
returns the point in local coordinates of the frustum at the position (x, phi)
Definition: polynomial_frustum.cc:166
fmatvec::Vec2 evalZeta(const fmatvec::Vec3 &WrPoint) override
returns the two lagrange parameters index 0: x, height coordinate of frustum index 1: phi,...
Definition: polynomial_frustum.cc:58
defines additive color using values for each color between [0,1]
Definition: colors.h:33
double evalValue(const double &x)
get value at position of 0 derivative
Definition: polynomial_frustum.cc:94
int polynomialPoints
grid points in polynomial direction
Definition: polynomial_frustum.h:218
void setTransparency(const double &transparency_)
set transparency of body
Definition: polynomial_frustum.cc:90
int circularPoints
grid points in polynomial direction
Definition: polynomial_frustum.h:223
double getHeight()
return height of frustum
Definition: polynomial_frustum.h:74
fmatvec::Vec3 evalWn(const fmatvec::Vec2 &zeta) override
in 2D plane, given a point outside a polynomial curve, search for the closest point on the curve to t...
Definition: polynomial_frustum.cc:226
namespace MBSim
Definition: eigenanalyzer.cc:47