Octopus
mesh_function_oct_m Module Reference

This module defines various routines, operating on mesh functions. More...

Detailed Description

This module defines various routines, operating on mesh functions.

Data Types

interface  dmf_dotp
 
interface  dmf_nrm2
 
interface  mf_line_integral
 
interface  mf_surface_integral
 
interface  zmf_dotp
 
interface  zmf_nrm2
 

Functions/Subroutines

subroutine, public mesh_init_mesh_aux (mesh)
 Initialise a pointer to the grid/mesh, that is globally exposed, such that low level mesh operations implicitly access the mesh without it being part of the routine signature. More...
 
subroutine, public zmf_fix_phase (mesh, ff)
 Fix the phase of complex function. More...
 
real(real64) function, public dmf_integrate (mesh, ff, mask, reduce)
 Integrate a function on the mesh. More...
 
subroutine, public dmf_normalize (mesh, dim, psi, norm)
 Normalize a mesh function psi. More...
 
real(real64) function dmf_dotp_1 (mesh, f1, f2, reduce, dotu, np)
 this function returns the dot product between two mesh functions More...
 
real(real64) function dmf_dotp_2 (mesh, dim, f1, f2, reduce, dotu, np)
 dot product for vector valued mesh functions More...
 
real(real64) function dmf_nrm2_1 (mesh, ff, reduce)
 this function returns the norm of a mesh function More...
 
real(real64) function dmf_nrm2_2 (mesh, dim, ff, reduce)
 this function returns the norm of a vector of mesh functions More...
 
real(real64) function, public dmf_moment (mesh, ff, idir, order)
 This function calculates the "order" moment of the function ff. More...
 
subroutine, public dmf_random (mesh, ff, pre_shift, post_shift, seed, normalized)
 This subroutine fills a function with random values. More...
 
subroutine, public dmf_interpolate_points (ndim, npoints_in, x_in, f_in, npoints_out, x_out, f_out)
 This function receives a function f_in defined in a mesh, and returns the interpolated values of the function over the npoints_in defined by x_in. More...
 
subroutine dmf_interpolate_on_plane (mesh, plane, ff, f_in_plane)
 Given a function ff defined on mesh, and a plane, it gives back the values of ff on the plane, by doing the appropriate interpolation. More...
 
subroutine dmf_interpolate_on_line (mesh, line, ff, f_in_line)
 Given a function ff defined on mesh, and a line, it gives back the values of ff on the line, by doing the appropriate interpolation. More...
 
real(real64) function dmf_surface_integral_scalar (mesh, ff, plane)
 This subroutine calculates the surface integral of a scalar function on a given plane. More...
 
real(real64) function dmf_surface_integral_vector (mesh, ff, plane)
 This subroutine calculates the surface integral of a vector function on a given plane. More...
 
real(real64) function dmf_line_integral_scalar (mesh, ff, line)
 This subroutine calculates the line integral of a scalar function on a given line. More...
 
real(real64) function dmf_line_integral_vector (mesh, ff, line)
 This subroutine calculates the line integral of a vector function on a given line. More...
 
subroutine, public dmf_multipoles (mesh, ff, lmax, multipole, mask)
 This routine calculates the multipoles of a function ff. More...
 
subroutine, public dmf_dipole (mesh, ff, dipole, mask)
 This routine calculates the dipole of a function ff, for arbitrary dimensions. More...
 
real(real64) function, public dmf_dotp_aux (f1, f2)
 dot product between two vectors (mesh functions) More...
 
real(real64) function, public dmf_dotu_aux (f1, f2)
 dot product between two vectors (mesh functions) without conjugation More...
 
real(real64) function, public dmf_nrm2_aux (ff)
 calculate norm2 of a vector (mesh function) More...
 
complex(real64) function, public zmf_integrate (mesh, ff, mask, reduce)
 Integrate a function on the mesh. More...
 
subroutine, public zmf_normalize (mesh, dim, psi, norm)
 Normalize a mesh function psi. More...
 
complex(real64) function zmf_dotp_1 (mesh, f1, f2, reduce, dotu, np)
 this function returns the dot product between two mesh functions More...
 
