CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
cbl::data::VectorField3D Class Reference

The class VectorField3D. More...

#include "Headers/Field3D.h"

Inheritance diagram for cbl::data::VectorField3D:
Collaboration diagram for cbl::data::VectorField3D:

Public Member Functions

Constructors/destructors
 VectorField3D ()=default
 default constructor
 
 VectorField3D (const double deltaR, const double minX, const double maxX, const double minY, const double maxY, const double minZ, const double maxZ)
 constructor More...
 
 VectorField3D (const int nx, const int ny, const int nz, const double minX, const double maxX, const double minY, const double maxY, const double minZ, const double maxZ)
 constructor More...
 
 ~VectorField3D ()=default
 default destructor
 
Member functions to set the private/protected members
void set_VectorField (const std::vector< double > value, const int i, const int j, const int k, const bool add=0)
 set the value of the vectorr field More...
 
void set_VectorField_FourierSpace_real (const std::vector< double > value, const int i, const int j, const int k, const bool add=0)
 set the value of the vector field, Fourier space, real part More...
 
void set_VectorField_FourierSpace_complex (const std::vector< double > value, const int i, const int j, const int k, const bool add=0)
 set the value of the vector field, Fourier space, complex part More...
 
Member functions to get the private/protected members
std::vector< double > VectorField (const int i, const int j, const int k) const
 get the value of the vector field More...
 
std::vector< double > VectorField (const std::vector< double > pos) const
 get the value of the vector field More...
 
std::vector< double > VectorField_FourierSpace_real (const int i, const int j, const int k) const
 get the value of the vector field, Fourier space, real part More...
 
std::vector< double > VectorField_FourierSpace_complex (const int i, const int j, const int k) const
 get the value of the vector field, Fourier space, complex part More...
 
Member functions to compute operations on the field
void FourierTransformField ()
 perform the anti-Fourier transform on the field
 
void FourierAntiTransformField ()
 perform the anti-Fourier transform on the field
 
void reset ()
 set to 0 the fields
 
- Public Member Functions inherited from cbl::data::Field3D
 Field3D ()=default
 default constructor
 
 Field3D (const double deltaR, const double minX, const double maxX, const double minY, const double maxY, const double minZ, const double maxZ)
 constructor More...
 
 Field3D (const int nx, const int ny, const int nz, const double minX, const double maxX, const double minY, const double maxY, const double minZ, const double maxZ)
 constructor More...
 
virtual ~Field3D ()=default
 default destructor
 
void set_parameters (const double deltaR, const double minX, const double maxX, const double minY, const double maxY, const double minZ, const double maxZ)
 set the parameters More...
 
void set_parameters (const int nx, const int ny, const int nz, const double minX, const double maxX, const double minY, const double maxY, const double minZ, const double maxZ)
 set the parameters More...
 
int nx () const
 get the private member m_nX More...
 
int ny () const
 get the private member m_nY More...
 
int nz () const
 get the private member m_nZ More...
 
int nzFourier () const
 get the private member m_nZF More...
 
int nCells () const
 get the private member m_nCells More...
 
int nCellsFourier () const
 get the private member m_nCells_Fourier More...
 
double MinX () const
 get the private member m_MinX More...
 
double MinY () const
 get the private member m_MinY More...
 
double MinZ () const
 get the private member m_MinZ More...
 
double MaxX () const
 get the private member m_MaxX More...
 
double MaxY () const
 get the private member m_MaxY More...
 
double MaxZ () const
 get the private member m_MaxZ More...
 
double deltaX () const
 get the private member m_deltaX More...
 
double deltaY () const
 get the private member m_deltaY More...
 
double deltaZ () const
 get the private member m_deltaZ More...
 
double Volume () const
 get the private member m_Volume More...
 
double XX (const int i) const
 get the value of the X coordinates at the i-th cell More...
 
double YY (const int i) const
 get the value of the Y coordinates at the i-th cell More...
 
double ZZ (const int i) const
 get the value of the Z coordinates at the i-th cell More...
 
double kX (const int i) const
 get the value of the X coordinates at the i-th cell, Fourier space More...
 
