ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkFEMSolverHyperbolic.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef itkFEMSolverHyperbolic_h
20 #define itkFEMSolverHyperbolic_h
21 
22 #include "itkFEMSolver.h"
23 
24 namespace itk {
25 namespace fem {
26 
35 template <unsigned int TDimension = 3>
36 class ITK_TEMPLATE_EXPORT SolverHyperbolic : public Solver<TDimension>
37 {
38 public:
43 
45  itkNewMacro(Self);
46 
49 
50  typedef Element::Float Float;
51 
53  itkSetMacro(Gamma, Float);
54  itkGetMacro(Gamma, Float);
56 
58  itkSetMacro(Beta, Float);
59  itkGetMacro(Beta, Float);
61 
63  itkSetMacro(NumberOfIterations, unsigned int);
64  itkGetMacro(NumberOfIterations, unsigned int);
66 
68  virtual Float GetTimeStep(void) const ITK_OVERRIDE
69  {
70  return this->m_TimeStep;
71  }
72 
78  virtual void SetTimeStep(Float dt) ITK_OVERRIDE
79  {
80  this->m_TimeStep = dt;
81  }
82 
83 protected:
85  virtual ~SolverHyperbolic() ITK_OVERRIDE {}
86  void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
87 
89  virtual void InitializeLinearSystemWrapper(void) ITK_OVERRIDE;
90 
95  virtual void AssembleElementMatrix(Element::Pointer e) ITK_OVERRIDE;
96 
98  virtual void InitializeMatrixForAssembly(unsigned int N) ITK_OVERRIDE;
99 
104  virtual void FinalizeMatrixAfterAssembly( void ) ITK_OVERRIDE;
105 
106 
108  void GenerateData() ITK_OVERRIDE;
109 
112  virtual void RunSolver(void) ITK_OVERRIDE;
113 
115  void Solve();
116 
118  enum { matrix_K=1, matrix_M=2, matrix_C=3, matrix_tmp=4 };
119 
121  enum { solution_d=0, solution_v=1, solution_a=2};
122  enum { vector_dhat=2, vector_vhat=3, vector_ahat=4, vector_tmp=5 };
123 
127  unsigned int m_NumberOfIterations;
128 
129 private:
130  ITK_DISALLOW_COPY_AND_ASSIGN(SolverHyperbolic);
131 };
132 
133 } // end namespace fem
134 } // end namespace itk
135 
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "itkFEMSolverHyperbolic.hxx"
138 #endif
139 
140 
141 #endif // #ifndef itkFEMSolverHyperbolic_h
Light weight base class for most itk classes.
SmartPointer< const Self > ConstPointer
FEM solver used to generate a solution for a FE formulation.
Definition: itkFEMSolver.h:73
Abstract base element class.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual Float GetTimeStep(void) const override
Solver class suitable for hyperbolic problems.M*ddu + C*du + K*u=F.
virtual void SetTimeStep(Float dt) override
static ITK_CONSTEXPR_VAR double e
The base of the natural logarithm or Euler&#39;s number
Definition: itkMath.h:56
virtual ~SolverHyperbolic() override