SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::simulation::common::VectorOperations Class Reference

#include <VectorOperations.h>

Inheritance diagram for sofa::simulation::common::VectorOperations:

Protected Attributes

VisitorExecuteFunc executeVisitor
 
SReal result
 Result of latest v_dot operation. More...
 
- Protected Attributes inherited from sofa::core::behavior::BaseVectorOperations
const core::ExecParamsparams
 
core::objectmodel::BaseContextctx
 
SReal result
 

Public Member Functions

 VectorOperations (const sofa::core::ExecParams *params, sofa::core::objectmodel::BaseContext *ctx, bool precomputedTraversalOrder=false)
 
void v_alloc (sofa::core::MultiVecCoordId &v, const core::VecIdProperties &properties={}) override
 Allocate a temporary vector. More...
 
void v_alloc (sofa::core::MultiVecDerivId &v, const core::VecIdProperties &properties={}) override
 
void v_free (sofa::core::MultiVecCoordId &id, bool interactionForceField=false, bool propagate=false) override
 Free a previously allocated temporary vector. More...
 
void v_free (sofa::core::MultiVecDerivId &id, bool interactionForceField=false, bool propagate=false) override
 
void v_realloc (sofa::core::MultiVecCoordId &id, bool interactionForceField=false, bool propagate=false, const core::VecIdProperties &properties={}) override
 keep already allocated vectors and allocates others. If interactionForceField, also allocates mechanical states linked by an InteractionForceField More...
 
void v_realloc (sofa::core::MultiVecDerivId &id, bool interactionForceField=false, bool propagate=false, const core::VecIdProperties &properties={}) override
 
void v_clear (core::MultiVecId v) override
 v=0 More...
 
void v_eq (core::MultiVecId v, core::ConstMultiVecId a) override
 v=a More...
 
void v_eq (core::MultiVecId v, core::ConstMultiVecId a, SReal f) override
 v=f*a More...
 
void v_peq (core::MultiVecId v, core::ConstMultiVecId a, SReal f=1.0) override
 v+=f*a More...
 
void v_teq (core::MultiVecId v, SReal f) override
 v*=f More...
 
void v_op (core::MultiVecId v, core::ConstMultiVecId a, core::ConstMultiVecId b, SReal f=1.0) override
 v=a+b*f More...
 
void v_multiop (const core::behavior::BaseMechanicalState::VMultiOp &o) override
 
void v_dot (core::ConstMultiVecId a, core::ConstMultiVecId b) override
 a dot b ( get result using finish ) More...
 
void v_norm (core::ConstMultiVecId a, unsigned l) override
 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...
 
void v_threshold (core::MultiVecId a, SReal threshold) override
 nullify the values below the given threshold More...
 
SReal finish () override
 
void print (sofa::core::ConstMultiVecId v, std::ostream &out, std::string prefix="", std::string suffix="") override
 
size_t v_size (core::MultiVecId v) override
 
- Public Member Functions inherited from sofa::core::behavior::BaseVectorOperations
 BaseVectorOperations (const core::ExecParams *params, core::objectmodel::BaseContext *ctx)
 
virtual ~BaseVectorOperations ()
 

Attribute details

◆ executeVisitor

VisitorExecuteFunc sofa::simulation::common::VectorOperations::executeVisitor
protected

◆ result

SReal sofa::simulation::common::VectorOperations::result
protected

Result of latest v_dot operation.

Constructor details

◆ VectorOperations()

sofa::simulation::common::VectorOperations::VectorOperations ( const sofa::core::ExecParams params,
sofa::core::objectmodel::BaseContext ctx,
bool  precomputedTraversalOrder = false 
)

Function details

◆ finish()

SReal sofa::simulation::common::VectorOperations::finish ( )
overridevirtual

◆ print()

void sofa::simulation::common::VectorOperations::print ( sofa::core::ConstMultiVecId  v,
std::ostream &  out,
std::string  prefix = "",
std::string  suffix = "" 
)
overridevirtual

