Refactoring itk::FEM framework - V4: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
Line 36: Line 36:


==itk::Load==
==itk::Load==
===itk::fem::LightObject===
Move the member variables GN from public to protected. Public methods will be added
to get/set the global number variable.
void SetGlobalNumber(int) – Set the global number for the FEM
object. The default value is -1.
int GetGlobalNumber() – Get the global number for the FEM
object.
===itk::fem::LoadBC===
Move the member variables m_dof, m_element, m_value, and CLID from public to
protected. The following membership functions will be added, allowing the user to get
and set these variables:
void SetDegreesOfFreedom(unsigned int dof) – Set the degrees
of freedom for the local element for which the boundary
condition is being applied.
void SetElement(Element::ConstPointer element) – Set the
element for which the boundary condition is being applied.
void SetValue(vnl_vector< Element::Float > value) – Set the
boundary condition using a vector representation. This can
be used to restrict motion of an element in a particular
direction.
unsigned int GetDegreesOfFreedom() – Returns the local degrees
of freedom for the element on which the boundary condition
is being applied.
Element::ConstPointer GetElement() – Returns the element on
which the boundary condition is being applied.
vnl_vector< Element::Float > GetValue() – Returns the assigned
boundary condition.
===itk::fem::LoadBCMFC===
8
Move the member variables Index, lhs, and rhs from public to protected. Add the
following class methods to get and set the class variables.
void SetIndex(int) – Set the index variable for the multi
freedom displacement constraint. This is used internally by
the itk::Fem::Solver.
void AddLeftHandSideTerm(LoadBCMFC::MFCTerm) – Add terms to
the right hand side of the multi freedom displacement
constraint. Used to replace loadBCMFC.lhs.push_back().
void AddRightHandSideTerm(vnl_vector< Element::Float >) – Set
the right hand side of the linear equation that defines the
constraints. Replaces loadBCMFC.rhs = a;
int GetIndex – Get the index variable for the multi freedom
displacement constraint.
int GetNumberOfLeftHandSideTerms() – Returns the number of
terms used to define the left hand side of the multi
freedom displacement constraint.
itk::LoadBFMC GetLeftHandSideTerm(int index) – Returns the
specified left hand side term.
int GetNumberOfRightHandSideTerms()– Returns the number of
terms used to define the left hand side of the multi
freedom displacement constraint.
Element::Float GetRightHandSideTerm(int index) – Returns the
specified right hand side term.
===itk::fem::LoadEdge===
Move the member variables m_Edge and m_Force from public to protected and provide
public interface to define these values.
void SetEdge(int) – Set the edge to apply the desired force.
void SetForce(vnl_matrix< Float >) – Set the force to be
applied to an edge.
int GetEdge() – Get the edge for the applied force.
vnl_matrix< Float > GetForce() – Get the force applied.
===itk::fem::LoadGravConst===
Move the member variable Fg_value from public to protected and provide public
interface to this value.
void SetForce(vnl_vector< Float >) – Set the constant force
vector that exists for every point in space.
vnl_vector< Float > GetForce() – Return the constant force
vector that exists for every point in space.
===itk::fem::LoadLandmark===
Move the member variables eta, m_force, m_pt, m_Solution, m_Source, and
m_Target from public to protected. Public interfaces already exist to define all of these
values except eta, for which new methods will be added.
void SetEta(double) – Set the square root of the variance.
double GetEta(double) – Get the square root of the variance.
===itk::fem::LoadNode===
Move the member variables F, m_element, and m_pt from public to protected. Provide
a public interface to get/set these variables.
void SetForce(vnl_vector< Float >) – Set the applied force to
the node.
void SetElement(Element::ConstPointer) – Set the element in
the system that contains the degrees of freedom on which
the force is applied.
void SetNode(unsigned int) – Set the point on which the force
is being applied.
vnl_vector< Float > &GetForce() – Get the applied force.
Element::ConstPointer GetElement() – Get the element in the
system that contains the degrees of freedom on which the
force is applied.
Unsigned int GetNode() – Get the point on which the force is
being applied.
===itk::fem::LoadPoint===
Move the member variables Fp and point from public to protected. Provide a public
interface to get/set these variables. Complete the implementation of this class since it
has not yet been implemented.
void SetForce(vnl_vector<Float>) – Set the force to be applied
to the specified point location.
void SetPoint(vnl_vector<Float>) – Set the point where the
force is applied in global coordinates.
vnl_vector<Float> & GetForce(vnl_vector<Float>) – Get the
applied force.
vnl_vector<Float> & GetPoint (vnl_vector<Float>) – Get the
point where the force is applied.

