28 char tslice_check_einstein_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Time_slice/tslice_check_einstein.C,v 1.10 2014/10/13 08:53:47 j_novak Exp $" ;
75 #include "time_slice.h"
80 ostream& ost,
bool verb)
const {
83 bool vacuum = ( energy_density == 0x0 ) ;
93 matter =
new Scalar (0*field) ;
95 matter = energy_density ;
97 if (verb) ost << endl ;
98 const char* comment = 0x0 ;
99 if (verb) comment =
"Check of the Hamiltonian constraint" ;
100 Tbl resu =
maxabs(field - (4*qpig) * (*matter), comment, ost,verb ) ;
101 if (verb) ost << endl ;
103 if (vacuum)
delete matter ;
110 ostream& ost,
bool verb)
const {
113 bool vacuum = ( momentum_density == 0x0 ) ;
120 matter =
new Vector (0*field) ;
123 matter = momentum_density ;
126 if (verb) ost << endl ;
127 const char* comment = 0x0 ;
128 if (verb) comment =
"Check of the momentum constraint" ;
129 Tbl resu =
maxabs(field - (2*qpig) * (*matter), comment, ost, verb ) ;
131 if (verb) ost << endl ;
133 if (vacuum)
delete matter ;
140 const Scalar* energy_density,
141 ostream& ost,
bool verb)
const {
145 bool vacuum = ( ( strain_tensor == 0x0 ) && ( energy_density == 0x0 ) ) ;
157 const Scalar* ener = 0x0 ;
161 if (energy_density == 0x0) {
166 ener = energy_density ;
167 if (strain_tensor == 0x0) {
172 sij = strain_tensor ;
176 if (new_e)
delete ener ;
177 if (new_s)
delete sij ;
181 + qpig * (*matter))) ;
188 if (verb) ost << endl ;
189 const char* comment = 0x0 ;
190 if (verb) comment =
"Check of the dynamical equations" ;
191 Tbl resu_tmp =
maxabs(dyn_lhs - dyn_rhs, comment, ost, verb) ;
193 if (verb) ost << endl ;
195 if (vacuum)
delete matter ;
201 for (
int i=1; i<=3; i++) {
202 for (
int j=1; j<=i; j++) {
207 assert (dyn_rhs.
position(idx) == pos) ;
209 for (
int lz=0; lz<resu_tmp.
get_dim(0); lz++)
210 resu.
set(i,j,lz) = resu_tmp(pos, lz) ;
Basic integer array class.
int & set(int i)
Read/write of a particular element (index i ) (1D case)
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
const Sym_tensor & ricci() const
Returns the Ricci tensor (given by the Connection p_connect )
virtual const Scalar & ricci_scal() const
Returns the Ricci scalar.
int get_nzone() const
Returns the number of domains.
Tensor field of valence 0 (or component of a tensorial field).
const Vector & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of *this with respect to some metric , by raising the index of...
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values of the Scalar in the co...
Class intended to describe valence-2 symmetric tensors.
Sym_tensor derive_lie(const Vector &v) const
Computes the Lie derivative of this with respect to some vector field v.
const Vector & divergence(const Metric &) const
Returns the divergence of this with respect to a Metric .
void annule_hard()
Sets the Tbl to zero in a hard way.
double & set(int i)
Read/write of a particular element (index i) (1D case)
int get_dim(int i) const
Gives the i-th dimension (ie dim.dim[i])
virtual const Sym_tensor & k_dd() const
Extrinsic curvature tensor (covariant components ) at the current time step (jtime )
int jtime
Time step index of the latest slice.
Evolution_std< Sym_tensor > k_dd_evol
Values at successive time steps of the covariant components of the extrinsic curvature tensor .
virtual const Scalar & trk() const
Trace K of the extrinsic curvature at the current time step (jtime )
virtual const Scalar & nn() const
Lapse function N at the current time step (jtime )
Tbl check_hamiltonian_constraint(const Scalar *energy_density=0x0, ostream &ost=cout, bool verb=true) const
Checks the level at which the hamiltonian constraint is verified.
int scheme_order
Order of the finite-differences scheme for the computation of time derivatives.
virtual const Vector & beta() const
shift vector at the current time step (jtime )
const Metric & gam() const
Induced metric at the current time step (jtime )
virtual const Sym_tensor & k_uu() const
Extrinsic curvature tensor (contravariant components ) at the current time step (jtime )
Tbl check_dynamical_equations(const Sym_tensor *strain_tensor=0x0, const Scalar *energy_density=0x0, ostream &ost=cout, bool verb=true) const
Checks the level at which the dynamical equations are verified.
Tbl check_momentum_constraint(const Vector *momentum_density=0x0, ostream &ost=cout, bool verb=true) const
Checks the level at which the momentum constraints are verified.
Tensor field of valence 1.
const Map & get_mp() const
Returns the mapping.
int get_index_type(int i) const
Gives the type (covariant or contravariant) of the index number i .
Tensor up_down(const Metric &gam) const
Computes a new tensor by raising or lowering all the indices of *this .
const Tensor & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
virtual int position(const Itbl &ind) const
Returns the position in the array cmp of a component given by its indices.
Tensor trace(int ind1, int ind2) const
Trace on two different type indices.
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Tbl maxabs(const Tensor &aa, const char *comment=0x0, ostream &ost=cout, bool verb=true)
Maxima in each domain of the absolute values of the tensor components.
Standard units of space, time and mass.