DataTransferKit - Multiphysics Solution Transfer Services  2.0
DTK_STKMeshEntityImpl.hpp
1 //---------------------------------------------------------------------------//
2 /*
3  Copyright (c) 2012, Stuart R. Slattery
4  All rights reserved.
5 
6  Redistribution and use in source and binary forms, with or without
7  modification, are permitted provided that the following conditions are
8  met:
9 
10  *: Redistributions of source code must retain the above copyright
11  notice, this list of conditions and the following disclaimer.
12 
13  *: Redistributions in binary form must reproduce the above copyright
14  notice, this list of conditions and the following disclaimer in the
15  documentation and/or other materials provided with the distribution.
16 
17  *: Neither the name of the University of Wisconsin - Madison nor the
18  names of its contributors may be used to endorse or promote products
19  derived from this software without specific prior written permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33 //---------------------------------------------------------------------------//
39 //---------------------------------------------------------------------------//
40 
41 #ifndef DTK_STKMESHENTITYIMPL_HPP
42 #define DTK_STKMESHENTITYIMPL_HPP
43 
44 #include "DTK_EntityImpl.hpp"
45 #include "DTK_STKMeshEntityExtraData.hpp"
46 #include "DTK_Types.hpp"
47 
48 #include <Teuchos_ArrayView.hpp>
49 #include <Teuchos_ParameterList.hpp>
50 
51 #include <stk_mesh/base/BulkData.hpp>
52 #include <stk_mesh/base/Entity.hpp>
53 
54 namespace DataTransferKit
55 {
56 //---------------------------------------------------------------------------//
61 //---------------------------------------------------------------------------//
63 {
64  public:
68  STKMeshEntityImpl( const stk::mesh::Entity &stk_entity,
69  const Teuchos::Ptr<stk::mesh::BulkData> &bulk_data );
70 
75  EntityId id() const override;
76 
81  int ownerRank() const override;
82 
89  int topologicalDimension() const override;
90 
96  int physicalDimension() const override;
97 
103  void boundingBox( Teuchos::Tuple<double, 6> &bounds ) const override;
104 
108  bool inBlock( const int block_id ) const override;
109 
113  bool onBoundary( const int boundary_id ) const override;
114 
118  Teuchos::RCP<EntityExtraData> extraData() const override;
119 
123  std::string description() const override
124  {
125  return std::string( "STK Mesh Entity" );
126  }
127 
131  void describe( Teuchos::FancyOStream &out,
132  const Teuchos::EVerbosityLevel verb_level ) const override;
133 
134  private:
135  // STK mesh entity extra data.
136  Teuchos::RCP<STKMeshEntityExtraData> d_extra_data;
137 
138  // STK mesh bulk data.
139  Teuchos::Ptr<stk::mesh::BulkData> d_bulk_data;
140 };
141 
142 //---------------------------------------------------------------------------//
143 
144 } // end namespace DataTransferKit
145 
146 //---------------------------------------------------------------------------//
147 
148 #endif // end DTK_STKMESHENTITYIMPL_HPP
149 
150 //---------------------------------------------------------------------------//
151 // end DTK_STKMeshEntityImpl.hpp
152 //---------------------------------------------------------------------------//
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verb_level) const override
Provide a verbose description of the object.
Geometric entity implementation definition.
int ownerRank() const override
Get the parallel rank that owns the entity.
bool inBlock(const int block_id) const override
Determine if an entity is in the block with the given id.
bool onBoundary(const int boundary_id) const override
Determine if an entity is on the boundary with the given id.
STKMeshEntityImpl(const stk::mesh::Entity &stk_entity, const Teuchos::Ptr< stk::mesh::BulkData > &bulk_data)
Constructor.
EntityId id() const override
Get the unique global identifier for the entity.
int topologicalDimension() const override
Return the topological dimension of the entity.
unsigned long int EntityId
Entity id type.
Definition: DTK_Types.hpp:50
std::string description() const override
Provide a one line description of the object.
Geometric entity implementation definition.
Teuchos::RCP< EntityExtraData > extraData() const override
Get the extra data on the entity.
DTK_BasicEntitySet.cpp.
int physicalDimension() const override
Return the physical dimension of the entity.
void boundingBox(Teuchos::Tuple< double, 6 > &bounds) const override
Return the Cartesian bounding box around an entity.