GEOS
Rectangle.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_MESH_SIMPLEGEOMETRICOBJECTS_RECTANGLE_HPP_
21 #define GEOS_MESH_SIMPLEGEOMETRICOBJECTS_RECTANGLE_HPP_
22 
24 
25 namespace geos
26 {
27 
33 {
34 public:
35 
40 
46  Rectangle( const string & name,
47  Group * const parent );
48 
59  Rectangle( const real64 oldX, const real64 oldY, const real64 newX,
60  const real64 newY, const string & name, Group * const parent );
61 
65  virtual ~Rectangle() override;
66 
68 
73 
78  static string catalogName() { return "Rectangle"; }
79 
81 
82  bool isCoordInObject( real64 const ( &coord ) [3] ) const override final;
83 
88 
93 
98  virtual R1Tensor & getCenter() override final {return m_origin;}
99 
103  virtual R1Tensor const & getCenter() const override final {return m_origin;}
104 
105 
106 
107 protected:
108 
113  virtual void postInputInitialization() override final;
114 
115 private:
116 
118  R1Tensor m_origin;
120  array1d< real64 > m_dimensions;
122  array2d< real64 > m_points;
124  real64 m_tolerance;
125 
127 
128  struct viewKeyStruct
129  {
130  static constexpr char const * originString() { return "origin"; }
131  static constexpr char const * dimensionsString() { return "dimensions"; }
132  static constexpr char const * toleranceString() { return "tolerance"; }
133  };
134 
136 
137 };
138 } /* namespace geos */
139 
140 #endif /* GEOS_MESH_SIMPLEGEOMETRICOBJECTS_RECTANGLE_HPP_*/
Abstract class to implement functions used by all bounded geometric objects in GEOSX,...
Class to represent a geometric box in GEOSX.
Definition: Rectangle.hpp:33
Rectangle(const string &name, Group *const parent)
Constructor.
virtual void postInputInitialization() override final
This function provides the capability to post process input values prior to any other initialization ...
static string catalogName()
Get the catalog name.
Definition: Rectangle.hpp:78
virtual R1Tensor const & getCenter() const override final
Get the origin of the plane.
Definition: Rectangle.hpp:103
bool isCoordInObject(real64 const (&coord)[3]) const override final
Check if the input coordinates are in the object.
Rectangle(const real64 oldX, const real64 oldY, const real64 newX, const real64 newY, const string &name, Group *const parent)
Internal constructor. This is used to make planar cuts from point (oldX, oldY) to (newX,...
void findRectangleLimits()
Find the bounds of the plane.
virtual R1Tensor & getCenter() override final
Get the origin of the plane.
Definition: Rectangle.hpp:98
virtual ~Rectangle() override
Default destructor.
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:192
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:176
Structure to hold scoped key names.
Definition: Group.hpp:1442