double kY (const int i) const
 get the value of the Y coordinates at the i-th cell, Fourier space More...
 
double kZ (const int i) const
 get the value of the Z coordinates at the i-th cell, Fourier space More...
 
virtual double ScalarField (const int i, const int j, const int k) const
 get the value of the scalar field More...
 
virtual double ScalarField (const std::vector< double > pos) const
 get the value of the scalar field More...
 
virtual std::vector< double > ScalarField () const
 get the value of the scalar field More...
 
virtual double ScalarField_FourierSpace_real (const int i, const int j, const int k) const
 get the value of the scalar field, Fourier space, real part More...
 
virtual double ScalarField_FourierSpace_complex (const int i, const int j, const int k) const
 get the value of the scalar field, Fourier space, complex part More...
 
virtual std::vector< double > ScalarField_FourierSpace_real () const
 get the value of the scalar field, Fourier space, real part More...
 
virtual std::vector< double > ScalarField_FourierSpace_complex () const
 get the value of the scalar field, Fourier space, complex part More...
 
virtual void GaussianConvolutionField (const double kernel_size)
 perform a smoothing of the field with a gaussian kernel More...
 
virtual void set_ScalarField (const double value, const int i, const int j, const int k, const bool add=0)
 set the value of the scalar field More...
 
virtual void set_ScalarField_FourierSpace_real (const double value, const int i, const int j, const int k, const bool add=0)
 set the value of the scalar field in Fourier space, real part More...
 
virtual void set_ScalarField_FourierSpace_complex (const double value, const int i, const int j, const int k, const bool add=0)
 set the value of the scalar field in Fourier space, complex part More...
 

Protected Attributes

std::vector< double * > m_field
 vector field
 
std::vector< fftw_complex * > m_field_FourierSpace
 vector field in fourier space
 
- Protected Attributes inherited from cbl::data::Field3D
int m_nX
 number of cells along the x-axis
 
int m_nY
 number of cells along the y-axis
 
int m_nZ
 number of cells along the z-axis
 
int m_nZF
 number of cells along the z-axis, Fourier space
 
int m_nCells
 number of cells
 
int m_nCells_Fourier
 number of cells, Fourier space
 
double m_deltaX
 X cell size.
 
double m_deltaY
 Y cell size.
 
double m_deltaZ
 Z cell size.
 
double m_MinX
 lower x bound
 
double m_MinY
 lower y bound
 
double m_MinZ
 lower z bound
 
double m_MaxX
 upper x bound
 
double m_MaxY
 upper y bound
 
double m_MaxZ
 upper z bound
 
double m_Volume
 box volume
 
std::vector< double > m_X
 coordinates of the cells along the x-axis
 
std::vector< double > m_Y
 coordinates of the cells along the y-axis
 
std::vector< double > m_Z
 coordinates of the cells along the z-axis
 
std::vector< double > m_kX
 coordinates of the cells along the kx-axis
 
std::vector< double > m_kY
 coordinates of the cells along the ky-axis
 
std::vector< double > m_kZ
 coordinates of the cells along the kz-axis
 

Additional Inherited Members

- Protected Member Functions inherited from cbl::data::Field3D
long int inds_to_index (const int i, const int j, const int k) const
 contract 3 indeces into one More...
 
long int inds_to_index_Fourier (const int i, const int j, const int k) const
 contract 3 indeces into one, Fourier space More...
 

Detailed Description

The class VectorField3D.

This class is used to handle objects of type VectorField3D

Definition at line 871 of file Field3D.h.

Constructor & Destructor Documentation

◆ VectorField3D() [1/2]

cbl::data::VectorField3D::VectorField3D ( const double  deltaR,
const double  minX,
const double  maxX,
const double  minY,
const double  maxY,
const double  minZ,
const double  maxZ 
)

constructor

Parameters
deltaRsize of the cubic cells
minXlower x bound
maxXupper x bound
minYlower y bound
maxYupper y bound
minZlower z bound
maxZupper z bound

Definition at line 380 of file Field3D.cpp.

◆ VectorField3D() [2/2]

