ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkFEMSolverHyperbolic.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-01-30 21:53:03 $ 00007 Version: $Revision: 1.4 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef __itkFEMSolverHyperbolic_h 00019 #define __itkFEMSolverHyperbolic_h 00020 00021 #include "itkFEMSolver.h" 00022 00023 namespace itk { 00024 namespace fem { 00025 00034 template <unsigned int TDimension = 3> 00035 class SolverHyperbolic : public Solver<TDimension> 00036 { 00037 public: 00038 typedef SolverHyperbolic Self; 00039 typedef Solver<TDimension> Superclass; 00040 typedef SmartPointer<Self> Pointer; 00041 typedef SmartPointer<const Self> ConstPointer; 00042 00044 itkNewMacro(Self); 00045 00047 itkTypeMacro(SolverHyperbolic, Solver<TDimension> ); 00048 00049 typedef Element::Float Float; 00050 00052 itkSetMacro(Gamma, Float); 00053 itkGetMacro(Gamma, Float); 00055 00057 itkSetMacro(Beta, Float); 00058 itkGetMacro(Beta, Float); 00060 00062 itkSetMacro(NumberOfIterations, unsigned int); 00063 itkGetMacro(NumberOfIterations, unsigned int); 00065 00067 virtual Float GetTimeStep(void) const 00068 { 00069 return this->m_TimeStep; 00070 } 00071 00077 virtual void SetTimeStep(Float dt) 00078 { 00079 this->m_TimeStep = dt; 00080 } 00081 00082 protected: 00083 SolverHyperbolic(); 00084 virtual ~SolverHyperbolic() { } 00085 void PrintSelf(std::ostream& os, Indent indent) const; 00086 00090 virtual void InitializeLinearSystemWrapper(void); 00091 00096 virtual void AssembleElementMatrix(Element::Pointer e); 00097 00101 virtual void InitializeMatrixForAssembly(unsigned int N); 00102 00107 virtual void FinalizeMatrixAfterAssembly( void ); 00108 00109 00111 void GenerateData(); 00112 00116 virtual void RunSolver(void); 00117 00121 void Solve(); 00122 00126 enum { matrix_K=1, matrix_M=2, matrix_C=3, matrix_tmp=4 }; 00127 00131 enum { solution_d=0, solution_v=1, solution_a=2}; 00132 enum { vector_dhat=2, vector_vhat=3, vector_ahat=4, vector_tmp=5 }; 00133 00134 Float m_TimeStep; 00135 Float m_Gamma; 00136 Float m_Beta; 00137 unsigned int m_NumberOfIterations; 00138 00139 private: 00140 SolverHyperbolic(const Self &); // purposely not implemented 00141 void operator=(const Self &); // purposely not implemented 00142 }; 00143 00144 } // end namespace fem 00145 } // end namespace itk 00146 00147 #ifndef ITK_MANUAL_INSTANTIATION 00148 #include "itkFEMSolverHyperbolic.hxx" 00149 #endif 00150 00151 00152 #endif // #ifndef __itkFEMSolverHyperbolic_h 00153