Go to the documentation of this file.00001 #ifndef VIENNAFEM_TRANSFORM_INTERVAL_HPP
00002 #define VIENNAFEM_TRANSFORM_INTERVAL_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <iostream>
00018 #include <utility>
00019 #include "viennagrid/topology/triangle.hpp"
00020 #include "viennagrid/algorithm/spanned_volume.hpp"
00021 #include "viennagrid/domain.hpp"
00022 #include "viennafem/forwards.h"
00023
00028 namespace viennafem
00029 {
00030
00031 template <>
00032 struct dt_dx_handler<viennafem::unit_interval>
00033 {
00034 public:
00035
00036 template <typename CellType>
00037 static void apply(CellType const & cell)
00038 {
00039 typedef typename CellType::config_type Config;
00040 typedef typename viennagrid::result_of::point<Config>::type PointType;
00041
00042 PointType const & p0 = viennagrid::ncells<0>(cell)[0].point();
00043 PointType const & p1 = viennagrid::ncells<0>(cell)[1].point();
00044
00045
00046 numeric_type x1_x0 = p1[0] - p0[0];
00047
00048 viennadata::access<det_dF_dt_key, numeric_type>()(cell) = x1_x0;
00049 viennadata::access<dt_dx_key<0, 0>, numeric_type>()(cell) = 1.0 / x1_x0;
00050 }
00051
00052 };
00053
00054
00055 }
00056
00057 #endif