Revision as of 17:05, 4 July 2010

This page outlines the proposed changes to the itk::FEM framework. Feed back on these changes should be sent to Vincent Magnotta (vincent-magnotta - at- uiowa.edu). A number of these changes will break backwards compatibility.

Encapsulate class variables in FEM Framework

itk::Solver

  1. Move the following class variables from public to protected:
    • node
    • el
    • load
    • mat
  2. Add the following member functions:
    • bool AddNextElement(ElementType *element) – Add the next element to the mesh data structure. This will be used to replace the solver->el.push_back()
    • bool InsertElement(ElementType *element, unsigned long index) – Insert the element to the position within the mesh data structure.
    • bool AddNextNode(NodeType *node) – Add the next node to the mesh data structure. This will be used to replace the solver->node.push_back()
    • bool InsertNode(NodeType *node, unsigned long index) – Insert the node into the desired location within the mesh data structure.
    • bool AddNextMaterial(itk::fem::FEMP<itk::fem::Material>) – Add the next material type to the solver.
    • bool InsertMaterial(itk::fem::FEMP<itk::fem::Material>, int) – Insert the material property to the specified index in the solver material property array.
    • bool AddNextLoad(itk::fem::FEMP<itk::fem::Load>) – Add the next load to the solver.
    • bool InsertLoad(itk::fem::FEMP<itk::fem::Load>, int) – Insert the load to the specified index in the solver load array.
    • bool GetElement(unsigned long index, ElementType *element) – Get the specified element from the mesh data structure
    • bool GetNode(unsigned long index, NodeType *node) – Get the specified node from the mesh data structure
    • bool GetMaterial(itk::fem::FEMP<itk::fem::Material>, int) – Get the specified material from the solver.
    • bool GetLoad(itk::fem::FEMP<itk::fem::Load>, int) – Get the specified load from the solver.
    • unsigned int GetNumberOfNodes() – Returns the number of nodes stored in the solver.
    • unsigned int GetNumberOfElements()– Returns the number of element stored in the solver.
    • unsigned int GetNumberOfMaterials()– Returns the number of materials stored in the solver.
    • unsigned int GetNumberOfLoads() – Returns the number of loads stored in the solver
    • bool ClearMaterialArray() – Insert the load to the specified index in the solver load array.
    • bool ClearloadArray() – Insert the load to the specified index in the solver load array.
    • bool RemoveMaterial(int) – Remove the material property at the specified index from the solver Material array.
    • bool RemoveLoad(int) – Remove the load at the specified index from the solver load array.
    • void SetMesh(itk::Mesh) – Specify the entire mesh to be used by the solver.
    • itk::Mesh GetMesh() – Returns the mesh used by the solver.
    • MeshType::Pointer GetDeformedMesh() – Returns the resulting mesh after applying the loading and boundary conditions on the mesh.
    • itk::Array<double>::Pointer GetMeshStresses() – Returns the stresses for the mesh with each element of the array corresponding to an element in the mesh.
    • itk::Array<double>::Pointer GetMeshStrains()– Returns the strains for the mesh with each element of the array corresponding to an element in the mesh.

itk::Load

itk::fem::LightObject

Move the member variables GN from public to protected. Public methods will be added to get/set the global number variable. void SetGlobalNumber(int) – Set the global number for the FEM object. The default value is -1. int GetGlobalNumber() – Get the global number for the FEM object.