complex(real64) function zmf_dotp_2 (mesh, dim, f1, f2, reduce, dotu, np)
 dot product for vector valued mesh functions More...
 
real(real64) function zmf_nrm2_1 (mesh, ff, reduce)
 this function returns the norm of a mesh function More...
 
real(real64) function zmf_nrm2_2 (mesh, dim, ff, reduce)
 this function returns the norm of a vector of mesh functions More...
 
complex(real64) function, public zmf_moment (mesh, ff, idir, order)
 This function calculates the "order" moment of the function ff. More...
 
subroutine, public zmf_random (mesh, ff, pre_shift, post_shift, seed, normalized)
 This subroutine fills a function with random values. More...
 
subroutine, public zmf_interpolate_points (ndim, npoints_in, x_in, f_in, npoints_out, x_out, f_out)
 This function receives a function f_in defined in a mesh, and returns the interpolated values of the function over the npoints_in defined by x_in. More...
 
subroutine zmf_interpolate_on_plane (mesh, plane, ff, f_in_plane)
 Given a function ff defined on mesh, and a plane, it gives back the values of ff on the plane, by doing the appropriate interpolation. More...
 
subroutine zmf_interpolate_on_line (mesh, line, ff, f_in_line)
 Given a function ff defined on mesh, and a line, it gives back the values of ff on the line, by doing the appropriate interpolation. More...
 
complex(real64) function zmf_surface_integral_scalar (mesh, ff, plane)
 This subroutine calculates the surface integral of a scalar function on a given plane. More...
 
complex(real64) function zmf_surface_integral_vector (mesh, ff, plane)
 This subroutine calculates the surface integral of a vector function on a given plane. More...
 
complex(real64) function zmf_line_integral_scalar (mesh, ff, line)
 This subroutine calculates the line integral of a scalar function on a given line. More...
 
complex(real64) function zmf_line_integral_vector (mesh, ff, line)
 This subroutine calculates the line integral of a vector function on a given line. More...
 
subroutine, public zmf_multipoles (mesh, ff, lmax, multipole, mask)
 This routine calculates the multipoles of a function ff. More...
 
subroutine, public zmf_dipole (mesh, ff, dipole, mask)
 This routine calculates the dipole of a function ff, for arbitrary dimensions. More...
 
complex(real64) function, public zmf_dotp_aux (f1, f2)
 dot product between two vectors (mesh functions) More...
 
complex(real64) function, public zmf_dotu_aux (f1, f2)
 dot product between two vectors (mesh functions) without conjugation More...
 
real(real64) function, public zmf_nrm2_aux (ff)
 calculate norm2 of a vector (mesh function) More...
 

Variables

logical, public sp_parallel
 
integer, public sp_np
 
integer, public sp_dim
 
integer, public sp_st1
 
integer, public sp_st2
 
integer, public sp_kp1
 
integer, public sp_kp2
 
integer, public sp_distdot_mode
 
type(mpi_grp_t), public sp_grp
 
class(mesh_t), pointer, public mesh_aux => null()
 Globally-scoped pointer to the mesh instance. More...
 

Function/Subroutine Documentation

◆ mesh_init_mesh_aux()

subroutine, public mesh_function_oct_m::mesh_init_mesh_aux ( class(mesh_t), intent(in), target  mesh)

Initialise a pointer to the grid/mesh, that is globally exposed, such that low level mesh operations implicitly access the mesh without it being part of the routine signature.

Definition at line 209 of file mesh_function.F90.

◆ zmf_fix_phase()

subroutine, public mesh_function_oct_m::zmf_fix_phase ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(inout)  ff 
)

Fix the phase of complex function.

Given a complex function on the grid, we want to minimize its imaginary part For this, we determine the angle that will minimize the imaginary part after rotation in the complex plane. We then choose the solution that maximizes the real part

Definition at line 225 of file mesh_function.F90.

◆ dmf_integrate()

real(real64) function, public mesh_function_oct_m::dmf_integrate ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in)  ff,
logical, dimension(:), intent(in), optional  mask,
logical, intent(in), optional  reduce 
)

Integrate a function on the mesh.

\[ d = \sum_i^N f_i dV_i \]

