Orfeo Toolbox  3.16
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
itk::fem::Load Class Reference

General abstract load base class. More...

#include <itkFEMLoadBase.h>

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

List of all members.

Public Types

typedef FEMPArray< SelfArrayType
typedef Self Baseclass
typedef const SelfConstPointer
typedef SelfPointer
typedef Load Self
typedef FEMLightObject Superclass

Public Member Functions

virtual int ClassID () const =0
virtual Baseclass::Pointer Clone () const =0
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 void SkipWhiteSpace (std::istream &f)

Public Attributes

int GN

Static Public Attributes

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

Detailed Description

General abstract load base class.

All other load classes that can be used in a FEM system are defined by deriving this one. The load class defines an external load that acts on the system. For each specific subtype of load, a separate load abstract class should be derived. For example we have LoadElement, which defines the base for all loads that act on a specific element in a system.

Definition at line 36 of file itkFEMLoadBase.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.


Member Function Documentation

virtual int itk::fem::FEMLightObject::ClassID ( ) const
pure virtualinherited
virtual Baseclass::Pointer itk::fem::FEMLightObject::Clone ( ) const
pure virtualinherited
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 ( )
inlinevirtual
void itk::fem::FEMLightObject::Read ( std::istream &  f,
void *  info 
)
virtualinherited

Read an object data from input stream. Call this member to initialize the data members in the current object by reading data from provided input stream. Derived classes should first call the the parent's read function, to initialize the data from parent. Note that you must manually create the object of desired type using the FEMObjectFactory before you can call read function (this is pretty obvious). In this class only the global number is read from file. Derived classes may require some additional info in order to perform the reading. Pack this info in an object and pass a pointer to it in the info parameter. If you need runtime typechecking, use a polymorphic class and dynamic_cast operator inside the implementation of Read.

Here we just read the global number from the stream. This should be the first function called when reading object data.

Read and set the global object number

Reimplemented in itk::fem::Element::Node, itk::fem::LoadLandmark, itk::fem::ElementStd< 3, 2 >, itk::fem::ElementStd< 2, 2 >, itk::fem::ElementStd< 8, 3 >, itk::fem::ElementStd< 6, 2 >, itk::fem::ElementStd< 4, 3 >, itk::fem::ElementStd< 4, 2 >, itk::fem::LoadBCMFC, itk::fem::LoadGravConst, itk::fem::LoadBC, itk::fem::Element2DC1Beam, itk::fem::LoadElement, itk::fem::Element1DStress< Element2DC0LinearLine >, itk::fem::Element2DMembrane< Element2DC0LinearQuadrilateral >, itk::fem::Element2DMembrane< Element2DC0LinearTriangular >, itk::fem::Element2DStrain< Element2DC0QuadraticTriangular >, itk::fem::Element2DStrain< Element2DC0LinearQuadrilateral >, itk::fem::Element2DStrain< Element2DC0LinearTriangular >, itk::fem::Element2DStress< Element2DC0QuadraticTriangular >, itk::fem::Element2DStress< Element2DC0LinearQuadrilateral >, itk::fem::Element2DStress< Element2DC0LinearTriangular >, itk::fem::Element3DMembrane< Element3DC0LinearHexahedron >, itk::fem::Element3DMembrane< Element3DC0LinearTetrahedron >, itk::fem::Element3DStrain< Element3DC0LinearHexahedron >, itk::fem::Element3DStrain< Element3DC0LinearTetrahedron >, itk::fem::LoadTest< TClass >, itk::fem::LoadNode, itk::fem::LoadEdge, and itk::fem::MaterialLinearElasticity.

Definition at line 33 of file itkFEMLightObject.cxx.

References itk::fem::FEMLightObject::GN, and itk::fem::FEMLightObject::SkipWhiteSpace().

Referenced by itk::fem::FEMLightObject::CreateFromStream(), itk::fem::MaterialLinearElasticity::Read(), itk::fem::LoadNode::Read(), itk::fem::LoadElement::Read(), itk::fem::LoadBC::Read(), itk::fem::LoadBCMFC::Read(), and itk::fem::Element::Node::Read().

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

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::FEMLightObject::Write ( std::ostream &  f) const
virtualinherited

Write an object to the output stream. Call this member to write the data members in the current object to the output stream. Here we also need to know which derived class we actually are, so that we can write the class name. The class name is obtained by calling the virtual ClassID() member function and passing the result to the FEMObjectFactory.

Implementations of Write member funtion in derived classes should first call the parent's implementation of Write and finaly write whatever they need.

Here we just write the class name and GN. This should be the first function called when writing object data, so every derived class should first call the parent's write function. The Write function in base (this one) class knows which class is being written by calling the virtual ClassID() function and can write the class name properly.

Reimplemented in itk::fem::Element::Node, itk::fem::LoadLandmark, itk::fem::ElementStd< 3, 2 >, itk::fem::ElementStd< 2, 2 >, itk::fem::ElementStd< 8, 3 >, itk::fem::ElementStd< 6, 2 >, itk::fem::ElementStd< 4, 3 >, itk::fem::ElementStd< 4, 2 >, itk::fem::LoadBCMFC, itk::fem::LoadGravConst, itk::fem::LoadBC, itk::fem::Element2DC1Beam, itk::fem::Element1DStress< Element2DC0LinearLine >, itk::fem::Element2DMembrane< Element2DC0LinearQuadrilateral >, itk::fem::Element2DMembrane< Element2DC0LinearTriangular >, itk::fem::Element2DStrain< Element2DC0QuadraticTriangular >, itk::fem::Element2DStrain< Element2DC0LinearQuadrilateral >, itk::fem::Element2DStrain< Element2DC0LinearTriangular >, itk::fem::Element2DStress< Element2DC0QuadraticTriangular >, itk::fem::Element2DStress< Element2DC0LinearQuadrilateral >, itk::fem::Element2DStress< Element2DC0LinearTriangular >, itk::fem::Element3DMembrane< Element3DC0LinearHexahedron >, itk::fem::Element3DMembrane< Element3DC0LinearTetrahedron >, itk::fem::Element3DStrain< Element3DC0LinearHexahedron >, itk::fem::Element3DStrain< Element3DC0LinearTetrahedron >, itk::fem::LoadElement, itk::fem::LoadTest< TClass >, itk::fem::LoadNode, itk::fem::LoadEdge, and itk::fem::MaterialLinearElasticity.

Definition at line 57 of file itkFEMLightObject.cxx.

References itk::fem::FEMLightObject::ClassID(), and itk::fem::FEMLightObject::GN.

Referenced by itk::fem::MaterialLinearElasticity::Write(), itk::fem::LoadNode::Write(), itk::fem::LoadElement::Write(), itk::fem::LoadBC::Write(), itk::fem::LoadBCMFC::Write(), and itk::fem::Element::Node::Write().


Member Data Documentation

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().

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 file:

Generated at Sun Feb 3 2013 02:59:09 for Orfeo Toolbox with doxygen 1.8.1.1