Go to the documentation of this file.00001 #ifndef VIENNAFEM_BOUNDARY_HPP
00002 #define VIENNAFEM_BOUNDARY_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00038 viennadata::access<BoundaryKey, bool >(BoundaryKey(id))(v) = true;
00039
00040
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
00052 viennadata::access<BoundaryKey, bool >(BoundaryKey(id))(v) = true;
00053
00054
00055 viennadata::access<BoundaryKey, std::vector<NumericT> >(BoundaryKey(id))(v) = value;
00056 }
00057
00058 }
00059 #endif