ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
gint.h
Go to the documentation of this file.
1#ifndef ABACUS_SOURCE_HAMILT_MODULE_GINT_GINT_H
2#define ABACUS_SOURCE_HAMILT_MODULE_GINT_GINT_H
3
4#include "gint_info.h"
5#include "gint_type.h"
6#include <cassert>
7#include <memory>
8
9namespace ModuleGint
10{
11
12class Gint
13{
14 public:
15 Gint() = default;
16 virtual ~Gint() = default;
17
18 // note that gint_info_ is a static member variable
19 // it is shared by all instances of Gint
20 static void set_gint_info(GintInfo *gint_info) { gint_info_ = gint_info; }
21
22 static const GintInfo &get_gint_info()
23 {
24 // set_gint_info() must have been called by the owning ESolver before any
25 // grid integration runs; dereferencing a null gint_info_ here would be UB.
26 assert(gint_info_ != nullptr && "Gint::set_gint_info() has not been called");
27 return *gint_info_;
28 }
29
30 protected:
32};
33
34} // namespace ModuleGint
35
36#endif // ABACUS_SOURCE_HAMILT_MODULE_GINT_GINT_H
Definition gint_info.h:26
static void set_gint_info(GintInfo *gint_info)
Definition gint.h:20
virtual ~Gint()=default
static const GintInfo & get_gint_info()
Definition gint.h:22
static GintInfo * gint_info_
Definition gint.h:31
Definition batch_biggrid.cpp:4