/usr/include/libmesh/serial_mesh.h is in libmesh-dev 0.7.1-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | // $Id: serial_mesh.h 4279 2011-03-21 17:01:31Z roystgnr $
// The libMesh Finite Element Library.
// Copyright (C) 2002-2008 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef __serial_mesh_h__
#define __serial_mesh_h__
// C++ Includes -----------------------------------
// Local Includes -----------------------------------
#include "unstructured_mesh.h"
namespace libMesh
{
/**
* The \p SerialMesh class is derived from the \p MeshBase class,
* and currently represents the default Mesh implementation.
* Most methods for this class are found in MeshBase, and most
* implementation details are found in UnstructuredMesh.
*/
// ------------------------------------------------------------
// Mesh class definition
class SerialMesh : public UnstructuredMesh
{
public:
/**
* Constructor. Takes \p dim, the dimension of the mesh.
* The mesh dimension can be changed (and may automatically be
* changed by mesh generation/loading) later.
*/
SerialMesh (unsigned int dim=1);
/**
* Copy-constructor. This should be able to take a
* serial or parallel mesh.
*/
SerialMesh (const UnstructuredMesh& other_mesh);
/**
* Copy-constructor, possibly specialized for a
* serial mesh.
*/
SerialMesh (const SerialMesh& other_mesh);
/**
* Virtual copy-constructor, creates a copy of this mesh
*/
virtual AutoPtr<MeshBase> clone () const
{ return AutoPtr<MeshBase>(new SerialMesh(*this)); }
/**
* Destructor.
*/
virtual ~SerialMesh();
/**
* Clear all internal data.
*/
virtual void clear();
/**
* Remove NULL elements from arrays
*/
virtual void renumber_nodes_and_elements ();
virtual unsigned int n_nodes () const { return _nodes.size(); }
virtual unsigned int max_node_id () const { return _nodes.size(); }
virtual void reserve_nodes (const unsigned int nn) { _nodes.reserve (nn); }
virtual unsigned int n_elem () const { return _elements.size(); }
virtual unsigned int n_active_elem () const;
virtual unsigned int max_elem_id () const { return _elements.size(); }
virtual void reserve_elem (const unsigned int ne) { _elements.reserve (ne); }
// SerialMesh has no caches to update
virtual void update_parallel_id_counts () {}
/**
* For meshes that don't store points/elems, these functions may be an issue!
*/
virtual const Point& point (const unsigned int i) const ;
virtual const Node& node (const unsigned int i) const ;
virtual Node& node (const unsigned int i) ;
virtual const Node* node_ptr (const unsigned int i) const ;
virtual Node* & node_ptr (const unsigned int i) ;
virtual Elem* elem (const unsigned int i) const ;
/**
* functions for adding /deleting nodes elements.
*/
virtual Node* add_point (const Point& p,
const unsigned int id =
DofObject::invalid_id,
const unsigned int proc_id =
DofObject::invalid_processor_id);
virtual Node* add_node (Node* n) ;
virtual void delete_node (Node* n) ;
virtual void renumber_node (unsigned int old_id, unsigned int new_id);
virtual Elem* add_elem (Elem* e) ;
virtual Elem* insert_elem (Elem* e) ;
virtual void delete_elem (Elem* e) ;
virtual void renumber_elem (unsigned int old_id, unsigned int new_id);
/**
* There is no reason for a user to ever call this function.
*
* This function restores a previously broken element/node numbering such that
* \p mesh.node(n)->id() == n.
*/
virtual void fix_broken_node_and_element_numbering ();
public:
/**
* Elem iterator accessor functions.
*/
element_iterator elements_begin ();
element_iterator elements_end ();
element_iterator active_elements_begin ();
element_iterator active_elements_end ();
element_iterator ancestor_elements_begin ();
element_iterator ancestor_elements_end ();
element_iterator subactive_elements_begin ();
element_iterator subactive_elements_end ();
element_iterator not_active_elements_begin ();
element_iterator not_active_elements_end ();
element_iterator not_ancestor_elements_begin ();
element_iterator not_ancestor_elements_end ();
element_iterator not_subactive_elements_begin ();
element_iterator not_subactive_elements_end ();
element_iterator local_elements_begin ();
element_iterator local_elements_end ();
element_iterator not_local_elements_begin ();
element_iterator not_local_elements_end ();
element_iterator active_local_elements_begin ();
element_iterator active_local_elements_end ();
element_iterator active_not_local_elements_begin ();
element_iterator active_not_local_elements_end ();
element_iterator level_elements_begin (const unsigned int level);
element_iterator level_elements_end (const unsigned int level);
element_iterator not_level_elements_begin (const unsigned int level);
element_iterator not_level_elements_end (const unsigned int level);
element_iterator local_level_elements_begin (const unsigned int level);
element_iterator local_level_elements_end (const unsigned int level);
element_iterator local_not_level_elements_begin (const unsigned int level);
element_iterator local_not_level_elements_end (const unsigned int level);
element_iterator pid_elements_begin (const unsigned int proc_id);
element_iterator pid_elements_end (const unsigned int proc_id);
element_iterator type_elements_begin (const ElemType type);
element_iterator type_elements_end (const ElemType type);
element_iterator active_type_elements_begin (const ElemType type);
element_iterator active_type_elements_end (const ElemType type);
element_iterator active_pid_elements_begin (const unsigned int proc_id);
element_iterator active_pid_elements_end (const unsigned int proc_id);
element_iterator unpartitioned_elements_begin ();
element_iterator unpartitioned_elements_end ();
element_iterator active_local_subdomain_elements_begin (const unsigned int subdomain_id);
element_iterator active_local_subdomain_elements_end (const unsigned int subdomain_id);
/**
* const Elem iterator accessor functions.
*/
const_element_iterator elements_begin() const;
const_element_iterator elements_end() const;
const_element_iterator active_elements_begin() const;
const_element_iterator active_elements_end() const;
const_element_iterator ancestor_elements_begin() const;
const_element_iterator ancestor_elements_end() const;
const_element_iterator subactive_elements_begin() const;
const_element_iterator subactive_elements_end() const;
const_element_iterator not_active_elements_begin() const;
const_element_iterator not_active_elements_end() const;
const_element_iterator not_ancestor_elements_begin() const;
const_element_iterator not_ancestor_elements_end() const;
const_element_iterator not_subactive_elements_begin() const;
const_element_iterator not_subactive_elements_end() const;
const_element_iterator local_elements_begin () const;
const_element_iterator local_elements_end () const;
const_element_iterator not_local_elements_begin () const;
const_element_iterator not_local_elements_end () const;
const_element_iterator active_local_elements_begin () const;
const_element_iterator active_local_elements_end () const;
const_element_iterator active_not_local_elements_begin () const;
const_element_iterator active_not_local_elements_end () const;
const_element_iterator level_elements_begin (const unsigned int level) const;
const_element_iterator level_elements_end (const unsigned int level) const;
const_element_iterator not_level_elements_begin (const unsigned int level) const;
const_element_iterator not_level_elements_end (const unsigned int level) const;
const_element_iterator local_level_elements_begin (const unsigned int level) const;
const_element_iterator local_level_elements_end (const unsigned int level) const;
const_element_iterator local_not_level_elements_begin (const unsigned int level) const;
const_element_iterator local_not_level_elements_end (const unsigned int level) const;
const_element_iterator pid_elements_begin (const unsigned int proc_id) const;
const_element_iterator pid_elements_end (const unsigned int proc_id) const;
const_element_iterator type_elements_begin (const ElemType type) const;
const_element_iterator type_elements_end (const ElemType type) const;
const_element_iterator active_type_elements_begin (const ElemType type) const;
const_element_iterator active_type_elements_end (const ElemType type) const;
const_element_iterator active_pid_elements_begin (const unsigned int proc_id) const;
const_element_iterator active_pid_elements_end (const unsigned int proc_id) const;
const_element_iterator unpartitioned_elements_begin () const;
const_element_iterator unpartitioned_elements_end () const;
const_element_iterator active_local_subdomain_elements_begin (const unsigned int subdomain_id) const;
const_element_iterator active_local_subdomain_elements_end (const unsigned int subdomain_id) const;
/**
* non-const Node iterator accessor functions.
*/
node_iterator nodes_begin();
node_iterator nodes_end();
node_iterator active_nodes_begin();
node_iterator active_nodes_end();
node_iterator local_nodes_begin ();
node_iterator local_nodes_end ();
node_iterator pid_nodes_begin (const unsigned int proc_id);
node_iterator pid_nodes_end (const unsigned int proc_id);
/**
* const Node iterator accessor functions.
*/
const_node_iterator nodes_begin() const;
const_node_iterator nodes_end() const;
const_node_iterator active_nodes_begin() const;
const_node_iterator active_nodes_end() const;
const_node_iterator local_nodes_begin () const;
const_node_iterator local_nodes_end () const;
const_node_iterator pid_nodes_begin (const unsigned int proc_id) const;
const_node_iterator pid_nodes_end (const unsigned int proc_id) const;
protected:
/**
* The verices (spatial coordinates) of the mesh.
*/
std::vector<Node*> _nodes;
/**
* The elements in the mesh.
*/
std::vector<Elem*> _elements;
private:
/**
* Typedefs for the container implementation. In this case,
* it's just a std::vector<Elem*>.
*/
typedef std::vector<Elem*>::iterator elem_iterator_imp;
typedef std::vector<Elem*>::const_iterator const_elem_iterator_imp;
/**
* Typedefs for the container implementation. In this case,
* it's just a std::vector<Node*>.
*/
typedef std::vector<Node*>::iterator node_iterator_imp;
typedef std::vector<Node*>::const_iterator const_node_iterator_imp;
};
} // namespace libMesh
#endif
|