Orfeo Toolbox  3.16
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
itk::fem::LoadBCMFC Class Reference

Generic linear multi freedom displacement constraint in global coordinate system. More...

#include <itkFEMLoadBCMFC.h>

+ Inheritance diagram for itk::fem::LoadBCMFC:
+ Collaboration diagram for itk::fem::LoadBCMFC:

Classes

class  MFCTerm
 Class that holds information about one term in MFC constraint equation. More...
 

Public Types

typedef FEMPArray< SelfArrayType
 
typedef Self Baseclass
 
typedef const SelfConstPointer
 
typedef std::vector< MFCTermLhsType
 
typedef SelfPointer
 
typedef LoadBCMFC Self
 
typedef Load Superclass
 

Public Member Functions

 LoadBCMFC ()
 
 LoadBCMFC (Element::ConstPointer element, int dof, vnl_vector< Element::Float > val)
 
virtual int ClassID () const
 
virtual Baseclass::Pointer Clone () const
 
virtual Solution::ConstPointer GetSolution ()
 
virtual void Read (std::istream &f, void *info)
 
virtual void SetSolution (Solution::ConstPointer)
 
virtual void Write (std::ostream &f) const
 

Static Public Member Functions

static FEMLightObject::Pointer CreateFromStream (std::istream &f, void *info)
 
static Self::Pointer New ()
 
static void SkipWhiteSpace (std::istream &f)
 

Public Attributes

int GN
 
int Index
 
LhsType lhs
 
vnl_vector< Element::Floatrhs
 

Static Public Attributes

static const int CLID
 
static const std::string whitespaces =" \t\n\r"
 

Friends

class Solver
 

Detailed Description

Generic linear multi freedom displacement constraint in global coordinate system.

These constraints are implemented using the Lagrange multiplier method. We treat displacement constraints (or essential boundary conditions, which are exactly the same but with less functionality) as a special kind of load on the system.

How to store data in a LoadBCMFC object... Suppose you want to impose the following constraint to the system:

0.5*u1x + 2.1*u5y = 10.0

u1x is the first DOF in the element with global number 1, and u5y is the second DOF in an element with GN=5.

... then use the following lines of code itk::LoadBCMFC m; m.lhs.push_back( LoadBCMFC::MFCTerm( elements.Find(1), 0, 0.5 ) ); m.lhs.push_back( LoadBCMFC::MFCTerm( elements.Find(5), 1, 2.1 ) ); m.rhs=10.0;

Definition at line 51 of file itkFEMLoadBCMFC.h.

Member Typedef Documentation

Array class that holds special pointers to the load objects

Definition at line 42 of file itkFEMLoadBase.h.

Store the base class typedef for easy access from derived classes. FEM_CLASS macro also expects this for the FEMOF...

Definition at line 62 of file itkFEMLightObject.h.

Const pointer or SmartPointer to an object.

Definition at line 53 of file itkFEMLoadBCMFC.h.

typedef std::vector<MFCTerm> itk::fem::LoadBCMFC::LhsType

Left hand side of the MFC constraint equation

Definition at line 89 of file itkFEMLoadBCMFC.h.

Pointer or SmartPointer to an object.

Definition at line 53 of file itkFEMLoadBCMFC.h.

Standard Self typedef.

Definition at line 53 of file itkFEMLoadBCMFC.h.

Standard Superclass typedef.

Definition at line 53 of file itkFEMLoadBCMFC.h.

Constructor & Destructor Documentation

itk::fem::LoadBCMFC::LoadBCMFC ( )
inline

Default constructor

Definition at line 101 of file itkFEMLoadBCMFC.h.

itk::fem::LoadBCMFC::LoadBCMFC ( Element::ConstPointer  element,
int  dof,
vnl_vector< Element::Float val 
)

With this constructor, we can easy fix the global displacement dof given by node to a value val.

Parameters
elementPointer to an element, which holds a displacements that needs to be fixed.
dofLocal DOF number in an element.
valThe fixed value of a DOF.

Fix a DOF to a prescribed value

Set the correct weight

Definition at line 31 of file itkFEMLoadBCMFC.cxx.

References lhs, and rhs.

Member Function Documentation

virtual int itk::fem::LoadBCMFC::ClassID ( ) const
inlinevirtual

Virtual function to access the class ID

Implements itk::fem::FEMLightObject.

Definition at line 53 of file itkFEMLoadBCMFC.h.

virtual Baseclass::Pointer itk::fem::LoadBCMFC::Clone ( ) const
virtual

Create a new object from the existing one

Implements itk::fem::FEMLightObject.

FEMLightObject::Pointer itk::fem::FEMLightObject::CreateFromStream ( std::istream &  f,
void *  info 
)
staticinherited

Read object of any derived type from stream.

This static function creates an object of a class, which is derived from FEMLightObject. The class of object is first determined from the stream, then the object of that class is constructed using the FEMObjectFactory. Finally the data for this object is read from the stream, by calling the Read() member function.

Read and create object of any derived class from stream

Catch possible exceptions while reading object's data from stream

Return a pointer to a newly created object if all was OK Technically everithing should be fine here (a!=0), but we check again, just in case.

Something went wrong. Reset the stream position to where it was before reading the object.

