#include "mdapi/mdtypes.h"
#include "mgrid/lattice.h"
Go to the source code of this file.
Classes | |
struct | MgridCell_tag |
(For internal use only.) More... | |
struct | MgridParam_tag |
Helper class to configure Mgrid_tag class. More... | |
struct | MgridSystem_tag |
Helper class to provide and return results from Mgrid_tag class. More... | |
struct | Mgrid_tag |
Multilevel summation (a.k.a. multiple grid) solver. More... | |
Typedefs | |
typedef MgridCell_tag | MgridCell |
(For internal use only.) | |
typedef MgridParam_tag | MgridParam |
Helper class to configure Mgrid_tag class. | |
typedef MgridSystem_tag | MgridSystem |
Helper class to provide and return results from Mgrid_tag class. | |
typedef Mgrid_tag | Mgrid |
Multilevel summation (a.k.a. multiple grid) solver. | |
Enumerations | |
enum | { MGRID_FAIL = -1 } |
enum | MgridBoundary_tag { MGRID_BOUNDARY_BEGIN = 0, MGRID_PERIODIC, MGRID_NONPERIODIC, MGRID_BOUNDARY_END } |
Boundary conditions. More... | |
enum | MgridApprox_tag { MGRID_APPROX_BEGIN = 0, MGRID_CUBIC, MGRID_BSPLINE, MGRID_QUINTIC1, MGRID_QUINTIC2, MGRID_HEPTIC1, MGRID_HEPTIC3, MGRID_NONIC1, MGRID_NONIC4, MGRID_HERMITE, MGRID_APPROX_END } |
Approximation. More... | |
enum | MgridSplit_tag { MGRID_SPLIT_BEGIN = 0, MGRID_TAYLOR1, MGRID_TAYLOR2, MGRID_TAYLOR3, MGRID_TAYLOR4, MGRID_TAYLOR5, MGRID_TAYLOR6, MGRID_TAYLOR7, MGRID_TAYLOR8, MGRID_ERRMIN3, MGRID_EXSELF1, MGRID_EXSELF2, MGRID_EXSELF3, MGRID_EXSELF7, MGRID_ODDPR1, MGRID_ODDPR2, MGRID_ODDPR3, MGRID_ODDPR4, MGRID_ODDPR5, MGRID_ODDPR6, MGRID_ODDPR7, MGRID_ODDPR8, MGRID_SPLIT_END } |
Splitting. More... | |
Functions | |
int | mgrid_param_config (MgridParam *p) |
Chooses suitable MgridParam_tag parameters. | |
int | mgrid_string_to_boundary (const char *) |
Convert string to boundary option. | |
const char * | mgrid_boundary_to_string (int) |
Convert boundary option to string. | |
int | mgrid_string_to_approx (const char *) |
Convert string to approximation option. | |
const char * | mgrid_approx_to_string (int) |
Convert approximation option to string. | |
int | mgrid_string_to_split (const char *) |
Convert string to splitting option. | |
const char * | mgrid_split_to_string (int) |
Convert splitting option to string. | |
int | mgrid_init (Mgrid *) |
Constructor. | |
int | mgrid_setup (Mgrid *, const MgridSystem *s, const MgridParam *p) |
Setup the Mgrid_tag object. | |
int | mgrid_force (Mgrid *, MgridSystem *s) |
Compute electrostatic forces and potential energy. | |
void | mgrid_done (Mgrid *) |
Destructor. | |
int | mgrid_system_validate (const Mgrid *, const MgridSystem *s) |
Validate atomic positions. | |
int | mgrid_exact_smooth (Mgrid *, MgridSystem *s) |
Compute exact smoothed part. | |
int | mgrid_short_setup (Mgrid *) |
int | mgrid_ncubic_setup (Mgrid *, const MgridSystem *) |
int | mgrid_pcubic_setup (Mgrid *, const MgridSystem *) |
int | mgrid_nbspline_setup (Mgrid *, const MgridSystem *) |
int | mgrid_pbspline_setup (Mgrid *, const MgridSystem *) |
int | mgrid_nquintic1_setup (Mgrid *, const MgridSystem *) |
int | mgrid_pquintic1_setup (Mgrid *, const MgridSystem *) |
int | mgrid_nquintic2_setup (Mgrid *, const MgridSystem *) |
int | mgrid_pquintic2_setup (Mgrid *, const MgridSystem *) |
int | mgrid_nheptic1_setup (Mgrid *, const MgridSystem *) |
int | mgrid_pheptic1_setup (Mgrid *, const MgridSystem *) |
int | mgrid_nheptic3_setup (Mgrid *, const MgridSystem *) |
int | mgrid_pheptic3_setup (Mgrid *, const MgridSystem *) |
int | mgrid_nnonic1_setup (Mgrid *, const MgridSystem *) |
int | mgrid_pnonic1_setup (Mgrid *, const MgridSystem *) |
int | mgrid_nnonic4_setup (Mgrid *, const MgridSystem *) |
int | mgrid_pnonic4_setup (Mgrid *, const MgridSystem *) |
int | mgrid_nhermite_setup (Mgrid *, const MgridSystem *) |
int | mgrid_phermite_setup (Mgrid *, const MgridSystem *) |
int | mgrid_setup_longrange (Mgrid *, const MgridSystem *) |
Mgrid_tag
class provides a fast method for computing electrostatics. This multilevel summation method produces smooth potential energy and continuous forces for both nonperiodic and periodic boundary conditions. The approximation utilizes a repeated smooth splitting of the interaction potential into a short-range part evaluated directly and a slowly varying long-range part which is interpolated to a lattice. Repeated use of this idea gives rise to a hierarchical method for which, under reasonable assumptions, the computational cost is linear in the number of atoms.The original paper detailing this method for nonperiodic systems is
Caveats:
MgridParam_tag
for recommended parameter selection.
|
Multilevel summation (a.k.a. multiple grid) solver. Members should be treated as private. |
|
Helper class to configure
User sets the internal fields of this class in order to configure the parameters needed by The recommended parameters depend on the accuracy desired:
|
|
Helper class to provide and return results from
User sets the internal fields of this class in order to provide data to
Input:
Optional input:
Output: |
|
|
|
Approximation.
Set
|
|
Boundary conditions.
Set |
|
Splitting.
Set
|
|
Convert approximation option to string.
Provide diagnostic information by converting
|
|
Convert boundary option to string.
Provide diagnostic information by converting
|
|
Destructor.
Frees memory allocations made internally during |
|
Compute exact smoothed part.
|
|
Compute electrostatic forces and potential energy.
MgridSystem_tag object s must provide the atomic positions (wrapped into the cubic domain) and the (possibly weighted) charges. The updated force array(s) and potential energy values are returned. It is intended that this routine may be called successively during a simulation with updated positions provided.
|
|
Constructor.
Initializes a
|
|
Chooses suitable
MgridParam_tag::length must also be set.The method of filling in the remaining parameters differs depending on the selected boundary conditions.
For periodic boundaries, the number of spacings
For nonperiodic boundaries, any of
|
|
Setup the
The only thing needed from
The
|
|
Convert splitting option to string.
Provide diagnostic information by converting
|
|
Convert string to approximation option.
Assist in configuring
|
|
Convert string to boundary option.
Assist in configuring
|
|
Convert string to splitting option.
Assist in configuring
|
|
Validate atomic positions.
Mgrid_tag has been setup by mgrid_setup() , this routine verifies that all positions are within the cubic domain.
|