where \( f_i \) is the discrete function, \(dV_i\) is the volume element, and \( N \) is the number of mesh points.

Parameters
[in]ffFunction to integrate with dimensions (1:mesh%np)
[in]maskDefine which grid points to integrate over
[in]reducePerform reduction over all grid domains

Definition at line 374 of file mesh_function.F90.

◆ dmf_normalize()

subroutine, public mesh_function_oct_m::dmf_normalize ( class(mesh_t), intent(in)  mesh,
integer, intent(in)  dim,
real(real64), dimension(:,:), intent(inout), contiguous  psi,
real(real64), intent(out), optional  norm 
)

Normalize a mesh function psi.

Parameters
[in]meshunderlying mesh
[in]dimspinor dimension of the function
[in,out]psimesh function psi(mesh%np, dim)
[out]normoptional output of the norm

Definition at line 423 of file mesh_function.F90.

◆ dmf_dotp_1()

real(real64) function mesh_function_oct_m::dmf_dotp_1 ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in)  f1,
real(real64), dimension(:), intent(in)  f2,
logical, intent(in), optional  reduce,
logical, intent(in), optional  dotu,
integer, intent(in), optional  np 
)
private

this function returns the dot product between two mesh functions

Parameters
[in]meshunderlying mesh
[in]f2mesh functions
[in]reduceif true, perform mpi reduction
[in]dotuif true, use blas_dotu instead of blas_dot; no complex conjugation. Default is false. This has no effect if working with real version

Definition at line 453 of file mesh_function.F90.

◆ dmf_dotp_2()

real(real64) function mesh_function_oct_m::dmf_dotp_2 ( class(mesh_t), intent(in)  mesh,
integer, intent(in)  dim,
real(real64), dimension(:,:), intent(in)  f1,
real(real64), dimension(:,:), intent(in)  f2,
logical, intent(in), optional  reduce,
logical, intent(in), optional  dotu,
integer, intent(in), optional  np 
)
private

dot product for vector valued mesh functions

Parameters
[in]meshunderlying mesh
[in]dimdimensions
[in]f2mesh functions of dimension (1:mesh%np, 1:dim)
[in]reduceif true, perform mpi reduction
[in]dotuif true, use lalg_dotu instead of lalg_dot; no complex conjugation. Default is false.
[in]npoptional number of points over which the integral is performed

Definition at line 528 of file mesh_function.F90.

◆ dmf_nrm2_1()

real(real64) function mesh_function_oct_m::dmf_nrm2_1 ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in)  ff,
logical, intent(in), optional  reduce 
)
private

this function returns the norm of a mesh function

Parameters
[in]meshunderlying mesh
[in]ffmesh function
[in]reduceif true, perform mpi reduction

Definition at line 560 of file mesh_function.F90.

◆ dmf_nrm2_2()

real(real64) function mesh_function_oct_m::dmf_nrm2_2 ( class(mesh_t), intent(in)  mesh,
integer, intent(in)  dim,
real(real64), dimension(:,:), intent(in)  ff,
logical, intent(in), optional  reduce 
)
private

this function returns the norm of a vector of mesh functions

Parameters
[in]meshunderlying mesh
[in]dimdimensions
[in]ffmesh function of dimension (1:mesh%np, 1:dim)
[in]reduceif true, perform mpi reduction

Definition at line 597 of file mesh_function.F90.

◆ dmf_moment()

real(real64) function, public mesh_function_oct_m::dmf_moment ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in)  ff,
integer, intent(in)  idir,
integer, intent(in)  order 
)

This function calculates the "order" moment of the function ff.

moment = \( \int ff({\bf x}) {\bf x}_{\rm idir}^{\rm order} \)

Parameters
[in]meshunderlying mesh
[in]ffmesh function
[in]idirCartesian direction
[in]orderorder of the moment

Definition at line 623 of file mesh_function.F90.

◆ dmf_random()

subroutine, public mesh_function_oct_m::dmf_random ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(out), contiguous  ff,
integer(int64), intent(in), optional  pre_shift,
integer(int64), intent(in), optional  post_shift,
integer(int64), intent(in), optional  seed,
logical, intent(in), optional  normalized 
)

This subroutine fills a function with random values.

