oomph::PiecewiseGauss< DIM, NPTS_1D > Class Template Reference

#include <contact_elements.h>

+ Inheritance diagram for oomph::PiecewiseGauss< DIM, NPTS_1D >:

Public Member Functions

 PiecewiseGauss (const double &lower, const double &upper)
 
 PiecewiseGauss (const PiecewiseGauss &dummy)
 Broken copy constructor. More...
 
virtual unsigned nweight () const
 Return the number of integration points of the scheme. More...
 
double knot (const unsigned &i, const unsigned &j) const
 Return the rescaled knot values s[j] at integration point i. More...
 
double weight (const unsigned &i) const
 Return the rescaled weight at integration point i. More...
 

Private Attributes

double Lower
 Store for the lower and upper limits of integration and the range. More...
 
double Upper
 
double Range
 

Detailed Description

template<unsigned DIM, unsigned NPTS_1D>
class oomph::PiecewiseGauss< DIM, NPTS_1D >

Piecewise Gauss integration rule. Uses Gauss rules of specified order in three sub-intervals of element.

Constructor & Destructor Documentation

◆ PiecewiseGauss() [1/2]

template<unsigned DIM, unsigned NPTS_1D>
oomph::PiecewiseGauss< DIM, NPTS_1D >::PiecewiseGauss ( const double lower,
const double upper 
)
inline

Constructor: Pass in lower and upper limits of 1D coordinate over which we're integrating

63  :
64  Lower(lower), Upper(upper)
65  {
66  //Set the range of integration
67  Range = upper - lower;
68  }
double Range
Definition: contact_elements.h:57
double Lower
Store for the lower and upper limits of integration and the range.
Definition: contact_elements.h:57
double Upper
Definition: contact_elements.h:57
std::string lower(std::string s)
returns the input string after converting upper-case characters to lower case
Definition: StringHelpers.cc:11

References helpers::lower(), and oomph::PiecewiseGauss< DIM, NPTS_1D >::Range.

◆ PiecewiseGauss() [2/2]

template<unsigned DIM, unsigned NPTS_1D>
oomph::PiecewiseGauss< DIM, NPTS_1D >::PiecewiseGauss ( const PiecewiseGauss< DIM, NPTS_1D > &  dummy)
inline

Broken copy constructor.

72  {
73  BrokenCopy::broken_copy("PiecewiseGauss");
74  }
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
Definition: oomph_utilities.cc:212

References oomph::BrokenCopy::broken_copy().

Member Function Documentation

◆ knot()

template<unsigned DIM, unsigned NPTS_1D>
double oomph::PiecewiseGauss< DIM, NPTS_1D >::knot ( const unsigned i,
const unsigned j 
) const
inline

Return the rescaled knot values s[j] at integration point i.

84  {
85  if (i<Gauss<DIM,NPTS_1D>::nweight())
86  {
87  double range=0.25*Range;
88  double lower=Lower+0.0;
89  //double upper=Lower+0.25*Range;
90  unsigned ii=i;
91  return (lower+(0.5*(1.0+Gauss<DIM,NPTS_1D>::knot(ii,j))*range));
92  }
93  else if (i<2*Gauss<DIM,NPTS_1D>::nweight())
94  {
95  double range=0.5*Range;
96  double lower=Lower+0.25*Range;
97  //double upper=Lower+0.75*Range;
98  unsigned ii=i-Gauss<DIM,NPTS_1D>::nweight();
99  return (lower+(0.5*(1.0+Gauss<DIM,NPTS_1D>::knot(ii,j))*range));
100  }
101  else
102  {
103  double range=0.25*Range;
104  double lower=Lower+0.75*Range;
105  //double upper=Upper;
106  unsigned ii=i-2*Gauss<DIM,NPTS_1D>::nweight();
107  return (lower+(0.5*(1.0+Gauss<DIM,NPTS_1D>::knot(ii,j))*range));
108  }
109  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References i, j, helpers::lower(), oomph::PiecewiseGauss< DIM, NPTS_1D >::Lower, and oomph::PiecewiseGauss< DIM, NPTS_1D >::Range.

◆ nweight()

template<unsigned DIM, unsigned NPTS_1D>
virtual unsigned oomph::PiecewiseGauss< DIM, NPTS_1D >::nweight ( ) const
inlinevirtual

Return the number of integration points of the scheme.

78  {
79  return 3*Gauss<DIM,NPTS_1D>::nweight();
80  }

◆ weight()

template<unsigned DIM, unsigned NPTS_1D>
double oomph::PiecewiseGauss< DIM, NPTS_1D >::weight ( const unsigned i) const
inline

Return the rescaled weight at integration point i.

113  {
114  if (i<Gauss<DIM,NPTS_1D>::nweight())
115  {
116  double range=0.25*Range;
117  unsigned ii=i;
118  return Gauss<DIM,NPTS_1D>::weight(ii)*
119  pow(0.5*range,static_cast<int>(DIM));
120  }
121  else if (i<2*Gauss<DIM,NPTS_1D>::nweight())
122  {
123  double range=0.5*Range;
124  unsigned ii=i-Gauss<DIM,NPTS_1D>::nweight();
125  return Gauss<DIM,NPTS_1D>::weight(ii)*
126  pow(0.5*range,static_cast<int>(DIM));
127  }
128 
129  else
130  {
131  double range=0.25*Range;
132  unsigned ii=i-2*Gauss<DIM,NPTS_1D>::nweight();
133  return Gauss<DIM,NPTS_1D>::weight(ii)*
134  pow(0.5*range,static_cast<int>(DIM));
135  }
136  }
#define DIM
Definition: linearised_navier_stokes_elements.h:44
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625

References DIM, i, Eigen::bfloat16_impl::pow(), and oomph::PiecewiseGauss< DIM, NPTS_1D >::Range.

Member Data Documentation

◆ Lower

template<unsigned DIM, unsigned NPTS_1D>
double oomph::PiecewiseGauss< DIM, NPTS_1D >::Lower
private

Store for the lower and upper limits of integration and the range.

Referenced by oomph::PiecewiseGauss< DIM, NPTS_1D >::knot().

◆ Range

◆ Upper

template<unsigned DIM, unsigned NPTS_1D>
double oomph::PiecewiseGauss< DIM, NPTS_1D >::Upper
private

The documentation for this class was generated from the following file: