ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkFEMLoadBCMFC.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkFEMLoadBCMFC_h
00019 #define __itkFEMLoadBCMFC_h
00020 
00021 #include "itkFEMLoadBase.h"
00022 
00023 namespace itk
00024 {
00025 namespace fem
00026 {
00051 
00052 // forward declaratons...
00053 // class Solver;
00054 
00055 class LoadBCMFC : public Load
00056 {
00057 public:
00059   typedef LoadBCMFC                Self;
00060   typedef Load                     Superclass;
00061   typedef SmartPointer<Self>       Pointer;
00062   typedef SmartPointer<const Self> ConstPointer;
00063 
00065   itkSimpleNewMacro(Self);
00066 
00068   itkTypeMacro(LoadBCMFC, Load);
00069 
00072   virtual::itk::LightObject::Pointer CreateAnother(void) const;
00073 
00080   class MFCTerm
00081   {
00082   public:
00083 
00087     Element::ConstPointer m_element;
00088 
00092     unsigned int dof;
00093 
00097     Element::Float value;
00098 
00102     MFCTerm(Element::ConstPointer element_, int dof_,
00103             Element::Float value_) : m_element(element_), dof(dof_), value(value_)
00104     {
00105     }
00106   };
00107 
00111   typedef std::vector<MFCTerm> LhsType;
00112 
00114   LoadBCMFC() : m_Index(0), m_LeftHandSide(), m_RightHandSide()  {}
00115 
00125   LoadBCMFC(Element::ConstPointer element, int dof, vnl_vector<Element::Float> val);
00126 
00129   void SetIndex(int ind);
00130 
00133   int GetIndex();
00134 
00136   void AddLeftHandSideTerm(LoadBCMFC::MFCTerm term);
00137 
00140   void AddRightHandSideTerm(Element::Float term);
00141 
00143   int GetNumberOfLeftHandSideTerms() const;
00144 
00146   int GetNumberOfRightHandSideTerms() const;
00147 
00149   const MFCTerm GetLeftHandSideTerm(int lhs) const;
00150 
00152   Element::Float GetRightHandSideTerm(int rhs) const;
00153 
00156   const std::vector<MFCTerm> & GetLeftHandSideArray() const;
00157   std::vector<MFCTerm> & GetLeftHandSideArray();
00159 
00162   vnl_vector<Element::Float> & GetRightHandSideArray();
00163 
00164 //  friend class Solver;
00165 protected:
00166   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00167 
00168   // private:  // FIXME: CrankNicolsonSolver class, which is derived from Solver
00169   // class also needs access to Index.
00171   int m_Index;
00172 
00173   LhsType m_LeftHandSide;
00174 
00181   vnl_vector<Element::Float> m_RightHandSide;
00182 };
00183 
00184 }
00185 }  // end namespace itk::fem
00186 
00187 #endif // #ifndef __itkFEMLoadBCMFC_h
00188