shards  Version of the Day
 All Classes Functions Variables Typedefs Enumerations Enumerator Groups
Shards_CellTopologyManagedData.hpp
1 /*
2 //@HEADER
3 // ************************************************************************
4 //
5 // Shards : Shared Discretization Tools
6 // Copyright 2008, 2011 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Carter Edwards (hcedwar@sandia.gov),
39 // Pavel Bochev (pbboche@sandia.gov), or
40 // Denis Ridzal (dridzal@sandia.gov).
41 //
42 // ************************************************************************
43 //@HEADER
44 */
45 
46 //#define HAVE_SHARDS_DEBUG
47 
48 #include <stdexcept>
49 #include <sstream>
50 #include <Shards_CellTopology.hpp>
51 #include <Shards_BasicTopologies.hpp>
52 #include <iostream>
53 
54 namespace shards {
55 
56 typedef CellTopologyData_Subcell Subcell ;
57 
58 class CellTopologyManagedData : public CellTopologyData
59 {
60 public:
62  CellTopologyManagedData( const std::string & name );
63 
65  CellTopologyManagedData( const std::string & name , const unsigned nodeCount );
66 
68  CellTopologyManagedData(
69  const std::string & name,
70  const unsigned vertexCount,
71  const unsigned nodeCount,
72  const std::vector< const CellTopologyData * > & edges ,
73  const std::vector< unsigned > & edge_node_map ,
74  const CellTopologyData * base );
75 
77  CellTopologyManagedData(
78  const std::string & name,
79  const unsigned vertexCount,
80  const unsigned nodeCount,
81  const std::vector< const CellTopologyData * > & edges ,
82  const std::vector< unsigned > & edge_node_map ,
83  const std::vector< const CellTopologyData * > & faces ,
84  const std::vector< unsigned > & face_node_map ,
85  const CellTopologyData * base );
86 
87 private:
88  CellTopologyManagedData();
89  CellTopologyManagedData( const CellTopologyManagedData & );
90  CellTopologyManagedData & operator = ( const CellTopologyManagedData & );
91 
92 private:
93  const std::string m_name ;
94  std::vector< Subcell > m_subcell ;
95  std::vector< unsigned > m_node_map ;
96 };
97 
98 CellTopologyManagedData *
99 createCellTopology(
100  const std::string & name );
101 
102 CellTopologyManagedData *
103 createCellTopology(
104  const std::string & name,
105  const unsigned node_count );
106 
107 CellTopologyManagedData *
108 createCellTopology(
109  const std::string & name,
110  const unsigned vertex_count ,
111  const unsigned node_count,
112  const std::vector< const CellTopologyData * > & edges ,
113  const std::vector< unsigned > & edge_node_map ,
114  const CellTopologyData * base );
115 
116 CellTopologyManagedData *
117 createCellTopology( const std::string & name,
118  const unsigned vertex_count,
119  const unsigned node_count,
120  const std::vector< const CellTopologyData * > & edges ,
121  const std::vector< unsigned > & edge_node_map ,
122  const std::vector< const CellTopologyData * > & faces ,
123  const std::vector< unsigned > & face_node_map ,
124  const CellTopologyData * base);
125 
126 
127 } // namespace shards
A simple &#39;C&#39; struct of cell topology attributes.