Parameters
[in]normalizedwhether generate states should have norm 1, true by default

Definition at line 652 of file mesh_function.F90.

◆ dmf_interpolate_points()

subroutine, public mesh_function_oct_m::dmf_interpolate_points ( integer, intent(in)  ndim,
integer, intent(in)  npoints_in,
real(real64), dimension(:, :), intent(in)  x_in,
real(real64), dimension(:), intent(in)  f_in,
integer, intent(in)  npoints_out,
real(real64), dimension(:,:), intent(in)  x_out,
real(real64), dimension(:), intent(out)  f_out 
)

This function receives a function f_in defined in a mesh, and returns the interpolated values of the function over the npoints_in defined by x_in.

Parameters
[in]f_infunction (1:npoints_in))
[in]x_incoordinates of in points (1:npoints_in, 1:ndim)
[in]x_outcoordinates of out points (1:npoints_out, 1:ndim)
[out]f_out(1:npoints_out)

Definition at line 707 of file mesh_function.F90.

◆ dmf_interpolate_on_plane()

subroutine mesh_function_oct_m::dmf_interpolate_on_plane ( class(mesh_t), intent(in)  mesh,
type(mesh_plane_t), intent(in)  plane,
real(real64), dimension(:), intent(in), target  ff,
real(real64), dimension(plane%nu:plane%mu, plane%nv:plane%mv), intent(out)  f_in_plane 
)
private

Given a function ff defined on mesh, and a plane, it gives back the values of ff on the plane, by doing the appropriate interpolation.

Parameters
[in]meshunderlying mesh
[in]planeplane to interpolate onto
[in]fffunction defined on mesh

Definition at line 762 of file mesh_function.F90.

◆ dmf_interpolate_on_line()

subroutine mesh_function_oct_m::dmf_interpolate_on_line ( class(mesh_t), intent(in)  mesh,
type(mesh_line_t), intent(in)  line,
real(real64), dimension(:), intent(in), target  ff,
real(real64), dimension(line%nu:line%mu), intent(out)  f_in_line 
)
private

Given a function ff defined on mesh, and a line, it gives back the values of ff on the line, by doing the appropriate interpolation.

Parameters
[in]meshunderlying mesh
[in]lineline to interpolate onto
[in]fffunction defined on mesh

Definition at line 818 of file mesh_function.F90.

◆ dmf_surface_integral_scalar()

real(real64) function mesh_function_oct_m::dmf_surface_integral_scalar ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in)  ff,
type(mesh_plane_t), intent(in)  plane 
)
private

This subroutine calculates the surface integral of a scalar function on a given plane.

Parameters
[in]meshunderlying mesh
[in]fffunction to integrate; dimensions (1:mesh%np)
[in]planeplane for surface integration

Definition at line 866 of file mesh_function.F90.

◆ dmf_surface_integral_vector()

real(real64) function mesh_function_oct_m::dmf_surface_integral_vector ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:, :), intent(in)  ff,
type(mesh_plane_t), intent(in)  plane 
)
private

This subroutine calculates the surface integral of a vector function on a given plane.

Parameters
[in]meshunderlying mesh
[in]fffunction to integrate; dimensions (mesh%np, mesh%box%dim)
[in]planeplane for surface integration

Definition at line 895 of file mesh_function.F90.

◆ dmf_line_integral_scalar()

real(real64) function mesh_function_oct_m::dmf_line_integral_scalar ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in)  ff,
type(mesh_line_t), intent(in)  line 
)
private

This subroutine calculates the line integral of a scalar function on a given line.

Parameters
[in]meshunderlying mesh
[in]fffunction defined on mesh; dimensions (1:mesh%np)
[in]lineline to integrate along

Definition at line 925 of file mesh_function.F90.

◆ dmf_line_integral_vector()

real(real64) function mesh_function_oct_m::dmf_line_integral_vector ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:, :), intent(in)  ff,
type(mesh_line_t), intent(in)  line 
)
private

This subroutine calculates the line integral of a vector function on a given line.

Parameters
[in]meshunderlying mesh
[in]fffunction defined on mesh; dimensions (mesh%np, mesh%box%dim)
[in]lineline to integrate along

Definition at line 954 of file mesh_function.F90.

