Reference documentation for deal.II version 9.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Functions::Spherical< dim > Class Template Reference

#include <deal.II/base/function_spherical.h>

Inheritance diagram for Functions::Spherical< dim >:
[legend]

Public Member Functions

 Spherical (const Point< dim > &center=Point< dim >(), const unsigned int n_components=1)
 
virtual double value (const Point< dim > &point, const unsigned int component=0) const
 
virtual Tensor< 1, dim > gradient (const Point< dim > &p, const unsigned int component=0) const
 
virtual SymmetricTensor< 2, dim > hessian (const Point< dim > &p, const unsigned int component=0) const
 
- Public Member Functions inherited from Function< dim >
 Function (const unsigned int n_components=1, const double initial_time=0.0)
 
virtual ~Function ()=0
 
Functionoperator= (const Function &f)
 
virtual void vector_value (const Point< dim > &p, Vector< double > &values) const
 
virtual void value_list (const std::vector< Point< dim > > &points, std::vector< double > &values, const unsigned int component=0) const
 
virtual void vector_value_list (const std::vector< Point< dim > > &points, std::vector< Vector< double > > &values) const
 
virtual void vector_values (const std::vector< Point< dim > > &points, std::vector< std::vector< double > > &values) const
 
virtual void vector_gradient (const Point< dim > &p, std::vector< Tensor< 1, dim, double > > &gradients) const
 
virtual void gradient_list (const std::vector< Point< dim > > &points, std::vector< Tensor< 1, dim, double > > &gradients, const unsigned int component=0) const
 
virtual void vector_gradients (const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim, double > > > &gradients) const
 
virtual void vector_gradient_list (const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim, double > > > &gradients) const
 
virtual double laplacian (const Point< dim > &p, const unsigned int component=0) const
 
virtual void vector_laplacian (const Point< dim > &p, Vector< double > &values) const
 
virtual void laplacian_list (const std::vector< Point< dim > > &points, std::vector< double > &values, const unsigned int component=0) const
 
virtual void vector_laplacian_list (const std::vector< Point< dim > > &points, std::vector< Vector< double > > &values) const
 
virtual void vector_hessian (const Point< dim > &p, std::vector< SymmetricTensor< 2, dim, double > > &values) const
 
virtual void hessian_list (const std::vector< Point< dim > > &points, std::vector< SymmetricTensor< 2, dim, double > > &values, const unsigned int component=0) const
 
virtual void vector_hessian_list (const std::vector< Point< dim > > &points, std::vector< std::vector< SymmetricTensor< 2, dim, double > > > &values) const
 
std::size_t memory_consumption () const
 
- Public Member Functions inherited from FunctionTime< Number >
 FunctionTime (const Number initial_time=Number(0.0))
 
virtual ~FunctionTime ()=default
 
Number get_time () const
 
virtual void set_time (const Number new_time)
 
virtual void advance_time (const Number delta_t)
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
 Subscriptor (Subscriptor &&) noexcept
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (Subscriptor &&) noexcept
 
void subscribe (const char *identifier=nullptr) const
 
void unsubscribe (const char *identifier=nullptr) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Member Functions

virtual double svalue (const std::array< double, dim > &sp, const unsigned int component) const
 
virtual std::array< double, dim > sgradient (const std::array< double, dim > &sp, const unsigned int component) const
 
virtual std::array< double, 6 > shessian (const std::array< double, dim > &sp, const unsigned int component) const
 

Private Attributes

const Tensor< 1, dim > coordinate_system_offset
 

Additional Inherited Members

- Static Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- Public Attributes inherited from Function< dim >
const unsigned int n_components
 
- Static Public Attributes inherited from Function< dim >
static const unsigned int dimension
 

Detailed Description

template<int dim>
class Functions::Spherical< dim >

An abstract base class for a scalar-valued function \(f=f(r,\theta,\phi)\) defined in spherical coordinates. This class wraps transformation of values, gradients and hessians from spherical coordinates to the Cartesian coordinate system used by the Function base class. Therefore derived classes only need to implement those functions in spherical coordinates (specifically svalue(), sgradient() and shessian() ). The convention for angles is the same as in GeometricUtilities::Coordinates.

Note
This function is currently only implemented for dim==3 .
Author
Denis Davydov, 2017

Definition at line 47 of file function_spherical.h.

Constructor & Destructor Documentation

◆ Spherical()

template<int dim>
Functions::Spherical< dim >::Spherical ( const Point< dim > &  center = Point<dim>(),
const unsigned int  n_components = 1 
)

Constructor which should be provided with center defining the origin of the coordinate system.

Note that components of this function are treated as entirely separate quantities – not as the components of a vector that will be re-interpreted in a different coordinate system.

Definition at line 156 of file function_spherical.cc.

Member Function Documentation

◆ value()

template<int dim>
double Functions::Spherical< dim >::value ( const Point< dim > &  point,
const unsigned int  component = 0 
) const
virtual

Return the value of the function at the given point.

This function converts the given point to spherical coordinates, calls svalue() with it, and returns the result.

Reimplemented from Function< dim >.

Definition at line 170 of file function_spherical.cc.

◆ gradient()

template<int dim>
Tensor< 1, dim > Functions::Spherical< dim >::gradient ( const Point< dim > &  p,
const unsigned int  component = 0 
) const
virtual

Return the gradient with respect to the Cartesian coordinates at point p.

This function converts the given point to spherical coordinates, calls sgradient() with it, and converts the result into Cartesian coordinates.

Reimplemented from Function< dim >.

Definition at line 182 of file function_spherical.cc.

◆ hessian()

template<int dim>
SymmetricTensor< 2, dim > Functions::Spherical< dim >::hessian ( const Point< dim > &  p,
const unsigned int  component = 0 
) const
virtual

Return the Hessian with respect to the Cartesian coordinates at point p.

This function converts the given point to spherical coordinates, calls sgradient and shessian() with it, and converts the result into Cartesian coordinates.

Reimplemented from Function< dim >.

Definition at line 241 of file function_spherical.cc.

◆ svalue()

template<int dim>
double Functions::Spherical< dim >::svalue ( const std::array< double, dim > &  sp,
const unsigned int  component 
) const
privatevirtual

Return the value at point sp. Here, sp is provided in spherical coordinates.

Definition at line 339 of file function_spherical.cc.

◆ sgradient()

template<int dim>
std::array< double, dim > Functions::Spherical< dim >::sgradient ( const std::array< double, dim > &  sp,
const unsigned int  component 
) const
privatevirtual

Return the gradient in spherical coordinates.

The returned object should contain derivatives in the following order: \(\{ f_{,r},\, f_{,\theta},\, f_{,\phi}\}\).

Definition at line 351 of file function_spherical.cc.

◆ shessian()

template<int dim>
std::array< double, 6 > Functions::Spherical< dim >::shessian ( const std::array< double, dim > &  sp,
const unsigned int  component 
) const
privatevirtual

Return the Hessian in spherical coordinates.

The returned object should contain derivatives in the following order: \(\{ f_{,rr},\, f_{,\theta\theta},\, f_{,\phi\phi},\, f_{,r\theta},\, f_{,r\phi},\, f_{,\theta\phi}\}\).

Definition at line 363 of file function_spherical.cc.

Member Data Documentation

◆ coordinate_system_offset

template<int dim>
const Tensor<1,dim> Functions::Spherical< dim >::coordinate_system_offset
private

A vector from the origin to the center of spherical coordinate system.

Definition at line 121 of file function_spherical.h.


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