cbl::data::VectorField3D::VectorField3D ( const int  nx,
const int  ny,
const int  nz,
const double  minX,
const double  maxX,
const double  minY,
const double  maxY,
const double  minZ,
const double  maxZ 
)

constructor

Parameters
nxnumber of x-axis cells
nynumber of y-axis cells
nznumber of z-axis cells
minXlower x bound
maxXupper x bound
minYlower y bound
maxYupper y bound
minZlower z bound
maxZupper z bound

Definition at line 414 of file Field3D.cpp.

Member Function Documentation

◆ set_VectorField()

void cbl::data::VectorField3D::set_VectorField ( const std::vector< double >  value,
const int  i,
const int  j,
const int  k,
const bool  add = 0 
)
virtual

set the value of the vectorr field

Parameters
valuevector containing values of the vector field
ithe i-th cell along the x-axis
jthe j-th cell along the y-axis
kthe k-th cell along the z-axis
add1 → add to the current value; 0 → overwrite the value

Reimplemented from cbl::data::Field3D.

Definition at line 518 of file Field3D.cpp.

◆ set_VectorField_FourierSpace_complex()

void cbl::data::VectorField3D::set_VectorField_FourierSpace_complex ( const std::vector< double >  value,
const int  i,
const int  j,
const int  k,
const bool  add = 0 
)
virtual

set the value of the vector field, Fourier space, complex part

Parameters
valuevector containing values of the vector field, Fourier space, complex part
ithe i-th cell along the x-axis
jthe j-th cell along the y-axis
kthe k-th cell along the z-axis
add1 → add to the current value; 0 → overwrite the value

Reimplemented from cbl::data::Field3D.

Definition at line 540 of file Field3D.cpp.

◆ set_VectorField_FourierSpace_real()

void cbl::data::VectorField3D::set_VectorField_FourierSpace_real ( const std::vector< double >  value,
const int  i,
const int  j,
const int  k,
const bool  add = 0 
)
virtual

set the value of the vector field, Fourier space, real part

Parameters
valuevector containing values of the vector field, Fourier space, real part
ithe i-th cell along the x-axis
jthe j-th cell along the y-axis
kthe k-th cell along the z-axis
add1 → add to the current value; 0 → overwrite the value

Reimplemented from cbl::data::Field3D.

Definition at line 529 of file Field3D.cpp.

◆ VectorField() [1/2]

vector< double > cbl::data::VectorField3D::VectorField ( const int  i,
const int  j,
const int  k 
) const
virtual

get the value of the vector field

Parameters
ithe i-th cell along the x-axis
jthe j-th cell along the y-axis
kthe k-th cell along the z-axis
Returns
vector containing the value of the vector field

Reimplemented from cbl::data::Field3D.

Definition at line 551 of file Field3D.cpp.

◆ VectorField() [2/2]

std::vector< double > cbl::data::VectorField3D::VectorField ( const std::vector< double >  pos) const
virtual

get the value of the vector field

Parameters
posvector containing the point coordinates
Returns
vector containing the value of the vector field

Reimplemented from cbl::data::Field3D.

Definition at line 578 of file Field3D.cpp.

◆ VectorField_FourierSpace_complex()

vector< double > cbl::data::VectorField3D::VectorField_FourierSpace_complex ( const int  i,
const int  j,
const int  k 
) const
virtual

get the value of the vector field, Fourier space, complex part

Parameters
ithe i-th cell along the x-axis
jthe j-th cell along the y-axis
kthe k-th cell along the z-axis
Returns
vector containing the value of the vector field, Fourier space, complex part

Reimplemented from cbl::data::Field3D.

Definition at line 569 of file Field3D.cpp.

◆ VectorField_FourierSpace_real()

vector< double > cbl::data::VectorField3D::VectorField_FourierSpace_real ( const int  i,
const int  j,
const int  k 
) const
virtual

get the value of the vector field, Fourier space, real part

Parameters
ithe i-th cell along the x-axis
jthe j-th cell along the y-axis
kthe k-th cell along the z-axis
Returns
vector containing the value of the vector field, Fourier space, real part

Reimplemented from cbl::data::Field3D.

Definition at line 560 of file Field3D.cpp.


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