Orfeo Toolbox  3.16
itkFEMSolver.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkFEMSolver.h,v $
5  Language: C++
6  Date: $Date: 2009-01-30 21:53:03 $
7  Version: $Revision: 1.28 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __itkFEMSolver_h
19 #define __itkFEMSolver_h
20 
21 #include "itkFEMElementBase.h"
22 #include "itkFEMMaterialBase.h"
23 #include "itkFEMLoadBase.h"
24 
27 
28 #include "itkImage.h"
29 
30 namespace itk {
31 namespace fem {
32 
41 class Solver
42 {
43 public:
44 
49 
56 
62 
68 
74 
79 
90  itkStaticConstMacro(MaxGridDimensions, unsigned int, 3);
91 
96 
111  void InitializeInterpolationGrid(const VectorType& size, const VectorType& bb1, const VectorType& bb2);
112 
117  {
118  InitializeInterpolationGrid(size, VectorType(size.size(),0.0), size-1.0);
119  }
120 
132  { return m_InterpolationGrid.GetPointer(); }
133 
142  const Element * GetElementAtPoint(const VectorType& pt) const;
143 
147  void Read( std::istream& f );
148 
152  void Write( std::ostream& f );
153 
157  virtual void Clear( void );
158 
159 
168  void GenerateGFN( void );
169 
173  void AssembleK( void );
174 
181  virtual void InitializeMatrixForAssembly(unsigned int N);
182 
188  virtual void FinalizeMatrixAfterAssembly( void )
189  {
190  // Apply the boundary conditions to the K matrix
191  this->ApplyBC();
192  }
193 
200  virtual void AssembleElementMatrix(Element::Pointer e);
201 
209  virtual void AssembleLandmarkContribution(Element::Pointer e, float);
210 
224  void ApplyBC(int dim=0, unsigned int matrix=0);
225 
233  void AssembleF(int dim=0);
234 
238  void DecomposeK( void );
239 
243  virtual void Solve( void );
244 
249  void UpdateDisplacements( void );
250 
251  Float GetSolution(unsigned int i,unsigned int which=0)
252  {
253  return m_ls->GetSolutionValue(i,which);
254  }
255 
256  unsigned int GetNumberOfDegreesOfFreedom( void )
257  {
258  return NGFN;
259  }
260 
262  Float GetDeformationEnergy(unsigned int SolutionIndex=0);
263 
264 public:
269  Solver();
270 
274  virtual ~Solver() {}
275 
291 
298 
303  virtual void InitializeLinearSystemWrapper(void);
304 
308  virtual Float GetTimeStep( void ) const { return 0.0; }
309 
315  virtual void SetTimeStep(Float) {}
316 
317 protected:
318 
322  unsigned int NGFN;
323 
328  unsigned int NMFC;
329 
332 
333 private:
334 
339 
346 
347 };
348 
349 }} // end namespace itk::fem
350 
351 #endif // #ifndef __itkFEMSolver_h

Generated at Sat May 18 2013 23:38:21 for Orfeo Toolbox with doxygen 1.8.3.1