Quantum 3xplorer (Q3)
Loading...
Searching...
No Matches
null.hpp
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* NullDispersionCalculator — the "no dispersion correction" scheme.
5
*
6
* Null Object implementation of DispersionCalculator: contributes exactly
7
* zero energy, zero forces, and zero stress. Selected by
8
* create_dispersion_calculator("none", ...) so that orchestrators (SCF
9
* energy hookup, force and stress assembly) can call the dispersion
10
* interface unconditionally instead of branching on the scheme name.
11
*/
12
13
#include <string>
14
#include <vector>
15
16
#include "
layer_0_core/types/init.hpp
"
17
#include "
layer_1_structure/crystal/crystal.hpp
"
18
#include "
layer_4_computation/effective_potential/internal/dispersion/init.hpp
"
19
20
namespace
q3
{
21
22
class
NullDispersionCalculator
:
public
DispersionCalculator
{
23
public
:
24
explicit
NullDispersionCalculator
(
const
Crystal
& crystal_structure)
25
: number_of_atoms_(crystal_structure.number_of_atoms()) {}
26
27
[[nodiscard]]
Real
compute_energy
()
const override
{
28
return
0.0;
29
}
30
31
[[nodiscard]]
DispersionGradients
compute_gradients
()
const override
{
32
return
{std::vector<Vector3D>(
static_cast<
std::size_t
>
(number_of_atoms_), {0.0, 0.0, 0.0}),
33
Matrix3x3
{}};
34
}
35
36
[[nodiscard]] std::string
name
()
const override
{
37
return
"none"
;
38
}
39
40
private
:
41
int
number_of_atoms_;
42
};
43
44
}
// namespace q3
q3::Crystal
Definition
crystal.hpp:30
q3::DispersionCalculator
Definition
init.hpp:37
q3::NullDispersionCalculator
Definition
null.hpp:22
q3::NullDispersionCalculator::NullDispersionCalculator
NullDispersionCalculator(const Crystal &crystal_structure)
Definition
null.hpp:24
q3::NullDispersionCalculator::name
std::string name() const override
Definition
null.hpp:36
q3::NullDispersionCalculator::compute_gradients
DispersionGradients compute_gradients() const override
Analytical energy gradients (forces and stress) – see DispersionGradients.
Definition
null.hpp:31
q3::NullDispersionCalculator::compute_energy
Real compute_energy() const override
Total dispersion energy correction, in Rydberg.
Definition
null.hpp:27
crystal.hpp
init.hpp
init.hpp
q3
Definition
q3_core_api.hpp:33
q3::Real
double Real
Definition
type_aliases.hpp:20
q3::DispersionGradients
Definition
init.hpp:32
q3::Matrix3x3
3×3 matrix stored row-major: row i = mat[i]
Definition
matrix_3x3.hpp:15
src
layer_4_computation
effective_potential
internal
dispersion
null.hpp
Generated by
1.9.8