SlowDown Algorithmic Regularization (SDAR)
Algorithmic Regularization with slowdown method for integrating few-body motions
force.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
Common/Float.h
"
4
5
namespace
AR
{
6
8
10
struct
Force
{
11
public
:
12
Float
acc_in
[3];
13
Float
acc_pert
[3];
14
Float
pot_in
;
15
Float
pot_pert
;
16
#ifdef AR_TTL
17
Float
gtgrad[3];
18
20
22
Force
():
acc_in
{
Float
(0.0),
Float
(0.0),
Float
(0.0)},
23
acc_pert
{
Float
(0.0),
Float
(0.0),
Float
(0.0)},
24
pot_in
(0.0),
pot_pert
(0.0),
25
gtgrad{
Float
(0.0),
Float
(0.0),
Float
(0.0)} {}
26
#else
27
30
Force
():
acc_in
{
Float
(0.0),
Float
(0.0),
Float
(0.0)},
31
acc_pert
{
Float
(0.0),
Float
(0.0),
Float
(0.0)},
32
pot_in
(0.0),
pot_pert
(0.0) {}
33
#endif
34
36
38
void
writeBinary
(FILE *_fout) {
39
fwrite(
this
,
sizeof
(*
this
),1,_fout);
40
}
41
43
45
void
readBinary
(FILE *_fin) {
46
size_t
rcount = fread(
this
,
sizeof
(*
this
), 1, _fin);
47
if
(rcount<1) {
48
std::cerr<<
"Error: Data reading fails! requiring data number is 1, only obtain "
<<rcount<<
".\n"
;
49
abort();
50
}
51
}
52
54
void
clear
() {
55
acc_in
[0] =
acc_in
[1] =
acc_in
[2] = 0.0;
56
acc_pert
[0] =
acc_pert
[1] =
acc_pert
[2] = 0.0;
57
pot_in
=
pot_pert
= 0.0;
58
#ifdef AR_TTL
59
gtgrad[0] = gtgrad[1] = gtgrad[2] = 0.0;
60
#endif
61
}
62
};
63
64
65
}
Float.h
AR
Algorithmic regularization (time transformed explicit symplectic integrator) namespace.
Definition:
force.h:5
AR::Force::readBinary
void readBinary(FILE *_fin)
read class data with BINARY format
Definition:
force.h:45
AR::Force::writeBinary
void writeBinary(FILE *_fout)
write class data with BINARY format
Definition:
force.h:38
AR::Force::clear
void clear()
clear
Definition:
force.h:54
AR::Force
force class of one particle
Definition:
force.h:10
AR::Force::acc_in
Float acc_in[3]
total acceleration from all inner particle members of the group
Definition:
force.h:12
Float
double Float
Definition:
Float.h:25
AR::Force::acc_pert
Float acc_pert[3]
perturbation from outside of the group
Definition:
force.h:13
AR::Force::Force
Force()
initialization
Definition:
force.h:30
AR::Force::pot_pert
Float pot_pert
perturbation potential
Definition:
force.h:15
AR::Force::pot_in
Float pot_in
inner potential
Definition:
force.h:14
src
AR
force.h
Generated by
1.8.17