ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
meshgrid_info.h
Go to the documentation of this file.
1#ifndef ABACUS_SOURCE_HAMILT_MODULE_GINT_MESHGRID_INFO_H
2#define ABACUS_SOURCE_HAMILT_MODULE_GINT_MESHGRID_INFO_H
3
4#include "gint_type.h"
5
6namespace ModuleGint
7{
8
10{
11 public:
12 // constructor
13 MeshGridInfo(Vec3d meshgrid_vec1, Vec3d meshgrid_vec2, Vec3d meshgrid_vec3)
14 : meshgrid_vec1_(meshgrid_vec1), meshgrid_vec2_(meshgrid_vec2), meshgrid_vec3_(meshgrid_vec3)
15 {
16 // initialize the mgrid_latvec0_
20
24
28
29 // initialize the GT matrix
30 meshgrid_GT_ = mgrid_latvec0_.Inverse();
31
32 mgrid_vol_ = std::abs(mgrid_latvec0_.Det());
33 }
34
35 double get_volume() const { return mgrid_vol_; }
36 Vec3d get_cartesian_coord(const Vec3i &index_3d) const { return index_3d * mgrid_latvec0_; }
37 Vec3d get_direct_coord(const Vec3d &cart_coord) const { return cart_coord * meshgrid_GT_; }
38
39 private:
40 // basis vectors of meshgrid
44
45 // used to convert the (i, j, k) index of the meshgrid to the Cartesian coordinate
46 // if meshrid_vec1_ is row vector,
47 // then mgrid_latvec0_ = [meshgrid_vec1_; meshgrid_vec2_; meshgrid_vec3_],
48 // (i, j, k) * mgrid_latvec0_ = (x, y, z)
50
51 // used to convert the Cartesian coordinate to the (i, j, k) index of the mesh grid
52 // meshgrid_GT_ = mgrid_latvec0_.Inverse()
53 // (x, y, z) * meshgrid_GT_ = (i, j, k)
55
56 double mgrid_vol_;
57};
58
59} // namespace ModuleGint
60
61#endif // ABACUS_SOURCE_HAMILT_MODULE_GINT_MESHGRID_INFO_H
Matrix3 meshgrid_GT_
Definition meshgrid_info.h:54
Vec3d get_cartesian_coord(const Vec3i &index_3d) const
Definition meshgrid_info.h:36
Vec3d get_direct_coord(const Vec3d &cart_coord) const
Definition meshgrid_info.h:37
Vec3d meshgrid_vec2_
Definition meshgrid_info.h:42
Matrix3 mgrid_latvec0_
Definition meshgrid_info.h:49
Vec3d meshgrid_vec1_
Definition meshgrid_info.h:41
double mgrid_vol_
Definition meshgrid_info.h:56
MeshGridInfo(Vec3d meshgrid_vec1, Vec3d meshgrid_vec2, Vec3d meshgrid_vec3)
Definition meshgrid_info.h:13
double get_volume() const
Definition meshgrid_info.h:35
Vec3d meshgrid_vec3_
Definition meshgrid_info.h:43
Definition batch_biggrid.cpp:4
ModuleBase::Vector3< double > Vec3d
Definition gint_type.h:11
ModuleBase::Matrix3 Matrix3
Definition gint_type.h:10
ModuleBase::Vector3< int > Vec3i
Definition gint_type.h:12