itk::fem::LoadBC

Move the member variables m_dof, m_element, m_value, and CLID from public to protected. The following membership functions will be added, allowing the user to get and set these variables: void SetDegreesOfFreedom(unsigned int dof) – Set the degrees of freedom for the local element for which the boundary condition is being applied. void SetElement(Element::ConstPointer element) – Set the element for which the boundary condition is being applied. void SetValue(vnl_vector< Element::Float > value) – Set the boundary condition using a vector representation. This can be used to restrict motion of an element in a particular direction. unsigned int GetDegreesOfFreedom() – Returns the local degrees of freedom for the element on which the boundary condition is being applied. Element::ConstPointer GetElement() – Returns the element on which the boundary condition is being applied. vnl_vector< Element::Float > GetValue() – Returns the assigned boundary condition.

itk::fem::LoadBCMFC

8 Move the member variables Index, lhs, and rhs from public to protected. Add the following class methods to get and set the class variables. void SetIndex(int) – Set the index variable for the multi freedom displacement constraint. This is used internally by the itk::Fem::Solver. void AddLeftHandSideTerm(LoadBCMFC::MFCTerm) – Add terms to the right hand side of the multi freedom displacement constraint. Used to replace loadBCMFC.lhs.push_back(). void AddRightHandSideTerm(vnl_vector< Element::Float >) – Set the right hand side of the linear equation that defines the constraints. Replaces loadBCMFC.rhs = a; int GetIndex – Get the index variable for the multi freedom displacement constraint. int GetNumberOfLeftHandSideTerms() – Returns the number of terms used to define the left hand side of the multi freedom displacement constraint. itk::LoadBFMC GetLeftHandSideTerm(int index) – Returns the specified left hand side term. int GetNumberOfRightHandSideTerms()– Returns the number of terms used to define the left hand side of the multi freedom displacement constraint. Element::Float GetRightHandSideTerm(int index) – Returns the specified right hand side term.

itk::fem::LoadEdge

Move the member variables m_Edge and m_Force from public to protected and provide public interface to define these values. void SetEdge(int) – Set the edge to apply the desired force. void SetForce(vnl_matrix< Float >) – Set the force to be applied to an edge. int GetEdge() – Get the edge for the applied force. vnl_matrix< Float > GetForce() – Get the force applied.

itk::fem::LoadGravConst

Move the member variable Fg_value from public to protected and provide public interface to this value. void SetForce(vnl_vector< Float >) – Set the constant force vector that exists for every point in space. vnl_vector< Float > GetForce() – Return the constant force vector that exists for every point in space.

itk::fem::LoadLandmark

Move the member variables eta, m_force, m_pt, m_Solution, m_Source, and m_Target from public to protected. Public interfaces already exist to define all of these values except eta, for which new methods will be added. void SetEta(double) – Set the square root of the variance. double GetEta(double) – Get the square root of the variance.

itk::fem::LoadNode

Move the member variables F, m_element, and m_pt from public to protected. Provide a public interface to get/set these variables. void SetForce(vnl_vector< Float >) – Set the applied force to the node. void SetElement(Element::ConstPointer) – Set the element in the system that contains the degrees of freedom on which the force is applied. void SetNode(unsigned int) – Set the point on which the force is being applied. vnl_vector< Float > &GetForce() – Get the applied force. Element::ConstPointer GetElement() – Get the element in the system that contains the degrees of freedom on which the force is applied. Unsigned int GetNode() – Get the point on which the force is being applied.

itk::fem::LoadPoint

Move the member variables Fp and point from public to protected. Provide a public interface to get/set these variables. Complete the implementation of this class since it has not yet been implemented. void SetForce(vnl_vector<Float>) – Set the force to be applied to the specified point location. void SetPoint(vnl_vector<Float>) – Set the point where the force is applied in global coordinates. vnl_vector<Float> & GetForce(vnl_vector<Float>) – Get the applied force. vnl_vector<Float> & GetPoint (vnl_vector<Float>) – Get the point where the force is applied.