Definition at line 77 of file itkFEMLightObject.cxx.

References itk::fem::FEMObjectFactory< FEMLightObject >::ClassName2ID(), itk::fem::FEMObjectFactory< FEMLightObject >::Create(), itk::fem::FEMLightObject::Read(), itk::fem::FEMLightObject::SkipWhiteSpace(), and itk::fem::FEMLightObject::whitespaces.

Referenced by itk::fem::Solver::Read().

virtual Solution::ConstPointer itk::fem::Load::GetSolution ( )
inlinevirtualinherited
static Self::Pointer itk::fem::LoadBCMFC::New ( void  )
inlinestatic

Object creation in an itk compatible way

Definition at line 53 of file itkFEMLoadBCMFC.h.

void itk::fem::LoadBCMFC::Read ( std::istream &  f,
void *  info 
)
virtual

read a LoadBCMFC object from input stream.

Read the LoadBCMFC object from input stream

Convert the info pointer to a usable objects

first call the parent's Read function

read number of terms in lhs of MFC equation

read and set pointer to element that we're applying the load to

read the number of dof within that element

read weight

add a new MFCTerm to the lhs

read the rhs

Reimplemented from itk::fem::FEMLightObject.

Definition at line 41 of file itkFEMLoadBCMFC.cxx.

References itk::fem::FEMPArray< T >::Find(), lhs, itk::fem::FEMExceptionObjectNotFound::m_baseClassName, itk::fem::FEMExceptionObjectNotFound::m_GN, itk::fem::FEMLightObject::Read(), rhs, and itk::fem::FEMLightObject::SkipWhiteSpace().

virtual void itk::fem::Load::SetSolution ( Solution::ConstPointer  )
inlinevirtualinherited

Sets the pointer to solution vector. This function is automatically called by the Solver class on every load object.

Some types of external Loads may need access to previous values of solution vector. If a derived class needs that, it should implement this function, and store the passed pointer accordingly. If the result vector is not required, the functionn should be left unimplemented, so that only the dummy implementation in base class is called.

Parameters
ptrPointer to the object of Solution class.

Reimplemented in itk::fem::FiniteDifferenceFunctionLoad< TMoving, TFixed >, itk::fem::ImageMetricLoad< TMoving, TFixed >, and itk::fem::LoadLandmark.

Definition at line 56 of file itkFEMLoadBase.h.

void itk::fem::FEMLightObject::SkipWhiteSpace ( std::istream &  f)
staticinherited
void itk::fem::LoadBCMFC::Write ( std::ostream &  f) const
virtual

write a LoadBCMFC object to the output stream.

Write the LoadBCMFC object to the output stream

first call the parent's write function

Write the actual Load data

write the number of DOFs affected by this MFC

write each term

write the rhs

check for errors

Reimplemented from itk::fem::FEMLightObject.

Definition at line 100 of file itkFEMLoadBCMFC.cxx.

References lhs, rhs, and itk::fem::FEMLightObject::Write().

Friends And Related Function Documentation

friend class Solver
friend

Definition at line 123 of file itkFEMLoadBCMFC.h.

Member Data Documentation

const int itk::fem::LoadBCMFC::CLID
static

Class ID for FEM object factory

Definition at line 53 of file itkFEMLoadBCMFC.h.

int itk::fem::FEMLightObject::GN
inherited

Global number of an object (ID of an object) In general the ID's are required to be unique only within a specific type of derived classes (Elements, Nodes, ...) If the GN is not required, it can be ignored. (normally you need the GN when writing or reading objects to/from stream.

Definition at line 163 of file itkFEMLightObject.h.

Referenced by itk::fem::FEMLightObject::FEMLightObject(), itk::fem::Generate2DRectilinearMesh(), itk::fem::Generate3DRectilinearMesh(), itk::fem::FEMLightObject::Read(), itk::fem::LoadNode::Write(), itk::fem::LoadBC::Write(), and itk::fem::FEMLightObject::Write().

int itk::fem::LoadBCMFC::Index

used internally by the Solver class

Definition at line 122 of file itkFEMLoadBCMFC.h.

LhsType itk::fem::LoadBCMFC::lhs

Definition at line 90 of file itkFEMLoadBCMFC.h.

Referenced by LoadBCMFC(), Read(), and Write().

vnl_vector<Element::Float> itk::fem::LoadBCMFC::rhs

Right hand side of the linear equation that defines the constraints. It is a vector so that implementation of BC on isotropic elements is easy. Which value is applied to the master force vector is defined by optional dim parameter (defaults to 0) in AssembleF function in solver.

Definition at line 98 of file itkFEMLoadBCMFC.h.

Referenced by LoadBCMFC(), Read(), and Write().

const std::string itk::fem::FEMLightObject::whitespaces =" \t\n\r"
staticinherited

Const string of all whitespace characters. This string is used by SkipWhiteSpace function.

Definition at line 133 of file itkFEMLightObject.h.

Referenced by itk::fem::FEMLightObject::CreateFromStream(), and itk::fem::MaterialLinearElasticity::Read().


The documentation for this class was generated from the following files:

Generated at Sun May 12 2013 03:03:04 for Orfeo Toolbox with doxygen 1.8.3.1