◆ v_alloc() [1/2]

void sofa::simulation::common::VectorOperations::v_alloc ( sofa::core::MultiVecCoordId v,
const core::VecIdProperties properties = {} 
)
overridevirtual

Allocate a temporary vector.

Implements sofa::core::behavior::BaseVectorOperations.

◆ v_alloc() [2/2]

void sofa::simulation::common::VectorOperations::v_alloc ( sofa::core::MultiVecDerivId v,
const core::VecIdProperties properties = {} 
)
overridevirtual

◆ v_clear()

void sofa::simulation::common::VectorOperations::v_clear ( core::MultiVecId  v)
overridevirtual

◆ v_dot()

void sofa::simulation::common::VectorOperations::v_dot ( core::ConstMultiVecId  a,
core::ConstMultiVecId  b 
)
overridevirtual

a dot b ( get result using finish )

Implements sofa::core::behavior::BaseVectorOperations.

◆ v_eq() [1/2]

void sofa::simulation::common::VectorOperations::v_eq ( core::MultiVecId  v,
core::ConstMultiVecId  a 
)
overridevirtual

◆ v_eq() [2/2]

void sofa::simulation::common::VectorOperations::v_eq ( core::MultiVecId  v,
core::ConstMultiVecId  a,
SReal  f 
)
overridevirtual

◆ v_free() [1/2]

void sofa::simulation::common::VectorOperations::v_free ( sofa::core::MultiVecCoordId id,
bool  interactionForceField = false,
bool  propagate = false 
)
overridevirtual

Free a previously allocated temporary vector.

Implements sofa::core::behavior::BaseVectorOperations.

◆ v_free() [2/2]

void sofa::simulation::common::VectorOperations::v_free ( sofa::core::MultiVecDerivId id,
bool  interactionForceField = false,
bool  propagate = false 
)
overridevirtual

◆ v_multiop()

void sofa::simulation::common::VectorOperations::v_multiop ( const core::behavior::BaseMechanicalState::VMultiOp o)
overridevirtual

◆ v_norm()

void sofa::simulation::common::VectorOperations::v_norm ( core::ConstMultiVecId  a,
unsigned  l 
)
overridevirtual

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.

Implements sofa::core::behavior::BaseVectorOperations.

◆ v_op()

void sofa::simulation::common::VectorOperations::v_op ( core::MultiVecId  v,
core::ConstMultiVecId  a,
core::ConstMultiVecId  b,
SReal  f = 1.0 
)
overridevirtual

◆ v_peq()

void sofa::simulation::common::VectorOperations::v_peq ( core::MultiVecId  v,
core::ConstMultiVecId  a,
SReal  f = 1.0 
)
overridevirtual

◆ v_realloc() [1/2]

void sofa::simulation::common::VectorOperations::v_realloc ( sofa::core::MultiVecCoordId id,
bool  interactionForceField = false,
bool  propagate = false,
const core::VecIdProperties properties = {} 
)
overridevirtual

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

Implements sofa::core::behavior::BaseVectorOperations.

◆ v_realloc() [2/2]

void sofa::simulation::common::VectorOperations::v_realloc ( sofa::core::MultiVecDerivId id,
bool  interactionForceField = false,
bool  propagate = false,
const core::VecIdProperties properties = {} 
)
overridevirtual

◆ v_size()

size_t sofa::simulation::common::VectorOperations::v_size ( core::MultiVecId  v)
overridevirtual

◆ v_teq()

void sofa::simulation::common::VectorOperations::v_teq ( core::MultiVecId  v,
SReal  f 
)
overridevirtual

◆ v_threshold()

void sofa::simulation::common::VectorOperations::v_threshold ( core::MultiVecId  a,
SReal  threshold 
)
overridevirtual

nullify the values below the given threshold

Implements sofa::core::behavior::BaseVectorOperations.