◆ dmf_multipoles()

subroutine, public mesh_function_oct_m::dmf_multipoles ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in)  ff,
integer, intent(in)  lmax,
real(real64), dimension(:), intent(out)  multipole,
logical, dimension(:), intent(in), optional  mask 
)

This routine calculates the multipoles of a function ff.

defined in the following way:

  • multipole(1) is the trace of ff (defined to be positive; integral of ff).
  • multipole(2:4) contains the dipole: integral of ff times x, y or z.
  • multipole(5:9, is) contains the quadrupole, defined in the usual way using the spherical harmonics: multipole(5) = \( \int [ {\rm ff} * Y_{2,-2} ] \),
  • multipole(6, is) = \( \int [ {\rm ff} * Y_{2, -1} ] \).

And so on.

Parameters
[in]meshunderlying mesh
[in]fffunction to integrate
[in]lmaxmaximum angular momentum
[out]multipole((lmax + 1)**2)
[in]mask(1:mesh%np)

Definition at line 991 of file mesh_function.F90.

◆ dmf_dipole()

subroutine, public mesh_function_oct_m::dmf_dipole ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in)  ff,
real(real64), dimension(:), intent(out)  dipole,
logical, dimension(:), intent(in), optional  mask 
)

This routine calculates the dipole of a function ff, for arbitrary dimensions.

Parameters
[in]meshunderlying mesh
[in]ff(1:mesh%np)
[out]dipole(1:mesh%box%dim)
[in]mask(1:mesh%np)

Definition at line 1044 of file mesh_function.F90.

◆ dmf_dotp_aux()

real(real64) function, public mesh_function_oct_m::dmf_dotp_aux ( real(real64), dimension(:), intent(in)  f1,
real(real64), dimension(:), intent(in)  f2 
)

dot product between two vectors (mesh functions)

This function returns the dot product between two vectors, but using the mesh_aux defined as a global object in this module. This way it can be called by external libraries, passing only the two vectors. First, one has to make sure that mesh_aux is pointing to some defined mesh data structure, by calling mesh_init_mesh_aux.

Definition at line 1082 of file mesh_function.F90.

◆ dmf_dotu_aux()

real(real64) function, public mesh_function_oct_m::dmf_dotu_aux ( real(real64), dimension(:), intent(in)  f1,
real(real64), dimension(:), intent(in)  f2 
)

dot product between two vectors (mesh functions) without conjugation

This function returns the dot product between two vectors, but using the mesh_aux defined as a global object in this module. This way it can be called by external libraries, passing only the two vectors. First, one has to make sure that mesh_aux is pointing to some defined mesh data structure, by calling mesh_init_mesh_aux.

Definition at line 1102 of file mesh_function.F90.

◆ dmf_nrm2_aux()

real(real64) function, public mesh_function_oct_m::dmf_nrm2_aux ( real(real64), dimension(:), intent(in)  ff)

calculate norm2 of a vector (mesh function)

This uses the mesh_aux defined as a global object in this module. This way it can be called by external libraries, passing only the two vectors. First, one has to make sure that mesh_aux is pointing to some defined mesh data structure, by calling mesh_init_mesh_aux.

Definition at line 1122 of file mesh_function.F90.

◆ zmf_integrate()

complex(real64) function, public mesh_function_oct_m::zmf_integrate ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(in)  ff,
logical, dimension(:), intent(in), optional  mask,
logical, intent(in), optional  reduce 
)

Integrate a function on the mesh.

\[ d = \sum_i^N f_i dV_i \]

where \( f_i \) is the discrete function, \(dV_i\) is the volume element, and \( N \) is the number of mesh points.

Parameters
[in]ffFunction to integrate with dimensions (1:mesh%np)
[in]maskDefine which grid points to integrate over
[in]reducePerform reduction over all grid domains

Definition at line 1215 of file mesh_function.F90.

◆ zmf_normalize()

subroutine, public mesh_function_oct_m::zmf_normalize ( class(mesh_t), intent(in)  mesh,
integer, intent(in)  dim,
complex(real64), dimension(:,:), intent(inout), contiguous  psi,
real(real64), intent(out), optional  norm 
)

