SOFA API  014b24ea
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) override
 Allocate a temporary vector. More...
 
void v_alloc (sofa::core::MultiVecDerivId &v) 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) 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) 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

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

Result of latest v_dot operation.

Constructor details

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

Function details

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

Allocate a temporary vector.

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

void sofa::simulation::common::VectorOperations::v_alloc ( sofa::core::MultiVecDerivId v)
overridevirtual
void sofa::simulation::common::VectorOperations::v_clear ( core::MultiVecId  v)
overridevirtual
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.

void sofa::simulation::common::VectorOperations::v_eq ( core::MultiVecId  v,
core::ConstMultiVecId  a 
)
overridevirtual
void sofa::simulation::common::VectorOperations::v_eq ( core::MultiVecId  v,
core::ConstMultiVecId  a,
SReal  f 
)
overridevirtual
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.

void sofa::simulation::common::VectorOperations::v_free ( sofa::core::MultiVecDerivId id,
bool  interactionForceField = false,
bool  propagate = false 
)
overridevirtual
void sofa::simulation::common::VectorOperations::v_multiop ( const core::behavior::BaseMechanicalState::VMultiOp o)
overridevirtual
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.

void sofa::simulation::common::VectorOperations::v_op ( core::MultiVecId  v,
core::ConstMultiVecId  a,
core::ConstMultiVecId  b,
SReal  f = 1.0 
)
overridevirtual
void sofa::simulation::common::VectorOperations::v_peq ( core::MultiVecId  v,
core::ConstMultiVecId  a,
SReal  f = 1.0 
)
overridevirtual
void sofa::simulation::common::VectorOperations::v_realloc ( sofa::core::MultiVecCoordId id,
bool  interactionForceField = false,
bool  propagate = false 
)
overridevirtual

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

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

void sofa::simulation::common::VectorOperations::v_realloc ( sofa::core::MultiVecDerivId id,
bool  interactionForceField = false,
bool  propagate = false 
)
overridevirtual
size_t sofa::simulation::common::VectorOperations::v_size ( core::MultiVecId  v)
overridevirtual
void sofa::simulation::common::VectorOperations::v_teq ( core::MultiVecId  v,
SReal  f 
)
overridevirtual
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.