DataTransferKit - Multiphysics Solution Transfer Services  2.0
DTK_EntityImpl.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_ENTITYIMPL_HPP
42 #define DTK_ENTITYIMPL_HPP
43 
44 #include "DTK_EntityExtraData.hpp"
45 #include "DTK_Types.hpp"
46 
47 #include <Teuchos_ArrayView.hpp>
48 #include <Teuchos_ParameterList.hpp>
49 
50 namespace DataTransferKit
51 {
52 //---------------------------------------------------------------------------//
57 //---------------------------------------------------------------------------//
59 {
60  public:
64  EntityImpl() { /* ... */}
65 
69  virtual ~EntityImpl() { /* ... */}
70 
76  virtual EntityId id() const = 0;
77 
83  virtual int ownerRank() const = 0;
84 
91  virtual int topologicalDimension() const = 0;
92 
99  virtual int physicalDimension() const = 0;
100 
107  virtual void boundingBox( Teuchos::Tuple<double, 6> &bounds ) const = 0;
108 
112  virtual bool inBlock( const int block_id ) const = 0;
113 
117  virtual bool onBoundary( const int boundary_id ) const = 0;
118 
122  virtual Teuchos::RCP<EntityExtraData> extraData() const
123  {
124  return Teuchos::null;
125  }
126 
130  virtual std::string description() const
131  {
132  return std::string( "DataTransferKit::EntityImpl" );
133  }
134 
138  virtual void describe( Teuchos::FancyOStream &out,
139  const Teuchos::EVerbosityLevel /*verb_level*/ ) const
140  {
141  out << "DataTransferKit::EntityImpl" << std::endl;
142  }
143 };
144 
145 //---------------------------------------------------------------------------//
146 
147 } // end namespace DataTransferKit
148 
149 //---------------------------------------------------------------------------//
150 
151 #endif // end DTK_ENTITYIMPL_HPP
152 
153 //---------------------------------------------------------------------------//
154 // end DTK_EntityImpl.hpp
155 //---------------------------------------------------------------------------//
virtual void boundingBox(Teuchos::Tuple< double, 6 > &bounds) const =0
Return the Cartesian bounding box around an entity.
virtual bool onBoundary(const int boundary_id) const =0
Determine if an entity is on the boundary with the given id.
virtual bool inBlock(const int block_id) const =0
Determine if an entity is in the block with the given id.
virtual ~EntityImpl()
Destructor.
virtual EntityId id() const =0
Get the unique global identifier for the entity.
virtual Teuchos::RCP< EntityExtraData > extraData() const
Get the extra data on the entity.
virtual int physicalDimension() const =0
Return the physical dimension of the entity.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel) const
Provide a verbose description of the object.
virtual int ownerRank() const =0
Get the parallel rank that owns the entity.
virtual std::string description() const
Provide a one line description of the object.
unsigned long int EntityId
Entity id type.
Definition: DTK_Types.hpp:50
virtual int topologicalDimension() const =0
Return the topological dimension of the entity.
Geometric entity implementation definition.
DTK_BasicEntitySet.cpp.