GEOS
CustomPolarObject.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 Total, S.A
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_CUSTOMPOLAROBJECT_HPP_
21 #define GEOS_MESH_SIMPLEGEOMETRICOBJECTS_CUSTOMPOLAROBJECT_HPP_
22 
24 
25 namespace geos
26 {
27 
33 {
34 public:
35 
40 
46  CustomPolarObject( const string & name,
47  Group * const parent );
48 
52  virtual ~CustomPolarObject() override;
53 
55 
60 
65  static string catalogName() { return "CustomPolarObject"; }
66 
68 
69  bool isCoordInObject( real64 const ( &coord ) [3] ) const override final;
70 
75 
80  virtual R1Tensor & getCenter() override final {return m_center;}
81 
85  virtual R1Tensor const & getCenter() const override final {return m_center;}
86 
92  {
93  //m_radius.m_coefficients = coefficients;
94  m_coefficients = coefficients;
95  }
96 
102  real64 getRadius( real64 angle ) const
103  {
104  real64 radius = 0;
105  integer count = 0;
106  for( auto coeff:m_coefficients )
107  {
108  radius = radius + coeff*cos( count*angle );
109  count++;
110  }
111  return radius;
112  }
113 
114 protected:
115 
120  virtual void postInputInitialization() override final;
121 
122 private:
123 
125  R1Tensor m_center;
127  array1d< real64 > m_coefficients;
129  real64 m_tolerance;
130 
132 
133  struct viewKeyStruct
134  {
135  static constexpr char const * centerString() { return "center"; }
136  static constexpr char const * coefficientsString() { return "coefficients"; }
137  static constexpr char const * toleranceString() { return "tolerance"; }
138  };
139 
141 
142 };
143 } /* namespace geos */
144 
145 #endif /* GEOS_MESH_SIMPLEGEOMETRICOBJECTS_CustomPolarObject_HPP_*/
Class to represent a geometric disc in GEOSX.
bool isCoordInObject(real64 const (&coord)[3]) const override final
Check if the input coordinates are in the object.
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.
void setCustomPolarObjectFunction(array1d< real64 > &coefficients)
Update the geometric function describing the boundary of the object.
CustomPolarObject(const string &name, Group *const parent)
Constructor.
virtual R1Tensor & getCenter() override final
Get the center of the CustomPolarObject.
virtual R1Tensor const & getCenter() const override final
Get the center of the CustomPolarObject.
real64 getRadius(real64 angle) const
Get value of the radius of the surface for each angle theta.
virtual ~CustomPolarObject() override
Default destructor.
Abstract class to implement functions used by all bounded geometric objects in GEOSX,...
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:176
Structure to hold scoped key names.
Definition: Group.hpp:1442