DataTransferKit - Multiphysics Solution Transfer Services  2.0
DTK_Entity.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_ENTITY_HPP
42 #define DTK_ENTITY_HPP
43 
44 #include "DTK_EntityExtraData.hpp"
45 #include "DTK_EntityImpl.hpp"
46 #include "DTK_Types.hpp"
47 
48 #include <Teuchos_ArrayView.hpp>
49 #include <Teuchos_Describable.hpp>
50 #include <Teuchos_RCP.hpp>
51 #include <Teuchos_Tuple.hpp>
52 
53 namespace DataTransferKit
54 {
55 //---------------------------------------------------------------------------//
60 //---------------------------------------------------------------------------//
61 class Entity : public Teuchos::Describable
62 {
63  public:
67  Entity();
68 
72  Entity( const Entity &rhs );
73 
77  Entity &operator=( const Entity &rhs );
78 
82  Entity( Entity &&rhs );
83 
87  Entity &operator=( Entity &&rhs );
88 
92  virtual ~Entity();
93 
95 
102  EntityId id() const;
103 
109  int ownerRank() const;
110 
118  int topologicalDimension() const;
119 
127  int physicalDimension() const;
128 
135  void boundingBox( Teuchos::Tuple<double, 6> &bounds ) const;
136 
140  bool inBlock( const int block_id ) const;
141 
145  bool onBoundary( const int boundary_id ) const;
146 
151  Teuchos::RCP<EntityExtraData> extraData() const;
153 
155 
159  std::string description() const override;
160 
164  void describe( Teuchos::FancyOStream &out,
165  const Teuchos::EVerbosityLevel verb_level =
166  Teuchos::Describable::verbLevel_default ) const override;
168 
169  protected:
170  // Entity implementation.
171  Teuchos::RCP<EntityImpl> b_entity_impl;
172 };
173 
174 //---------------------------------------------------------------------------//
175 
176 } // end namespace DataTransferKit
177 
178 //---------------------------------------------------------------------------//
179 
180 #endif // end DTK_ENTITY_HPP
181 
182 //---------------------------------------------------------------------------//
183 // end DTK_Entity.hpp
184 //---------------------------------------------------------------------------//
Entity & operator=(const Entity &rhs)
Copy assignment operator.
Definition: DTK_Entity.cpp:58
Geometric entity interface definition.
Definition: DTK_Entity.hpp:61
virtual ~Entity()
Destructor.
Definition: DTK_Entity.cpp:78
Entity()
Constructor.
Definition: DTK_Entity.cpp:50
void boundingBox(Teuchos::Tuple< double, 6 > &bounds) const
Return the Cartesian bounding box around an entity.
Definition: DTK_Entity.cpp:114
int ownerRank() const
Get the parallel rank that owns the entity.
Definition: DTK_Entity.cpp:90
bool inBlock(const int block_id) const
Determine if an entity is in the block with the given id.
Definition: DTK_Entity.cpp:122
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verb_level=Teuchos::Describable::verbLevel_default) const override
Provide a verbose description of the object.
Definition: DTK_Entity.cpp:158
Teuchos::RCP< EntityExtraData > extraData() const
Get the extra data on the entity. This is a convenient helper for implementing the other interfaces...
Definition: DTK_Entity.cpp:138
int physicalDimension() const
Return the physical dimension of the entity.
Definition: DTK_Entity.cpp:106
unsigned long int EntityId
Entity id type.
Definition: DTK_Types.hpp:50
int topologicalDimension() const
Return the topological dimension of the entity.
Definition: DTK_Entity.cpp:98
DTK_BasicEntitySet.cpp.
std::string description() const override
Teuchos::Describable interface.
Definition: DTK_Entity.cpp:146
bool onBoundary(const int boundary_id) const
Determine if an entity is on the boundary with the given id.
Definition: DTK_Entity.cpp:130
EntityId id() const
Client interface.
Definition: DTK_Entity.cpp:82