SOFA API  7dc68564
Open source framework for multi-physics simuation
sofa::core::behavior::BaseVectorOperations Class Referenceabstract

#include <BaseVectorOperations.h>

Inheritance diagram for sofa::core::behavior::BaseVectorOperations:

Protected Attributes

const core::ExecParamsparams
 
core::objectmodel::BaseContextctx
 
SReal result
 

Public Member Functions

 BaseVectorOperations (const core::ExecParams *params, core::objectmodel::BaseContext *ctx)
 
virtual ~BaseVectorOperations ()
 
virtual void v_alloc (sofa::core::MultiVecCoordId &id, const VecIdProperties &properties={})=0
 Allocate a temporary vector. More...
 
virtual void v_alloc (sofa::core::MultiVecDerivId &id, const VecIdProperties &properties={})=0
 
virtual void v_free (sofa::core::MultiVecCoordId &id, bool interactionForceField=false, bool propagate=false)=0
 Free a previously allocated temporary vector. More...
 
virtual void v_free (sofa::core::MultiVecDerivId &id, bool interactionForceField=false, bool propagate=false)=0
 
virtual void v_realloc (sofa::core::MultiVecCoordId &id, bool interactionForceField=false, bool propagate=false, const VecIdProperties &properties={})=0
 keep already allocated vectors and allocates others. If interactionForceField, also allocates mechanical states linked by an InteractionForceField More...
 
virtual void v_realloc (sofa::core::MultiVecDerivId &id, bool interactionForceField=false, bool propagate=false, const VecIdProperties &properties={})=0
 
virtual void v_clear (core::MultiVecId v)=0
 v=0 More...
 
virtual void v_eq (core::MultiVecId v, core::ConstMultiVecId a)=0
 v=a More...
 
virtual void v_eq (core::MultiVecId v, core::ConstMultiVecId a, SReal f)=0
 v=f*a More...
 
virtual void v_peq (core::MultiVecId v, core::ConstMultiVecId a, SReal f=1.0)=0
 v+=f*a More...
 
virtual void v_teq (core::MultiVecId v, SReal f)=0
 v*=f More...
 
virtual void v_op (core::MultiVecId v, core::ConstMultiVecId a, core::ConstMultiVecId b, SReal f=1.0)=0
 v=a+b*f More...
 
virtual void v_multiop (const core::behavior::BaseMechanicalState::VMultiOp &o)=0
 
virtual void v_dot (core::ConstMultiVecId a, core::ConstMultiVecId b)=0
 a dot b ( get result using finish ) More...
 
virtual void v_norm (core::ConstMultiVecId a, unsigned l)=0
 Compute the norm of a vector ( get result using finish ). The type of norm is set by parameter l. Use 0 for the infinite norm. Note that the 2-norm is more efficiently computed using the square root of the dot product. More...
 
virtual void v_threshold (core::MultiVecId a, SReal threshold)=0
 nullify the values below the given threshold More...
 
virtual SReal finish ()=0
 
virtual void print (core::ConstMultiVecId v, std::ostream &out, std::string prefix="", std::string suffix="")=0
 
virtual size_t v_size (core::MultiVecId v)=0
 

Attribute details

◆ ctx

core::objectmodel::BaseContext* sofa::core::behavior::BaseVectorOperations::ctx
protected

◆ params

const core::ExecParams* sofa::core::behavior::BaseVectorOperations::params
protected

◆ result

SReal sofa::core::behavior::BaseVectorOperations::result
protected

Constructor details

◆ BaseVectorOperations()

sofa::core::behavior::BaseVectorOperations::BaseVectorOperations ( const core::ExecParams params,
core::objectmodel::BaseContext ctx 
)
inline

◆ ~BaseVectorOperations()

virtual sofa::core::behavior::BaseVectorOperations::~BaseVectorOperations ( )
inlinevirtual

Function details

◆ finish()

virtual SReal sofa::core::behavior::BaseVectorOperations::finish ( )
pure virtual

◆ print()

virtual void sofa::core::behavior::BaseVectorOperations::print ( core::ConstMultiVecId  v,
std::ostream &  out,
std::string  prefix = "",
std::string  suffix = "" 
)
pure virtual

◆ v_alloc() [1/2]

