ViennaGrid - The Vienna Grid Library
2.1.0
|
00001 #ifndef VIENNAGRID_SEGMENTED_MESH_HPP 00002 #define VIENNAGRID_SEGMENTED_MESH_HPP 00003 00004 /* ======================================================================= 00005 Copyright (c) 2011-2014, Institute for Microelectronics, 00006 Institute for Analysis and Scientific Computing, 00007 TU Wien. 00008 00009 ----------------- 00010 ViennaGrid - The Vienna Grid Library 00011 ----------------- 00012 00013 License: MIT (X11), see file LICENSE in the base directory 00014 ======================================================================= */ 00015 00016 #include "viennagrid/mesh/mesh.hpp" 00017 #include "viennagrid/mesh/segmentation.hpp" 00018 #include "viennagrid/mesh/mesh_operations.hpp" 00019 00024 namespace viennagrid 00025 { 00031 template<typename MeshT, typename SegmentationT> 00032 struct segmented_mesh 00033 { 00034 typedef MeshT mesh_type; 00035 typedef SegmentationT segmentation_type; 00036 00037 mesh_type mesh; 00038 segmentation_type segmentation; 00039 }; 00040 00041 00043 template<typename WrappedMeshConfig, typename WrappedSegmentationConfig> 00044 struct segmented_mesh< viennagrid::mesh<WrappedMeshConfig>, viennagrid::segmentation<WrappedSegmentationConfig> > 00045 { 00046 typedef segmented_mesh< viennagrid::mesh<WrappedMeshConfig>, viennagrid::segmentation<WrappedSegmentationConfig> > SelfType; 00047 00048 typedef viennagrid::mesh<WrappedMeshConfig> mesh_type; 00049 typedef viennagrid::segmentation<WrappedSegmentationConfig> segmentation_type; 00050 00051 segmented_mesh() : segmentation(mesh) {} 00052 00053 segmented_mesh(SelfType const & other) : segmentation(mesh) 00054 { 00055 *this = other; 00056 } 00057 00058 00059 SelfType & operator=(SelfType const & other) 00060 { 00061 copy( other.mesh, other.segmentation, mesh, segmentation, true_functor() ); 00062 return *this; 00063 } 00064 00065 void clear() 00066 { 00067 mesh.clear(); 00068 segmentation.clear(); 00069 } 00070 00071 00072 mesh_type mesh; 00073 segmentation_type segmentation; 00074 00075 private: 00076 }; 00077 00078 } 00079 00080 #endif