Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
ReadUtil.hpp
Go to the documentation of this file.
1 /**
2  * MOAB, a Mesh-Oriented datABase, is a software component for creating,
3  * storing and accessing finite element mesh data.
4  *
5  * Copyright 2004 Sandia Corporation. Under the terms of Contract
6  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
7  * retains certain 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  */
15 
16 #ifndef MB_READ_UTIL_HPP
17 #define MB_READ_UTIL_HPP
18 
19 #ifndef IS_BUILDING_MB
20 #error "ReadUtil.hpp isn't supposed to be included into an application"
21 #endif
22 
23 #include "moab/ReadUtilIface.hpp"
24 
25 namespace moab
26 {
27 
28 class Core;
29 class Error;
30 
31 class ReadUtil : public ReadUtilIface
32 {
33  private:
34  //! Pointer to the Core
36 
37  public:
38  //! Constructor takes Core pointer
39  ReadUtil( Core* mdb, Error* error_handler );
40 
41  //! Destructor
42  ~ReadUtil() {}
43 
44  //! Get arrays for coordinate data from the MB
45  ErrorCode get_node_coords( const int num_arrays,
46  const int num_nodes,
47  const int preferred_start_id,
48  EntityHandle& actual_start_handle,
49  std::vector< double* >& arrays,
50  int sequence_size = -1 );
51 
52  //! Get array for connectivity data from the MB
53  ErrorCode get_element_connect( const int num_elements,
54  const int verts_per_element,
55  const EntityType mdb_type,
56  const int preferred_start_id,
57  EntityHandle& actual_start_handle,
58  EntityHandle*& array,
59  int sequence_size = -1 );
60 
61  /**
62  *\brief Gather entities related to those in the partition
63  * Gather entities related to those in the input partition. Related
64  * means down-adjacent to, contained in, etc.
65  * \param partition Entities for which to gather related entities
66  * \param related_ents Related entities
67  * \param all_sets If non-NULL, all sets in mesh instance are returned
68  * in the pointed-to range
69  */
70  ErrorCode gather_related_ents( Range& partition, Range& related_ents, EntityHandle* file_set = NULL );
71 
73  const unsigned* set_flags,
74  EntityID preffered_start_id,
75  EntityHandle& actual_start_handle );
76 
77  //! Tell MB which elements have been added to the database
78  ErrorCode update_adjacencies( const EntityHandle start_handle,
79  const int number_elements,
80  const int number_vertices_per_element,
81  const EntityHandle* conn_array );
82 
83  //! Given an ordered list of bounding entities and the sense of
84  //! those entities, return an ordered list of vertices
86  int* sense,
87  int num_bound,
88  int dim,
89  EntityHandle* bound_verts,
90  EntityType& etype );
91 
92  ErrorCode assign_ids( Tag id_tag, const Range& ents, int start = 0 );
93 
94  ErrorCode assign_ids( Tag id_tag, const EntityHandle* ents, size_t num_ents, int start = 0 );
95 
96  //! Create a new gather set with tag GATHER_SET
98 
99  //! Get entity handle of an existing gather set
100  ErrorCode get_gather_set( EntityHandle& gather_set );
101 };
102 
103 } // namespace moab
104 
105 #endif