BeamAdapter
Loading...
Searching...
No Matches
AdaptiveBeamMapping< TIn, TOut > Class Template Reference

Set the positions and velocities of points attached to a beam using linear interpolation between DOFs. More...

#include <AdaptiveBeamMapping.h>

Inheritance diagram for AdaptiveBeamMapping< TIn, TOut >:

Classes

struct  PosPointDefinition

Public Types

typedef Mapping< TIn, TOut > Inherit
typedef TIn In
typedef TOut Out
typedef Out::Coord::value_type Real
typedef Out::Coord Coord
typedef Out::Deriv Deriv
typedef Out::VecCoord VecCoord
typedef Out::VecDeriv VecDeriv
typedef Out::MatrixDeriv OutMatrixDeriv
typedef In::Coord::value_type InReal
typedef In::Deriv InDeriv
typedef In::VecCoord InVecCoord
typedef In::VecDeriv InVecDeriv
typedef In::MatrixDeriv InMatrixDeriv
typedef type::vector< unsigned int > VecIndex
typedef BaseMeshTopology::EdgeID ElementID
typedef type::vector< BaseMeshTopology::Edge > VecEdges
typedef type::vector< BaseMeshTopology::EdgeID > VecElementID
typedef SolidTypes< InReal >::Transform Transform
typedef std::pair< int, Transform > IndexedTransform
typedef SolidTypes< InReal >::SpatialVector SpatialVector
typedef Vec< 3, Real > Vec3
typedef Vec< 6, Real > Vec6
typedef Mat< 3, 12, Real > Mat3x12
typedef Mat< 12, 3, Real > Mat12x3
typedef Mat< 6, 12, Real > Mat6x12
typedef Mat< 12, 6, Real > Mat12x6
typedef BaseBeamInterpolation< TIn > BInterpolation
typedef std::pair< unsigned int, Vec3 > BeamIdAndBaryCoord

Public Member Functions

 SOFA_CLASS (SOFA_TEMPLATE2(AdaptiveBeamMapping, TIn, TOut), SOFA_TEMPLATE2(Mapping, TIn, TOut))
 AdaptiveBeamMapping (State< In > *from=nullptr, State< Out > *to=nullptr, BaseBeamInterpolation< TIn > *interpolation=nullptr, bool isSubMapping=false)
virtual void init () override
virtual void bwdInit () override
virtual void reset () override
virtual void reinit () override
virtual void apply (const MechanicalParams *mparams, Data< VecCoord > &out, const Data< InVecCoord > &in) override
virtual void applyJ (const MechanicalParams *mparams, Data< VecDeriv > &out, const Data< InVecDeriv > &in) override
virtual void applyJT (const MechanicalParams *mparams, Data< InVecDeriv > &out, const Data< VecDeriv > &in) override
virtual void applyJT (const ConstraintParams *cparams, Data< InMatrixDeriv > &out, const Data< OutMatrixDeriv > &in) override
void printIstrumentInfo () const
int addPoint (const Coord &c, int indexFrom)
int addContactPoint (const Vec3 &bary)
void setBarycentricMapping ()
int addBaryPoint (const int &beamId, const Vec3 &baryCoord, bool straightlineSplineOption)
void clear (int size)
void computeIdxAndBaryCoordsForAbs (unsigned int &b, Real &xBary, const Real &xAbs)
void beginAddContactPoint ()
void clearIdPointSubMap ()
void addIdPointSubMap (unsigned int id)
void setUseCurvAbs (bool value)
const type::vector< PosPointDefinition > & getPointBeamDistribution () const
SOFA_BEAMADAPTER_API void apply (const MechanicalParams *, Data< VecCoord > &dOut, const Data< InVecCoord > &dIn)
SOFA_BEAMADAPTER_API void apply (const MechanicalParams *, Data< VecCoord > &dOut, const Data< InVecCoord > &dIn)

Public Attributes

