Version: SMASH-3.1
fields.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2021-2022
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 #ifndef SRC_INCLUDE_SMASH_FIELDS_H_
10 #define SRC_INCLUDE_SMASH_FIELDS_H_
11 
12 #include <iostream>
13 #include <typeinfo>
14 #include <utility>
15 #include <vector>
16 
17 #include "density.h"
18 #include "experimentparameters.h"
19 #include "fourvector.h"
20 #include "potentials.h"
21 #include "threevector.h"
22 
23 namespace smash {
24 
33  public:
36  : A_mu_(FourVector()),
38 
42  FourVector A_mu() const { return A_mu_; }
43 
47  std::array<FourVector, 4> dAmu_dxnu() const { return dAmu_dxnu_; }
48 
53  ThreeVector dvecA_dt() { return dAmu_dxnu_[0].threevec(); }
54 
61  ThreeVector A_0_grad = ThreeVector();
62  for (int i = 1; i < 4; i++) {
63  A_0_grad[i - 1] = dAmu_dxnu_[i].x0();
64  }
65  return A_0_grad;
66  }
67 
74  ThreeVector curl_vec_A = ThreeVector();
75  curl_vec_A.set_x1(dAmu_dxnu_[2].x3() - dAmu_dxnu_[3].x2());
76  curl_vec_A.set_x2(dAmu_dxnu_[3].x1() - dAmu_dxnu_[1].x3());
77  curl_vec_A.set_x3(dAmu_dxnu_[1].x2() - dAmu_dxnu_[2].x1());
78  return curl_vec_A;
79  }
80 
86  void overwrite_A_mu(FourVector new_A_mu) { A_mu_ = new_A_mu; }
87 
92  FourVector tmp0(0.0, 0.0, 0.0, 0.0);
93 
94  dAmu_dxnu_[0] = tmp0;
95  }
96 
107  FourVector dAmu_dy, FourVector dAmu_dz) {
108  dAmu_dxnu_[0] = dAmu_dt;
109  dAmu_dxnu_[1] = dAmu_dx;
110  dAmu_dxnu_[2] = dAmu_dy;
111  dAmu_dxnu_[3] = dAmu_dz;
112  }
113 
114  private:
118  std::array<FourVector, 4> dAmu_dxnu_;
119 };
120 
123 
144  RectangularLattice<FourVector> *old_fields,
145  RectangularLattice<FourVector> *new_fields,
146  RectangularLattice<std::array<FourVector, 4>> *fields_four_grad_lattice,
147  DensityLattice *jmu_B_lat, const LatticeUpdate fields_lat_update,
148  const Potentials &potentials, const double time_step);
149 } // namespace smash
150 
151 #endif // SRC_INCLUDE_SMASH_FIELDS_H_
A class for calculating the fields A^mu associated with the VDF potentials.
Definition: fields.h:32
std::array< FourVector, 4 > dAmu_dxnu() const
Definition: fields.h:47
void overwrite_dAmu_dt_to_zero()
Overwrite the time derivative of A^mu to zero.
Definition: fields.h:91
ThreeVector dvecA_dt()
Definition: fields.h:53
FourVector A_mu_
Four-vector density of the field.
Definition: fields.h:116
FourVector A_mu() const
Definition: fields.h:42
std::array< FourVector, 4 > dAmu_dxnu_
Four-gradient of the four-vector density of the field.
Definition: fields.h:118
void overwrite_dAmu_dxnu(FourVector dAmu_dt, FourVector dAmu_dx, FourVector dAmu_dy, FourVector dAmu_dz)
Overwrite the four-gradient of A^mu on the local lattice, using the provided values of its components...
Definition: fields.h:106
ThreeVector grad_A0()
Compute the gradient of A^0 on the local lattice.
Definition: fields.h:60
void overwrite_A_mu(FourVector new_A_mu)
Overwrite the value of the field on the local lattice.
Definition: fields.h:86
FieldsOnLattice()
Default constructor.
Definition: fields.h:35
ThreeVector curl_vecA()
Compute the curl of the field on the local lattice.
Definition: fields.h:73
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
Definition: fourvector.h:33
A class that stores parameters of potentials, calculates potentials and their gradients.
Definition: potentials.h:36
A container class to hold all the arrays on the lattice and access them.
Definition: lattice.h:47
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
void set_x1(double x)
set first component
Definition: threevector.h:179
void set_x3(double z)
set third component
Definition: threevector.h:187
void set_x2(double y)
set second component
Definition: threevector.h:183
Definition: action.h:24
void update_fields_lattice(RectangularLattice< FieldsOnLattice > *fields_lat, RectangularLattice< FourVector > *old_fields, RectangularLattice< FourVector > *new_fields, RectangularLattice< std::array< FourVector, 4 >> *fields_four_grad_lattice, DensityLattice *jmu_B_lat, const LatticeUpdate fields_lat_update, const Potentials &potentials, const double time_step)
Updates the contents on the lattice of FieldsOnLattice type.
Definition: fields.cc:14
LatticeUpdate
Enumerator option for lattice updates.
Definition: lattice.h:36
RectangularLattice< FieldsOnLattice > FieldsLattice
Conveniency typedef for lattice of fields.
Definition: fields.h:122