• Main Page
  • Namespaces
  • Data Structures
  • Files
  • File List

/export/development/ViennaFEM/viennafem/boundary.hpp

Go to the documentation of this file.
00001 #ifndef VIENNAFEM_BOUNDARY_HPP
00002 #define VIENNAFEM_BOUNDARY_HPP
00003 
00004 /* =========================================================================
00005    Copyright (c) 2012, Institute for Microelectronics,
00006                        Institute for Analysis and Scientific Computing,
00007                        TU Wien.
00008                              -----------------
00009                ViennaFEM - The Vienna Finite Element Method Library
00010                              -----------------
00011 
00012    Author:     Karl Rupp                          rupp@iue.tuwien.ac.at
00013 
00014    License:    MIT (X11), see file LICENSE in the ViennaFEM base directory
00015 ============================================================================ */
00016 
00017 #include "viennafem/forwards.h"
00018 
00019 #include "viennamath/forwards.h"
00020 #include "viennamath/manipulation/substitute.hpp"
00021 #include "viennamath/expression.hpp"
00022 #include "viennadata/api.hpp"
00023 
00028 namespace viennafem
00029 {
00030   template <typename VertexType>
00031   void set_dirichlet_boundary(VertexType const & v,
00032                               numeric_type const & value,
00033                               std::size_t id = 0)
00034   {
00035     typedef viennafem::boundary_key      BoundaryKey;;
00036     
00037     //set flag:
00038     viennadata::access<BoundaryKey, bool >(BoundaryKey(id))(v) = true; 
00039     
00040     //set data:
00041     viennadata::access<BoundaryKey, numeric_type >(BoundaryKey(id))(v) = value; 
00042   }
00043 
00044   template <typename VertexType, typename NumericT>
00045   void set_dirichlet_boundary(VertexType const & v,
00046                               std::vector<NumericT> const & value,
00047                               std::size_t id = 0)
00048   {
00049     typedef viennafem::boundary_key      BoundaryKey;;
00050     
00051     //set flag:
00052     viennadata::access<BoundaryKey, bool >(BoundaryKey(id))(v) = true; 
00053     
00054     //set data:
00055     viennadata::access<BoundaryKey, std::vector<NumericT> >(BoundaryKey(id))(v) = value; 
00056   }
00057 
00058 }
00059 #endif

Generated on Wed Feb 29 2012 21:51:05 for ViennaFEM - The Vienna Finite Element Method Library by  doxygen 1.7.1