Normalize a mesh function psi.

Parameters
[in]meshunderlying mesh
[in]dimspinor dimension of the function
[in,out]psimesh function psi(mesh%np, dim)
[out]normoptional output of the norm

Definition at line 1264 of file mesh_function.F90.

◆ zmf_dotp_1()

complex(real64) function mesh_function_oct_m::zmf_dotp_1 ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(in)  f1,
complex(real64), dimension(:), intent(in)  f2,
logical, intent(in), optional  reduce,
logical, intent(in), optional  dotu,
integer, intent(in), optional  np 
)
private

this function returns the dot product between two mesh functions

Parameters
[in]meshunderlying mesh
[in]f2mesh functions
[in]reduceif true, perform mpi reduction
[in]dotuif true, use blas_dotu instead of blas_dot; no complex conjugation. Default is false. This has no effect if working with real version

Definition at line 1294 of file mesh_function.F90.

◆ zmf_dotp_2()

complex(real64) function mesh_function_oct_m::zmf_dotp_2 ( class(mesh_t), intent(in)  mesh,
integer, intent(in)  dim,
complex(real64), dimension(:,:), intent(in)  f1,
complex(real64), dimension(:,:), intent(in)  f2,
logical, intent(in), optional  reduce,
logical, intent(in), optional  dotu,
integer, intent(in), optional  np 
)
private

dot product for vector valued mesh functions

Parameters
[in]meshunderlying mesh
[in]dimdimensions
[in]f2mesh functions of dimension (1:mesh%np, 1:dim)
[in]reduceif true, perform mpi reduction
[in]dotuif true, use lalg_dotu instead of lalg_dot; no complex conjugation. Default is false.
[in]npoptional number of points over which the integral is performed

Definition at line 1376 of file mesh_function.F90.

◆ zmf_nrm2_1()

real(real64) function mesh_function_oct_m::zmf_nrm2_1 ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(in)  ff,
logical, intent(in), optional  reduce 
)
private

this function returns the norm of a mesh function

Parameters
[in]meshunderlying mesh
[in]ffmesh function
[in]reduceif true, perform mpi reduction

Definition at line 1408 of file mesh_function.F90.

◆ zmf_nrm2_2()

real(real64) function mesh_function_oct_m::zmf_nrm2_2 ( class(mesh_t), intent(in)  mesh,
integer, intent(in)  dim,
complex(real64), dimension(:,:), intent(in)  ff,
logical, intent(in), optional  reduce 
)
private

this function returns the norm of a vector of mesh functions

Parameters
[in]meshunderlying mesh
[in]dimdimensions
[in]ffmesh function of dimension (1:mesh%np, 1:dim)
[in]reduceif true, perform mpi reduction

Definition at line 1445 of file mesh_function.F90.

◆ zmf_moment()

complex(real64) function, public mesh_function_oct_m::zmf_moment ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(in)  ff,
integer, intent(in)  idir,
integer, intent(in)  order 
)

This function calculates the "order" moment of the function ff.

moment = \( \int ff({\bf x}) {\bf x}_{\rm idir}^{\rm order} \)

Parameters
[in]meshunderlying mesh
[in]ffmesh function
[in]idirCartesian direction
[in]orderorder of the moment

Definition at line 1471 of file mesh_function.F90.

◆ zmf_random()

subroutine, public mesh_function_oct_m::zmf_random ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(out), contiguous  ff,
integer(int64), intent(in), optional  pre_shift,
integer(int64), intent(in), optional  post_shift,
integer(int64), intent(in), optional  seed,
logical, intent(in), optional  normalized 
)

This subroutine fills a function with random values.

Parameters
[in]normalizedwhether generate states should have norm 1, true by default

Definition at line 1500 of file mesh_function.F90.

◆ zmf_interpolate_points()

subroutine, public mesh_function_oct_m::zmf_interpolate_points ( integer, intent(in)  ndim,
integer, intent(in)  npoints_in,
real(real64), dimension(:, :), intent(in)  x_in,
complex(real64), dimension(:), intent(in)  f_in,
integer, intent(in)  npoints_out,
real(real64), dimension(:,:), intent(in)  x_out,
complex(real64), dimension(:), intent(out)  f_out 
)

