00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef FEM_CIO_H
00010 #define FEM_CIO_H
00011
00012 #include <ostream>
00013
00014 #include "core/cio.hpp"
00015 #include "fem/Element.hpp"
00016 #include "fem/BoundaryElement.hpp"
00017 #include "fem/Grid.hpp"
00018
00019 namespace imaging
00020 {
00021 template<size_t N_VERTICES, size_t N_NODES>
00022 std::ostream & operator<<(std::ostream & out, const Element<N_VERTICES, N_NODES> & element)
00023 {
00024 for(int i = 0; i < N_VERTICES; ++i)
00025 out << element.get_vertex(i) << " ";
00026
00027 out << "|";
00028
00029 for(int i = 0; i < N_NODES; ++i)
00030 out << " " << element.get_node(i);
00031
00032 out << " |";
00033
00034 for(int i = 0; i < N_NODES; ++i)
00035 out << " " << element.get_node_status(i);
00036
00037 out << std::endl;
00038
00039 return out;
00040 }
00041
00042
00043 std::ostream & operator<<(std::ostream & out, const BoundaryElement & element)
00044 {
00045 out << element.get_parent_element() << " | " << element.get_parent_element_face() << std::endl;
00046
00047 return out;
00048 }
00049
00050
00051 template<class fem_types>
00052 std::ostream & operator<<(std::ostream & out, const Grid<fem_types> & grid)
00053 {
00054 for(int i = 0; i < grid.get_n_vertices(); ++i)
00055 out << grid.get_vertex(i) << std::endl;
00056
00057 for(int i = 0; i < grid.n_elements(); ++i)
00058 out << grid.get_element(i);
00059
00060 for(int i = 0; i < grid.n_boundary_elements(); ++i)
00061 out << grid.get_boundary_element(i);
00062
00063 return out;
00064 }
00065
00066 }
00067
00068
00069 #endif