virtual void sofa::core::behavior::BaseVectorOperations::v_alloc ( sofa::core::MultiVecCoordId id,
const VecIdProperties properties = {} 
)
pure virtual

Allocate a temporary vector.

Implemented in sofa::simulation::common::VectorOperations.

◆ v_alloc() [2/2]

virtual void sofa::core::behavior::BaseVectorOperations::v_alloc ( sofa::core::MultiVecDerivId id,
const VecIdProperties properties = {} 
)
pure virtual

◆ v_clear()

virtual void sofa::core::behavior::BaseVectorOperations::v_clear ( core::MultiVecId  v)
pure virtual

◆ v_dot()

virtual void sofa::core::behavior::BaseVectorOperations::v_dot ( core::ConstMultiVecId  a,
core::ConstMultiVecId  b 
)
pure virtual

a dot b ( get result using finish )

Implemented in sofa::simulation::common::VectorOperations.

◆ v_eq() [1/2]

virtual void sofa::core::behavior::BaseVectorOperations::v_eq ( core::MultiVecId  v,
core::ConstMultiVecId  a 
)
pure virtual

◆ v_eq() [2/2]

virtual void sofa::core::behavior::BaseVectorOperations::v_eq ( core::MultiVecId  v,
core::ConstMultiVecId  a,
SReal  f 
)
pure virtual

◆ v_free() [1/2]

virtual void sofa::core::behavior::BaseVectorOperations::v_free ( sofa::core::MultiVecCoordId id,
bool  interactionForceField = false,
bool  propagate = false 
)
pure virtual

Free a previously allocated temporary vector.

Implemented in sofa::simulation::common::VectorOperations.

◆ v_free() [2/2]

virtual void sofa::core::behavior::BaseVectorOperations::v_free ( sofa::core::MultiVecDerivId id,
bool  interactionForceField = false,
bool  propagate = false 
)
pure virtual

◆ v_multiop()

virtual void sofa::core::behavior::BaseVectorOperations::v_multiop ( const core::behavior::BaseMechanicalState::VMultiOp o)
pure virtual

◆ v_norm()

virtual void sofa::core::behavior::BaseVectorOperations::v_norm ( core::ConstMultiVecId  a,
unsigned  l 
)
pure virtual

Compute the norm of a vector ( get result using finish ). The type of norm is set by parameter l. Use 0 for the infinite norm. Note that the 2-norm is more efficiently computed using the square root of the dot product.

Implemented in sofa::simulation::common::VectorOperations.

◆ v_op()

virtual void sofa::core::behavior::BaseVectorOperations::v_op ( core::MultiVecId  v,
core::ConstMultiVecId  a,
core::ConstMultiVecId  b,
SReal  f = 1.0 
)
pure virtual

◆ v_peq()

virtual void sofa::core::behavior::BaseVectorOperations::v_peq ( core::MultiVecId  v,
core::ConstMultiVecId  a,
SReal  f = 1.0 
)
pure virtual

◆ v_realloc() [1/2]

virtual void sofa::core::behavior::BaseVectorOperations::v_realloc ( sofa::core::MultiVecCoordId id,
bool  interactionForceField = false,
bool  propagate = false,
const VecIdProperties properties = {} 
)
pure virtual

keep already allocated vectors and allocates others. If interactionForceField, also allocates mechanical states linked by an InteractionForceField

Implemented in sofa::simulation::common::VectorOperations.

◆ v_realloc() [2/2]

virtual void sofa::core::behavior::BaseVectorOperations::v_realloc ( sofa::core::MultiVecDerivId id,
bool  interactionForceField = false,
bool  propagate = false,
const VecIdProperties properties = {} 
)
pure virtual

◆ v_size()

virtual size_t sofa::core::behavior::BaseVectorOperations::v_size ( core::MultiVecId  v)
pure virtual

◆ v_teq()

virtual void sofa::core::behavior::BaseVectorOperations::v_teq ( core::MultiVecId  v,
SReal  f 
)
pure virtual

◆ v_threshold()

virtual void sofa::core::behavior::BaseVectorOperations::v_threshold ( core::MultiVecId  a,
SReal  threshold 
)
pure virtual

nullify the values below the given threshold

Implemented in sofa::simulation::common::VectorOperations.