This function receives a function f_in defined in a mesh, and returns the interpolated values of the function over the npoints_in defined by x_in.

Parameters
[in]f_infunction (1:npoints_in))
[in]x_incoordinates of in points (1:npoints_in, 1:ndim)
[in]x_outcoordinates of out points (1:npoints_out, 1:ndim)
[out]f_out(1:npoints_out)

Definition at line 1555 of file mesh_function.F90.

◆ zmf_interpolate_on_plane()

subroutine mesh_function_oct_m::zmf_interpolate_on_plane ( class(mesh_t), intent(in)  mesh,
type(mesh_plane_t), intent(in)  plane,
complex(real64), dimension(:), intent(in), target  ff,
complex(real64), dimension(plane%nu:plane%mu, plane%nv:plane%mv), intent(out)  f_in_plane 
)
private

Given a function ff defined on mesh, and a plane, it gives back the values of ff on the plane, by doing the appropriate interpolation.

Parameters
[in]meshunderlying mesh
[in]planeplane to interpolate onto
[in]fffunction defined on mesh

Definition at line 1603 of file mesh_function.F90.

◆ zmf_interpolate_on_line()

subroutine mesh_function_oct_m::zmf_interpolate_on_line ( class(mesh_t), intent(in)  mesh,
type(mesh_line_t), intent(in)  line,
complex(real64), dimension(:), intent(in), target  ff,
complex(real64), dimension(line%nu:line%mu), intent(out)  f_in_line 
)
private

Given a function ff defined on mesh, and a line, it gives back the values of ff on the line, by doing the appropriate interpolation.

Parameters
[in]meshunderlying mesh
[in]lineline to interpolate onto
[in]fffunction defined on mesh

Definition at line 1659 of file mesh_function.F90.

◆ zmf_surface_integral_scalar()

complex(real64) function mesh_function_oct_m::zmf_surface_integral_scalar ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(in)  ff,
type(mesh_plane_t), intent(in)  plane 
)
private

This subroutine calculates the surface integral of a scalar function on a given plane.

Parameters
[in]meshunderlying mesh
[in]fffunction to integrate; dimensions (1:mesh%np)
[in]planeplane for surface integration

Definition at line 1707 of file mesh_function.F90.

◆ zmf_surface_integral_vector()

complex(real64) function mesh_function_oct_m::zmf_surface_integral_vector ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:, :), intent(in)  ff,
type(mesh_plane_t), intent(in)  plane 
)
private

This subroutine calculates the surface integral of a vector function on a given plane.

Parameters
[in]meshunderlying mesh
[in]fffunction to integrate; dimensions (mesh%np, mesh%box%dim)
[in]planeplane for surface integration

Definition at line 1736 of file mesh_function.F90.

◆ zmf_line_integral_scalar()

complex(real64) function mesh_function_oct_m::zmf_line_integral_scalar ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(in)  ff,
type(mesh_line_t), intent(in)  line 
)
private

This subroutine calculates the line integral of a scalar function on a given line.

Parameters
[in]meshunderlying mesh
[in]fffunction defined on mesh; dimensions (1:mesh%np)
[in]lineline to integrate along

Definition at line 1766 of file mesh_function.F90.

◆ zmf_line_integral_vector()

complex(real64) function mesh_function_oct_m::zmf_line_integral_vector ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:, :), intent(in)  ff,
type(mesh_line_t), intent(in)  line 
)
private

This subroutine calculates the line integral of a vector function on a given line.

Parameters
[in]meshunderlying mesh
[in]fffunction defined on mesh; dimensions (mesh%np, mesh%box%dim)
[in]lineline to integrate along

Definition at line 1795 of file mesh_function.F90.

◆ zmf_multipoles()

subroutine, public mesh_function_oct_m::zmf_multipoles ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(in)  ff,
integer, intent(in)  lmax,
complex(real64), dimension(:), intent(out)  multipole,
logical, dimension(:), intent(in), optional  mask 
)

This routine calculates the multipoles of a function ff.

