GQCP
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
GQCP::WeightedGrid Class Reference

#include <WeightedGrid.hpp>

Collaboration diagram for GQCP::WeightedGrid:
Collaboration graph

Public Member Functions

 WeightedGrid (const std::vector< Vector< double, 3 > > &points, const ArrayX< double > &weights)
 
template<typename T >
integrate (const Field< T > &field) const
 
size_t numberOfPoints () const
 
const Vector< double, 3 > & point (const size_t index) const
 
const std::vector< Vector< double, 3 > > & points () const
 
size_t size () const
 
double weight (const size_t index) const
 
const ArrayX< double > & weights () const
 

Static Public Member Functions

static WeightedGrid FromCubicGrid (const CubicGrid &cubic_grid)
 
static WeightedGrid ReadIntegrationGridFile (const std::string &filename)
 

Detailed Description

A collection of points in 3D-space, with each point associated to a weight.

Constructor & Destructor Documentation

◆ WeightedGrid()

GQCP::WeightedGrid::WeightedGrid ( const std::vector< Vector< double, 3 > > &  points,
const ArrayX< double > &  weights 
)

A memberwise constructor.

Parameters
pointsthe grid points
weightsa 1-D array containing the weights for each of the grid points

Member Function Documentation

◆ FromCubicGrid()

WeightedGrid GQCP::WeightedGrid::FromCubicGrid ( const CubicGrid cubic_grid)
static

Convert a cubic grid into a weighted grid, where the weights are all equal to the CubicGrid's voxel volume.

Parameters
cubic_gridthe cubic grid

◆ integrate()

template<typename T >
T GQCP::WeightedGrid::integrate ( const Field< T > &  field) const
inline

Integrate a Field over this grid.

Parameters
fieldthe field that should be integrated, i.e. provided as the integrand
Returns
the value of the integral

◆ numberOfPoints()

size_t GQCP::WeightedGrid::numberOfPoints ( ) const
inline
Returns
the number of grid points/weights

◆ point()

const Vector< double, 3 > & GQCP::WeightedGrid::point ( const size_t  index) const
inline

Access one of the grid's points.

Parameters
indexthe index of the grid point
Returns
a read-only grid point, corresponding to the given index

◆ points()

const std::vector< Vector< double, 3 > > & GQCP::WeightedGrid::points ( ) const
inline
Returns
the grid points

◆ ReadIntegrationGridFile()

WeightedGrid GQCP::WeightedGrid::ReadIntegrationGridFile ( const std::string &  filename)
static

Parse an .igrid-file and create the WeightedGrid that is contained in it. The values for the scalar field or vector field are discarded.

Parameters
filenamethe name of the .igrid-file
Note
An integration grid (.igrid) file is a headerless file and contains the following data:
  • Each row relates to one grid point.
  • Column specification:
    • Column 1: The index from 1 to the number of grid points
    • Columns 2-4: The position of the grid point: x, y, and z
    • Optional: Column 5 or columns 5-7: 1 value for a scalar field, 3 values for a vector field
    • Column 5, 6 or 8: The integration weight associated to the grid point

◆ size()

size_t GQCP::WeightedGrid::size ( ) const
inline
Returns
the size of the grid, i.e. the number of grid points/weights

◆ weight()

double GQCP::WeightedGrid::weight ( const size_t  index) const
inline

Access one of the grid's weights.

Parameters
indexthe index of the weight
Returns
a read-only grid weight, corresponding to the given index

◆ weights()

const ArrayX< double > & GQCP::WeightedGrid::weights ( ) const
inline
Returns
a 1-D array containing the weights for each of the grid points

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