Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/MeshSet.hpp
Go to the documentation of this file.
1 /* *****************************************************************
2  MESQUITE -- The Mesh Quality Improvement Toolkit
3 
4  Copyright 2004 Sandia Corporation and Argonne National
5  Laboratory. Under the terms of Contract DE-AC04-94AL85000
6  with Sandia Corporation, the U.S. Government retains certain
7  rights in this software.
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  (lgpl.txt) along with this library; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 
23  diachin2@llnl.gov, djmelan@sandia.gov, mbrewer@sandia.gov,
24  pknupp@sandia.gov, tleurent@mcs.anl.gov, tmunson@mcs.anl.gov
25 
26  ***************************************************************** */
37 #ifndef Mesquite_MeshSet_hpp
38 #define Mesquite_MeshSet_hpp
39 
40 #ifdef MSQ_USE_OLD_C_HEADERS
41 # include <stddef.h>
42 #else
43 # include <cstddef>
44 #endif
45 
46 #ifdef MSQ_USE_OLD_STD_HEADERS
47 #include <list.h>
48 #else
49 #include <list>
50 #endif
51 
52 #include "Mesquite.hpp"
53 #include "PatchDataUser.hpp"
54 
55 namespace Mesquite
56 {
57  class MsqError;
58  class Mesh;
59  class MeshDomain;
60 
69  class MeshSet
70  {
71  public:
72 
73  MeshSet();
74  ~MeshSet();
75 
77 
79  void add_mesh(Mesquite::Mesh* mesh, MsqError &err);
80 
81 
84  void set_domain_constraint(MeshDomain* domain, MsqError &err);
85 
89  { return mDomain; }
90 
92  void get_meshes(msq_std::list<Mesquite::Mesh*> &mesh_list) const
93  { mesh_list = meshSet; }
94 
97  // We want to rename this to geometric_dimension() const
98  int space_dim() const
99  { return spaceDim; }
100 
102 
108  PatchDataUser* pd_user,
109  MsqError &err)
110  {
111  return get_next_patch(pd, pd_user->get_all_parameters(), err);
112  }
113 
119  bool get_next_patch(PatchData &pd,
120  PatchDataParameters &pd_params,
121  MsqError &err);
122 
125  void reset(MsqError &err);
126 
129  void update_mesh(const PatchData &pd, MsqError &err);
130 
136  {
137  cullFlag=f_m;
138  }
139 
141 
142  void write_vtk(const char* out_filebase, MsqError &err);
143 
144  void write_gnuplot(const char* out_filebase, MsqError &err);
145 
147  { return meshSet.empty() ? 0 : *currentMesh; }
148 
149  private:
150 
153 
155  msq_std::list<Mesquite::Mesh*> meshSet;
158  msq_std::list<Mesquite::Mesh*>::iterator currentMesh;
162  int spaceDim;
163 
169 
172  msq_stdc::size_t *csrOffsets;
173  //msq_stdc::size_t *csrData;
174  //Mesh::VertexHandle *vertArray;
175  //Mesh::ElementHandle *elemArray;
178  msq_stdc::size_t csrOffsetsSize;
179  //msq_stdc::size_t csrDataSize;
180  msq_stdc::size_t vertArraySize;
181  msq_stdc::size_t elemArraySize;
182 
183  // This is the domain we snap everything back to.
185 
186  //Flag to tell the MeshSet which MSQ culling flag to use
187  // to determine whether to build a local patch around a vertex
189 
190  };
191 
192  // -********** AOMD tmp TEST **********
193  void test_aomd(void);
194 
195 } //namespace
196 
197 #endif
Iterates through a set of entities. An EntityIterator is typically obtained via Mesh::vertex_iterator...
msq_stdc::size_t elemArraySize
int space_dim() const
Returns the number of coordinates in the Mesh&#39;s geometric coordinate system.
Mesquite::MeshDomain * get_domain_constraint()
Returns the domain associated with the MeshSet from which the Patch originates.
Used to hold the error state and return it to the application.
EntityTopology
Definition: Mesquite.hpp:92
PatchDataParameters & get_all_parameters()
Returns the PatchDataParameters object.
void set_domain_constraint(MeshDomain *domain, MsqError &err)
Sets the geometrical domain for the MeshSet.
msq_stdc::size_t vertArraySize
Mesquite::VertexIterator * vertexIterator
Keeps track of where we are in the current mesh&#39;s vertex list.
void test_aomd(void)
bool get_next_global_patch(PatchData &, PatchDataParameters &, MsqError &)
Class Mesh is the main class that holds all information to describe the current state of the mesh...
Definition: Mesh.hpp:19
This should be the parent class of all algorithms retrieving information from a MeshSet object...
bool get_next_elem_on_vert_patch(PatchData &, PatchDataParameters &, MsqError &)
void write_vtk(const char *out_filebase, MsqError &err)
msq_stdc::size_t csrOffsetsSize
void update_mesh(const PatchData &pd, MsqError &err)
Updates the coordinates in the underlying mesh with the coordinates stored in PatchData.
msq_std::list< Mesquite::Mesh * >::iterator currentMesh
Keeps track of which Mesh* we&#39;re currently working with in get_next_patch().
int spaceDim
The number of coordinates in this mesh (2D or 3D)
msq_stdc::size_t * csrOffsets
These are arrays that we cache so we don&#39;t have to reallocate at every patch.
Mesquite::MeshDomain * mDomain
Mesquite::EntityTopology * elemTopologies
A Mesquite::Mesh is a collection of mesh elements which are composed of mesh vertices. Intermediate objects are not accessible through this interface (where intermediate objects include things like the faces of a hex, or an element&#39;s edges).
void write_gnuplot(const char *out_filebase, MsqError &err)
void set_flag_to_cull(MsqVertex::FlagMask f_m)
Sets the cullFlag.
msq_std::list< Mesquite::Mesh * > meshSet
Meshes in this MeshSet.
bool clear_all_soft_fixed_flags(MsqError &err)
Mesquite::MsqVertex::FlagMask cullFlag
void get_meshes(msq_std::list< Mesquite::Mesh * > &mesh_list) const
returns the list of mesh pointers previously added.
Mesquite::EntityTopology elementType
The topological dimension of the elements in this MeshSet, where Mesquite::TRIANGLE indicates 2D elem...
void add_mesh(Mesquite::Mesh *mesh, MsqError &err)
adds a mesh to the MeshSet.
The MeshSet class stores one or more Mesquite::Mesh pointers and manages access to the mesh informati...
void reset(MsqError &err)
Resets the MeshSet object so that get_next_patch() will restart its iterations at the first vertex...
bool get_next_patch(PatchData &pd, PatchDataUser *pd_user, MsqError &err)
Gets the next PatchData.