defined in the following way:

  • multipole(1) is the trace of ff (defined to be positive; integral of ff).
  • multipole(2:4) contains the dipole: integral of ff times x, y or z.
  • multipole(5:9, is) contains the quadrupole, defined in the usual way using the spherical harmonics: multipole(5) = \( \int [ {\rm ff} * Y_{2,-2} ] \),
  • multipole(6, is) = \( \int [ {\rm ff} * Y_{2, -1} ] \).

And so on.

Parameters
[in]meshunderlying mesh
[in]fffunction to integrate
[in]lmaxmaximum angular momentum
[out]multipole((lmax + 1)**2)
[in]mask(1:mesh%np)

Definition at line 1832 of file mesh_function.F90.

◆ zmf_dipole()

subroutine, public mesh_function_oct_m::zmf_dipole ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(in)  ff,
complex(real64), dimension(:), intent(out)  dipole,
logical, dimension(:), intent(in), optional  mask 
)

This routine calculates the dipole of a function ff, for arbitrary dimensions.

Parameters
[in]meshunderlying mesh
[in]ff(1:mesh%np)
[out]dipole(1:mesh%box%dim)
[in]mask(1:mesh%np)

Definition at line 1885 of file mesh_function.F90.

◆ zmf_dotp_aux()

complex(real64) function, public mesh_function_oct_m::zmf_dotp_aux ( complex(real64), dimension(:), intent(in)  f1,
complex(real64), dimension(:), intent(in)  f2 
)

dot product between two vectors (mesh functions)

This function returns the dot product between two vectors, but using the mesh_aux defined as a global object in this module. This way it can be called by external libraries, passing only the two vectors. First, one has to make sure that mesh_aux is pointing to some defined mesh data structure, by calling mesh_init_mesh_aux.

Definition at line 1923 of file mesh_function.F90.

◆ zmf_dotu_aux()

complex(real64) function, public mesh_function_oct_m::zmf_dotu_aux ( complex(real64), dimension(:), intent(in)  f1,
complex(real64), dimension(:), intent(in)  f2 
)

dot product between two vectors (mesh functions) without conjugation

This function returns the dot product between two vectors, but using the mesh_aux defined as a global object in this module. This way it can be called by external libraries, passing only the two vectors. First, one has to make sure that mesh_aux is pointing to some defined mesh data structure, by calling mesh_init_mesh_aux.

Definition at line 1943 of file mesh_function.F90.

◆ zmf_nrm2_aux()

real(real64) function, public mesh_function_oct_m::zmf_nrm2_aux ( complex(real64), dimension(:), intent(in)  ff)

calculate norm2 of a vector (mesh function)

This uses the mesh_aux defined as a global object in this module. This way it can be called by external libraries, passing only the two vectors. First, one has to make sure that mesh_aux is pointing to some defined mesh data structure, by calling mesh_init_mesh_aux.

Definition at line 1963 of file mesh_function.F90.

Variable Documentation

◆ sp_parallel

logical, public mesh_function_oct_m::sp_parallel

Definition at line 170 of file mesh_function.F90.

◆ sp_np

integer, public mesh_function_oct_m::sp_np

Definition at line 171 of file mesh_function.F90.

◆ sp_dim

integer, public mesh_function_oct_m::sp_dim

Definition at line 171 of file mesh_function.F90.

◆ sp_st1

integer, public mesh_function_oct_m::sp_st1

Definition at line 171 of file mesh_function.F90.

◆ sp_st2

integer, public mesh_function_oct_m::sp_st2

Definition at line 171 of file mesh_function.F90.

◆ sp_kp1

integer, public mesh_function_oct_m::sp_kp1

Definition at line 171 of file mesh_function.F90.

◆ sp_kp2

integer, public mesh_function_oct_m::sp_kp2

Definition at line 171 of file mesh_function.F90.

◆ sp_distdot_mode

integer, public mesh_function_oct_m::sp_distdot_mode

Definition at line 172 of file mesh_function.F90.

◆ sp_grp

type(mpi_grp_t), public mesh_function_oct_m::sp_grp

Definition at line 173 of file mesh_function.F90.

◆ mesh_aux

class(mesh_t), pointer, public mesh_function_oct_m::mesh_aux => null()

Globally-scoped pointer to the mesh instance.

Definition at line 202 of file mesh_function.F90.