ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkFEMLoadBCMFC.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 #ifndef itkFEMLoadBCMFC_h
19 #define itkFEMLoadBCMFC_h
20 
21 #include "itkFEMLoadBase.h"
22 #include "ITKFEMExport.h"
23 
24 namespace itk
25 {
26 namespace fem
27 {
52 
53 // forward declaratons...
54 // class Solver;
55 
56 class ITKFEM_EXPORT LoadBCMFC : public Load
57 {
58 public:
60  typedef LoadBCMFC Self;
61  typedef Load Superclass;
64 
66  itkSimpleNewMacro(Self);
67 
69  itkTypeMacro(LoadBCMFC, Load);
70 
73  virtual::itk::LightObject::Pointer CreateAnother(void) const ITK_OVERRIDE;
74 
81  class MFCTerm
82  {
83  public:
84 
89 
93  unsigned int dof;
94 
99 
103  MFCTerm(Element::ConstPointer element_, int dof_,
104  Element::Float value_) : m_element(element_), dof(dof_), value(value_)
105  {
106  }
107  };
108 
112  typedef std::vector<MFCTerm> LhsType;
113 
115  LoadBCMFC() : m_Index(0), m_LeftHandSide(), m_RightHandSide() {}
116 
126  LoadBCMFC(Element::ConstPointer element, int dof, vnl_vector<Element::Float> val);
127 
130  void SetIndex(int ind);
131 
134  int GetIndex();
135 
137  void AddLeftHandSideTerm(LoadBCMFC::MFCTerm term);
138 
141  void AddRightHandSideTerm(Element::Float term);
142 
144  int GetNumberOfLeftHandSideTerms() const;
145 
147  int GetNumberOfRightHandSideTerms() const;
148 
150  const MFCTerm GetLeftHandSideTerm(int lhs) const;
151 
153  Element::Float GetRightHandSideTerm(int rhs) const;
154 
157  const std::vector<MFCTerm> & GetLeftHandSideArray() const;
158  std::vector<MFCTerm> & GetLeftHandSideArray();
160 
163  vnl_vector<Element::Float> & GetRightHandSideArray();
164 
165 // friend class Solver;
166 
167 protected:
168  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
169 
170  // private: // FIXME: CrankNicolsonSolver class, which is derived from Solver
171  // class also needs access to Index.
173  int m_Index;
174 
176 
183  vnl_vector<Element::Float> m_RightHandSide;
184 };
185 
186 }
187 } // end namespace itk::fem
188 
189 #endif // #ifndef itkFEMLoadBCMFC_h
Light weight base class for most itk classes.
SmartPointer< Self > Pointer
vnl_vector< Element::Float > m_RightHandSide
Class that holds information about one term in MFC constraint equation.
Generic linear multi freedom displacement constraint in global coordinate system. ...
std::vector< MFCTerm > LhsType
SmartPointer< const Self > ConstPointer
MFCTerm(Element::ConstPointer element_, int dof_, Element::Float value_)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
General abstract load base class.
Element::ConstPointer m_element