38 #include <boost/archive/binary_iarchive.hpp>
39 #include <boost/archive/binary_oarchive.hpp>
40 #include <boost/timer.hpp>
42 #include <boost/shared_ptr.hpp>
43 #include <boost/foreach.hpp>
44 #include <boost/multi_array.hpp>
45 #include <boost/multi_index_container.hpp>
46 #include <boost/multi_index/member.hpp>
47 #include <boost/multi_index/mem_fun.hpp>
48 #include <boost/multi_index/ordered_index.hpp>
49 #include <boost/numeric/ublas/io.hpp>
50 #include <boost/mpl/print.hpp>
54 #include <feel/feelcore/feel.hpp>
59 #include <feel/feelmesh/geoelement.hpp>
83 template<
typename Shape>
86 public VisitableBase<>,
88 public Elements<Shape>,
89 public Points<Shape::nRealDim>,
90 public Faces<typename Shape::template shape<1,Shape::nOrder,Shape::nRealDim>::type,
91 typename Elements<Shape>::element_type>
94 BOOST_STATIC_ASSERT( Shape::nDim == 2 );
103 static const uint16_type nDim = Shape::nRealDim;
105 typedef typename VisitableBase<>::return_type return_type;
107 typedef VisitableBase<> super_visitable;
110 typedef Elements<Shape> super_elements;
111 typedef typename super_elements::elements_type elements_type;
112 typedef typename super_elements::element_type element_type;
113 typedef typename super_elements::element_iterator element_iterator;
114 typedef typename super_elements::element_const_iterator element_const_iterator;
115 typedef typename super_elements::update_element_neighbor_type update_element_neighbor_type;
117 typedef Points<Shape::nRealDim> super_points;
118 typedef typename super_points::points_type points_type;
119 typedef typename super_points::point_type point_type;
121 typedef Faces<typename Shape::template shape<1,Shape::nOrder,Shape::nRealDim>::type,
122 typename super_elements::element_type> super_faces;
123 typedef typename super_faces::face_iterator face_iterator;
124 typedef typename super_faces::faces_type faces_type;
125 typedef typename super_faces::face_type face_type;
126 typedef face_type edge_type;
128 typedef super_faces super_edges;
129 typedef typename super_edges::marker_face_iterator marker_edge_iterator;
130 typedef typename super_edges::marker_face_const_iterator marker_edge_const_iterator;
131 typedef typename super_edges::location_face_iterator location_edge_iterator;
132 typedef typename super_edges::location_face_const_iterator location_edge_const_iterator;
135 typedef boost::shared_ptr<self_type> self_ptrtype;
137 typedef typename element_type::edge_permutation_type edge_permutation_type;
138 typedef typename element_type::face_permutation_type face_permutation_type;
158 DVLOG(2) <<
"[Mesh2D] constructor...\n";
229 return super_elements::element_type::numLocalEdges;
238 return super_elements::element_type::numLocalEdges;
246 return super_elements::element_type::numLocalVertices;
254 return this->
faces().size();
262 return this->
faces().size();
271 return this->
points().size();
287 face_iterator beginEdge() {
return this->beginFace(); }
288 face_iterator endEdge() {
return this->endFace(); }
289 faces_type edges() {
return this->
faces(); }
291 void setWorldComm( WorldComm
const& _worldComm )
293 this->setWorldCommMeshBase( _worldComm );
294 this->setWorldCommElements( _worldComm );
295 this->setWorldCommFaces( _worldComm );
296 this->setWorldCommPoints( _worldComm );
308 this->
faces().clear();
309 FEELPP_ASSERT(
isEmpty() ).error(
"all mesh containers should be empty after a clear." );
314 FEELPP_DEFINE_VISITABLE();
327 FEELPP_ASSERT( 0 ).error(
"invalid call" );
345 for (
typename super_elements::element_iterator elt = this->beginElement();
346 elt != this->endElement(); ++elt )
348 for ( uint16_type j = 0; j < element_type::numEdges; j++ )
350 if ( elt->face( j ).isConnectedTo1() &&
351 elt->face( j ).ad_second() == elt->id() )
354 detail::UpdateEdgePermutation<edge_permutation_type>( elt->face( j ).pos_second(),
355 edge_permutation_type( edge_permutation_type::REVERSE_PERMUTATION ) ) );
373 friend class boost::serialization::access;
374 template<
class Archive>
375 void serialize( Archive & ar,
const unsigned int version )
377 ar & boost::serialization::base_object<super>( *this );
378 DVLOG(2) <<
"Serializing points\n";
382 ar & boost::serialization::base_object<super_points>( *this );
386 DVLOG(2) <<
"Serializing faces\n";
387 ar & boost::serialization::base_object<super_faces>( *this );
391 DVLOG(2) <<
"Serializing elements\n";
392 ar & boost::serialization::base_object<super_elements>( *this );