GEOSX
CustomPolarObject.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOSX_MESH_SIMPLEGEOMETRICOBJECTS_CUSTOMPOLAROBJECT_HPP_
20 #define GEOSX_MESH_SIMPLEGEOMETRICOBJECTS_CUSTOMPOLAROBJECT_HPP_
21 
23 
24 namespace geos
25 {
26 
32 {
33 public:
34 
39 
45  CustomPolarObject( const string & name,
46  Group * const parent );
47 
51  virtual ~CustomPolarObject() override;
52 
54 
59 
64  static string catalogName() { return "CustomPolarObject"; }
65 
67 
68  bool isCoordInObject( real64 const ( &coord ) [3] ) const override final;
69 
74 
79  virtual R1Tensor & getCenter() override final {return m_center;}
80 
84  virtual R1Tensor const & getCenter() const override final {return m_center;}
85 
91  {
92  //m_radius.m_coefficients = coefficients;
93  m_coefficients = coefficients;
94  }
95 
101  real64 getRadius( real64 angle ) const
102  {
103  real64 radius = 0;
104  integer count = 0;
105  for( auto coeff:m_coefficients )
106  {
107  radius = radius + coeff*cos( count*angle );
108  count++;
109  }
110  return radius;
111  }
112 
113 protected:
114 
119  virtual void postProcessInput() override final;
120 
121 private:
122 
124  R1Tensor m_center;
126  array1d< real64 > m_coefficients;
128  real64 m_tolerance;
129 
131 
132  struct viewKeyStruct
133  {
134  static constexpr char const * centerString() { return "center"; }
135  static constexpr char const * coefficientsString() { return "coefficients"; }
136  static constexpr char const * toleranceString() { return "tolerance"; }
137  };
138 
140 
141 };
142 } /* namespace geosx */
143 
144 #endif /* GEOSX_MESH_SIMPLEGEOMETRICOBJECTS_CustomPolarObject_HPP_*/
Class to represent a geometric disc in GEOSX.
virtual void postProcessInput() override final
This function provides the capability to post process input values prior to any other initialization ...
bool isCoordInObject(real64 const (&coord)[3]) const override final
Check if the input coordinates are in the object.
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:139
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:216