Data< bool > d_useCurvAbs
Data< type::vector< Vec3 > > d_points
Data< double > d_proximity
Data< bool > d_contactDuplicate
Data< std::string > d_inputMapName
Data< double > d_nbPointsPerBeam
Data< type::vector< Real > > d_segmentsCurvAbs
Data< bool > d_parallelMapping
SingleLink< AdaptiveBeamMapping< TIn, TOut >, BInterpolation, BaseLink::FLAG_STOREPATH|BaseLink::FLAG_STRONGLINK > l_adaptativebeamInterpolation

Protected Member Functions

void applyJonPoint (unsigned int i, SpatialVector &VNode0input, SpatialVector &VNode1input, Deriv &vOutput, const InVecCoord &x)
void applyJTonPoint (unsigned int i, const Deriv &finput, SpatialVector &FNode0output, SpatialVector &FNode1output, const InVecCoord &x)
void computeJacobianOnPoint (unsigned int i, const typename In::VecCoord &x)
void computeDistribution ()
SOFA_BEAMADAPTER_API void applyJonPoint (unsigned int i, SpatialVector &VNode0input, SpatialVector &VNode1input, Deriv &vOutput, const InVecCoord &x)
SOFA_BEAMADAPTER_API void applyJTonPoint (unsigned int i, const Deriv &finput, SpatialVector &FNode0output, SpatialVector &FNode1output, const InVecCoord &x)
SOFA_BEAMADAPTER_API void computeJacobianOnPoint (unsigned int i, const InVecCoord &x)
SOFA_BEAMADAPTER_API void applyJonPoint (unsigned int i, SpatialVector &VNode0input, SpatialVector &VNode1input, Deriv &vOutput, const InVecCoord &x)
SOFA_BEAMADAPTER_API void applyJTonPoint (unsigned int i, const Deriv &finput, SpatialVector &FNode0output, SpatialVector &FNode1output, const InVecCoord &x)
SOFA_BEAMADAPTER_API void computeJacobianOnPoint (unsigned int i, const InVecCoord &x)

Protected Attributes

TopologyContainer * m_topology
type::vector< PosPointDefinition > m_pointBeamDistribution
AdaptiveBeamMapping< TIn, TOut > * m_inputMapping
 for continuous_friction_contact:
type::vector< unsigned int > m_idPointSubMap
bool m_isSubMapping
bool m_isBarycentricMapping

Detailed Description

template<class TIn, class TOut>
class beamadapter::AdaptiveBeamMapping< TIn, TOut >

Set the positions and velocities of points attached to a beam using linear interpolation between DOFs.

This is a component: https://www.sofa-framework.org/community/doc/programming-with-sofa/create-your-component/

Member Data Documentation

◆ d_contactDuplicate

template<class TIn, class TOut>
Data<bool> d_contactDuplicate

if true, this mapping is a copy of an input mapping and is used to gather contact points (ContinuousFrictionContact Response)

◆ d_inputMapName

template<class TIn, class TOut>
Data<std::string> d_inputMapName

if contactDuplicate==true, it provides the name of the input mapping

◆ d_nbPointsPerBeam

template<class TIn, class TOut>
Data<double> d_nbPointsPerBeam

if non zero, we will adapt the points depending on the discretization, with this num of points per beam (compatible with useCurvAbs)

◆ d_parallelMapping

template<class TIn, class TOut>
Data<bool> d_parallelMapping

flag to enable parallel internal computation of apply/applyJ

◆ d_points

template<class TIn, class TOut>
Data<type::vector<Vec3> > d_points

defines the mapped points along the beam axis (in beam frame local coordinates)

◆ d_proximity

template<class TIn, class TOut>
Data<double> d_proximity

if positive, the mapping is modified for the constraints to take into account the lever created by the proximity

◆ d_segmentsCurvAbs

template<class TIn, class TOut>
Data<type::vector<Real> > d_segmentsCurvAbs

(output) the abscissa of each created point on the collision model

◆ d_useCurvAbs

template<class TIn, class TOut>
Data<bool> d_useCurvAbs

true if the curvilinear abscissa of the points remains the same during the simulation if not the curvilinear abscissa moves with adaptivity and the num of segment per beam is always the same