SimpleAssembler.hpp

00001 // This file is part of the imaging2 class library.
00002 //
00003 // University of Innsbruck, Infmath Imaging, 2009.
00004 // http://infmath.uibk.ac.at
00005 //
00006 // All rights reserved.
00007 
00008 
00009 #ifndef FEM_SIMPLEASSEMBLER_H
00010 #define FEM_SIMPLEASSEMBLER_H
00011 
00012 #include <fem/Grid.hpp>
00013 #include <fem/FemKernel.hpp>
00014 #include <fem/Assembler.hpp>
00015 #include <fem/equation/SimpleEquationAdaptor.hpp>
00016 
00017 
00018 
00019 
00020 namespace imaging
00021 {
00028   class SimpleAssembler
00029   {
00030     Assembler _assembler;
00031     
00032   public:
00033 
00042     template<class fem_types, class simple_equation_t>
00043     void assemble(const simple_equation_t & simple_equation, const Grid<fem_types> & grid,
00044                   ublas::compressed_matrix<float_t> & stiffness_matrix,
00045                   ublas::vector<float_t> & force_vector) const;
00046     
00055     template<class fem_types, class simple_equation_t>
00056     void assemble_stiffness_matrix(const simple_equation_t & simple_equation, const Grid<fem_types> & grid,
00057                   ublas::compressed_matrix<float_t> & stiffness_matrix) const;
00058                   
00067     template<class fem_types, class simple_equation_t>
00068     void assemble_force_vector(const simple_equation_t & simple_equation, const Grid<fem_types> & grid,
00069                   ublas::vector<float_t> & force_vector) const;
00070 
00071   }
00072   ;
00073 
00074   template<class fem_types, class simple_equation_t>
00075   void SimpleAssembler::assemble(const simple_equation_t & simple_equation, const Grid<fem_types> & grid,
00076                                        ublas::compressed_matrix<float_t> & stiffness_matrix,
00077                                        ublas::vector<float_t> & force_vector) const
00078   {
00079     SimpleEquationAdaptor<simple_equation_t> adaptor(simple_equation);
00080     _assembler.assemble(adaptor, grid, stiffness_matrix, force_vector);
00081   }
00082 
00083   template<class fem_types, class simple_equation_t>
00084   void SimpleAssembler::assemble_stiffness_matrix(const simple_equation_t & simple_equation,
00085                                       const Grid<fem_types> & grid,
00086                                       ublas::compressed_matrix<float_t> & stiffness_matrix) const
00087   {
00088     SimpleEquationAdaptor<simple_equation_t> adaptor(simple_equation);
00089     _assembler.assemble_stiffness_matrix(adaptor, grid, stiffness_matrix);
00090   }
00091 
00092   template<class fem_types, class simple_equation_t>
00093   void SimpleAssembler::assemble_force_vector(const simple_equation_t & simple_equation,
00094                                       const Grid<fem_types> & grid,
00095                                       ublas::vector<float_t> & force_vector) const
00096   {
00097     SimpleEquationAdaptor<simple_equation_t> adaptor(simple_equation);
00098     _assembler.assemble_force_vector(adaptor, grid, force_vector);
00099   }
00100 }
00101 
00102 
00103 #endif

Generated on Tue Feb 10 10:01:30 2009 for imaging2 by  doxygen 1.5.5