DataTransferKit - Multiphysics Solution Transfer Services  2.0
DTK_CylinderGeometryImpl.hpp
Go to the documentation of this file.
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_CYLINDERGEOMETRYIMPL_HPP
42 #define DTK_CYLINDERGEOMETRYIMPL_HPP
43 
45 
46 #include <Teuchos_ArrayView.hpp>
47 #include <Teuchos_Tuple.hpp>
48 
49 namespace DataTransferKit
50 {
51 //---------------------------------------------------------------------------//
58 //---------------------------------------------------------------------------//
60 {
61 
62  public:
63  // Default constructor.
65 
66  // Constructor.
67  CylinderGeometryImpl( const EntityId global_id, const int owner_rank,
68  const int block_id, const double length,
69  const double radius, const double centroid_x,
70  const double centroid_y, const double centroid_z );
71 
73  double length() const { return d_length; }
74 
76  double radius() const { return d_radius; }
77 
78  // Get the unique global identifier for the entity.
79  EntityId id() const override;
80 
81  // Get the parallel rank that owns the entity.
82  int ownerRank() const override;
83 
84  // Return the topological dimension of the entity.
85  int topologicalDimension() const override;
86 
87  // Return the physical dimension of the entity.
88  int physicalDimension() const override;
89 
90  // Compute the bounding box around the entity.
91  void boundingBox( Teuchos::Tuple<double, 6> &bounds ) const override;
92 
93  // Determine if an entity is in the block with the given id.
94  bool inBlock( const int block_id ) const override;
95 
96  // Determine if an entity is on the boundary with the given id.
97  bool onBoundary( const int boundary_id ) const override;
98 
99  // Provide a one line description of the object.
100  std::string description() const override
101  {
102  return std::string( "Basic Geometry CylinderGeometry" );
103  }
104 
105  // Provide a verbose description of the object.
106  void describe( Teuchos::FancyOStream &out,
107  const Teuchos::EVerbosityLevel verb_level ) const override;
108 
109  // Return the entity measure with respect to the parameteric
110  double measure() const override;
111 
112  // Compute the centroid of the entity.
113  void centroid( const Teuchos::ArrayView<double> &centroid ) const override;
114 
115  // (Reverse Map) Map a point to the reference space of an entity. Return
116  // the parameterized point.
117  bool mapToReferenceFrame(
118  const Teuchos::ArrayView<const double> &point,
119  const Teuchos::ArrayView<double> &reference_point ) const override;
120 
121  // Determine if a reference point is in the parameterized space of an
122  // entity.
123  bool checkPointInclusion( const double tolerance,
124  const Teuchos::ArrayView<const double>
125  &reference_point ) const override;
126 
127  // (Forward Map) Map a reference point to the physical space of an entity.
128  void mapToPhysicalFrame(
129  const Teuchos::ArrayView<const double> &reference_point,
130  const Teuchos::ArrayView<double> &point ) const override;
131 
132  private:
133  // Entity id.
134  EntityId d_global_id;
135 
136  // Owner rank.
137  int d_owner_rank;
138 
139  // Block id.
140  int d_block_id;
141 
142  // Length.
143  double d_length;
144 
145  // Radius.
146  double d_radius;
147 
148  // Centroid X-coordinate
149  double d_centroid_x;
150 
151  // Centroid Y-coordinate
152  double d_centroid_y;
153 
154  // Centroid Z-coordinate
155  double d_centroid_z;
156 };
157 
158 //---------------------------------------------------------------------------//
159 
160 } // end namespace DataTransferKit
161 
162 #endif // end DTK_CYLINDERGEOMETRYIMPL_HPP
163 
164 //---------------------------------------------------------------------------//
165 // end DTK_CylinderGeometryImpl.hpp
166 //---------------------------------------------------------------------------//
bool checkPointInclusion(const double tolerance, const Teuchos::ArrayView< const double > &reference_point) const override
Determine if a reference point is in the parameterized space of an entity.
double radius() const
Get the radius of the cylinder.
double length() const
Get the length of the cylinder.
BasicGeometryEntityImpl declaration.
EntityId id() const override
EntityImpl interface.
std::string description() const override
Provide a one line description of the object.
bool inBlock(const int block_id) const override
Determine if an entity is in the block with the given id.
Z-axis-aligned Cartesian cylinder container implementation.
bool mapToReferenceFrame(const Teuchos::ArrayView< const double > &point, const Teuchos::ArrayView< double > &reference_point) const override
Map a point to the reference space of an entity. Return the.
double measure() const override
Compute the measure of the box.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verb_level) const override
Provide a verbose description of the object.
int ownerRank() const override
Get the parallel rank that owns the entity.
unsigned long int EntityId
Entity id type.
Definition: DTK_Types.hpp:50
bool onBoundary(const int boundary_id) const override
Determine if an entity is on the boundary with the given id.
void centroid(const Teuchos::ArrayView< double > &centroid) const override
Get the centroid of the box.
void mapToPhysicalFrame(const Teuchos::ArrayView< const double > &reference_point, const Teuchos::ArrayView< double > &point) const override
Map a reference point to the physical space of an entity.
void boundingBox(Teuchos::Tuple< double, 6 > &bounds) const override
Compute the bounding box around the box.
int topologicalDimension() const override
Return the topological dimension of the entity.
DTK_BasicEntitySet.cpp.
int physicalDimension() const override
Return the physical dimension of the entity.