Orfeo Toolbox
3.16
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
OTB
Utilities
ITK
Code
Numerics
FEM
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
25
#include "
itkFEMLinearSystemWrapper.h
"
26
#include "
itkFEMLinearSystemWrapperVNL.h
"
27
28
#include "
itkImage.h
"
29
30
namespace
itk {
31
namespace
fem {
32
41
class
Solver
42
{
43
public
:
44
48
typedef
Element::Float
Float
;
49
54
typedef
Element::ArrayType
ElementArray
;
55
ElementArray
el
;
56
60
typedef
Node::ArrayType
NodeArray
;
61
NodeArray
node
;
62
66
typedef
Load::ArrayType
LoadArray
;
67
LoadArray
load
;
68
72
typedef
Material::ArrayType
MaterialArray
;
73
MaterialArray
mat
;
74
78
typedef
Element::VectorType
VectorType
;
79
90
itkStaticConstMacro(
MaxGridDimensions
,
unsigned
int
, 3);
91
95
typedef
itk::Image<Element::ConstPointer,MaxGridDimensions>
InterpolationGridType
;
96
111
void
InitializeInterpolationGrid
(
const
VectorType
& size,
const
VectorType
& bb1,
const
VectorType
& bb2);
112
116
void
InitializeInterpolationGrid
(
const
VectorType
& size)
117
{
118
InitializeInterpolationGrid
(size,
VectorType
(size.size(),0.0), size-1.0);
119
}
120
131
const
InterpolationGridType
*
GetInterpolationGrid
(
void
)
const
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
290
void
SetLinearSystemWrapper
(
LinearSystemWrapper::Pointer
ls);
291
297
LinearSystemWrapper::Pointer
GetLinearSystemWrapper
() {
return
m_ls
; }
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
331
LinearSystemWrapper::Pointer
m_ls
;
332
333
private
:
334
338
LinearSystemWrapperVNL
m_lsVNL
;
339
345
InterpolationGridType::Pointer
m_InterpolationGrid
;
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