Go to the documentation of this file.00001 #ifndef VIENNAGRID_DETAIL_ELEMENT_ORIENTATION_HPP
00002 #define VIENNAGRID_DETAIL_ELEMENT_ORIENTATION_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <vector>
00023 #include <iostream>
00024
00025 #include "viennagrid/forwards.h"
00026
00031 namespace viennagrid
00032 {
00033
00034
00035
00036
00043 template <long num_vertices>
00044 class element_orientation
00045 {
00046 public:
00047 void setDefaultOrientation()
00048 {
00049 for (dim_type i=0; i<static_cast<dim_type>(num_vertices); ++i)
00050 permutator_[i] = static_cast<unsigned char>(i);
00051 };
00052
00053 dim_type operator()(dim_type in) const { return static_cast<dim_type>(permutator_[in]); }
00054
00055 void setPermutation(dim_type index, dim_type mappedTo) { permutator_[index] = static_cast<unsigned char>(mappedTo); };
00056
00057 void print() const
00058 {
00059 for (dim_type i=0; i<static_cast<dim_type>(num_vertices); ++i)
00060 {
00061 std::cout << i << "->" << permutator_[i] << ",";
00062 }
00063 std::cout << std::endl;
00064 }
00065
00066 private:
00067 unsigned char permutator_[num_vertices];
00068 };
00069
00070 }
00071
00072
00073 #endif
00074