28char tslice_dirac_max_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Time_slice/tslice_dirac_max.C,v 1.26 2014/10/13 08:53:48 j_novak Exp $" ;
135#include "time_slice.h"
136#include "utilitaires.h"
154 0*lapse_in, depth_in),
155 A_hh_evol(depth_in), B_hh_evol(depth_in), source_A_hh_evol(depth_in),
156 source_B_hh_evol(depth_in), source_A_hata_evol(depth_in) ,
157 source_B_hata_evol(depth_in), trh_evol(hh_in.the_trace(), depth_in)
166 A_hh_evol(depth_in), B_hh_evol(depth_in),
167 source_A_hh_evol(depth_in), source_B_hh_evol(depth_in),
168 source_A_hata_evol(depth_in), source_B_hata_evol(depth_in),
186 trh_evol.update(tmp,
jtime, time_init) ;
195 bool partial_read,
int depth_in)
197 A_hh_evol(depth_in), B_hh_evol(depth_in),
198 source_A_hh_evol(depth_in), source_B_hh_evol(depth_in),
199 source_A_hata_evol(depth_in), source_B_hata_evol(depth_in),
204 "Constructor of Tslice_dirac_max from file: the case of partial reading\n"
205 <<
" is not ready yet !"
217 for (
int j=jmin; j<=
jtime; j++) {
218 fread_be(&indicator,
sizeof(
int), 1, fich) ;
219 if (indicator == 1) {
226 for (
int j=jmin; j<=
jtime; j++) {
227 fread_be(&indicator,
sizeof(
int), 1, fich) ;
228 if (indicator == 1) {
235 for (
int j=jmin; j<=
jtime; j++) {
236 fread_be(&indicator,
sizeof(
int), 1, fich) ;
237 if (indicator == 1) {
248 :
Time_slice_conf(star.get_nn(), star.get_beta(), star.get_mp().flat_met_spher(),
249 0.*star.get_nn(), star.get_hh(), 0.*star.get_aa(),
250 0.*star.get_nn(), depth_in),
251 A_hh_evol(depth_in), B_hh_evol(depth_in),
252 source_A_hh_evol(depth_in), source_B_hh_evol(depth_in),
253 source_A_hata_evol(depth_in), source_B_hata_evol(depth_in),
275 for (
int j=1; j <
depth; j++) {
287 trh_evol.update(trh_evol[
jtime], jtime1, ttime1) ;
293 initialize_sources_copy() ;
301 A_hh_evol(tin.A_hh_evol),
302 B_hh_evol(tin.B_hh_evol),
303 source_A_hh_evol(tin.source_A_hh_evol),
304 source_B_hh_evol(tin.source_B_hh_evol),
305 source_A_hata_evol(tin.source_A_hata_evol),
306 source_B_hata_evol(tin.source_B_hata_evol),
307 trh_evol(tin.trh_evol) { }
331 trh_evol = tin.trh_evol ;
347 trh_evol.downdate(
jtime) ;
354 double pdt,
double precis,
int method_poisson_vect,
355 const char* graph_device,
const Scalar* p_ener_dens,
356 const Vector* p_mom_dens,
const Scalar* p_trace_stress) {
359 Time_slice_conf::initial_data_cts(uu, trk_in, trk_point, pdt, precis,
360 method_poisson_vect, graph_device,
361 p_ener_dens, p_mom_dens, p_trace_stress) ;
370 assert (tmp.
get_etat() != ETATNONDEF) ;
379 assert (tmp.
get_etat() != ETATNONDEF) ;
389 "Tslice_dirac_max::initial_data_cts : variation of A and tilde(B) for J = "
404 initialize_sources_copy() ;
425 Vector wzero(mp, CON, *(ff.get_triad())) ;
429 Sym_tensor hh_new(mp, CON, *(ff.get_triad())) ;
440 cout <<
"Tslice_dirac_max::set_trh : #### WARNING : \n"
441 <<
" this method does not check whether det(tilde gamma) = 1"
495 Scalar resu(ff.get_mp()) ;
549 if( !(trh_evol.is_known(
jtime)) ) {
556 return trh_evol[
jtime] ;
570 flux <<
"Dirac gauge and maximal slicing" <<
'\n' ;
578 if (trh_evol.is_known(
jtime)) {
591 "Tslice_dirac_max::sauve : the partial_save case is not ready yet !"
608 for (
int j=jmin; j<=
jtime; j++) {
609 int indicator = (
hh_evol.is_known(j)) ? 1 : 0 ;
610 fwrite_be(&indicator,
sizeof(
int), 1, fich) ;
611 if (indicator == 1)
hh_evol[j].sauve(fich) ;
616 for (
int j=jmin; j<=
jtime; j++) {
617 int indicator = (
A_hh_evol.is_known(j)) ? 1 : 0 ;
618 fwrite_be(&indicator,
sizeof(
int), 1, fich) ;
619 if (indicator == 1)
A_hh_evol[j].sauve(fich) ;
624 for (
int j=jmin; j<=
jtime; j++) {
625 int indicator = (
B_hh_evol.is_known(j)) ? 1 : 0 ;
626 fwrite_be(&indicator,
sizeof(
int), 1, fich) ;
627 if (indicator == 1)
B_hh_evol[j].sauve(fich) ;
Vectorial bases (triads) with respect to which the tensorial components are defined.
virtual void update(const TyT &new_value, int j, double time_j)
Sets a new value at a given time step.
Base class for coordinate mappings.
const Base_vect_spher & get_bvect_spher() const
Returns the orthonormal vectorial basis associated with the coordinates of the mapping.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
Flat metric for tensor calculation.
int get_nzone() const
Returns the number of domains.
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
Tensor field of valence 0 (or component of a tensorial field).
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
void set_dzpuis(int)
Modifies the dzpuis flag.
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 for relativistic rotating stars in Dirac gauge and maximal slicing.
const Sym_tensor get_aa() const
Returns .
const Scalar & get_ln_psi() const
Returns .
Transverse symmetric tensors of rank 2.
void trace_from_det_one(const Sym_tensor_tt &htt, double precis=1.e-14, int it_max=100)
Assigns the derived member p_tt and computes the trace so that *this + the flat metric has a determin...
const Scalar & the_trace() const
Returns the trace of the tensor with respect to metric *met_div.
Transverse and traceless symmetric tensors of rank 2.
void set_khi_mu(const Scalar &khi_i, const Scalar &mu_i, int dzp=0, Param *par1=0x0, Param *par2=0x0, Param *par3=0x0)
Sets the component , as well as the angular potential (see member p_khi and p_mu ).
Class intended to describe valence-2 symmetric tensors.
void set_longit_trans(const Vector &v, const Sym_tensor_trans &a)
Assigns the derived members p_longit_pot and p_transverse and updates the components accordingly.
Spacelike time slice of a 3+1 spacetime with conformal decomposition.
Evolution_std< Sym_tensor > hh_evol
Values at successive time steps of the components .
Evolution_std< Sym_tensor > hata_evol
Values at successive time steps of the components .
virtual const Scalar & A_hata() const
Returns the potential A of .
void operator=(const Time_slice_conf &)
Assignment to another Time_slice_conf.
virtual const Scalar & psi() const
Conformal factor relating the physical metric to the conformal one: .
Metric * p_tgamma
Pointer on the conformal metric at the current time step (jtime)
virtual const Scalar & B_hata() const
Returns the potential of .
virtual void del_deriv() const
Deletes all the derived quantities.
Vector * p_hdirac
Pointer on the vector (which vanishes in Dirac gauge), at the current time step (jtime).
const Scalar & psi4() const
Factor at the current time step (jtime ).
Evolution_std< Scalar > psi_evol
Values at successive time steps of the conformal factor relating the physical metric to the conform...
Evolution_std< Scalar > A_hata_evol
Potential A associated with the symmetric tensor .
Evolution_std< Scalar > B_hata_evol
Potential associated with the symmetric tensor .
virtual void set_hh(const Sym_tensor &hh_in)
Sets the deviation of the conformal metric from the flat metric : .
int jtime
Time step index of the latest slice.
Evolution_std< Scalar > trk_evol
Values at successive time steps of the trace K of the extrinsic curvature.
Metric * p_gamma
Pointer on the induced metric at the current time step (jtime)
Evolution_std< Sym_tensor > k_dd_evol
Values at successive time steps of the covariant components of the extrinsic curvature tensor .
virtual void sauve(FILE *fich, bool partial_save) const
Total or partial saves in a binary file.
Evolution_full< Tbl > adm_mass_evol
ADM mass at each time step, since the creation of the slice.
Evolution_std< Sym_tensor > gam_dd_evol
Values at successive time steps of the covariant components of the induced metric .
Evolution_std< Sym_tensor > gam_uu_evol
Values at successive time steps of the contravariant components of the induced metric .
int depth
Number of stored time slices.
Evolution_std< Scalar > n_evol
Values at successive time steps of the lapse function N.
Evolution_std< double > the_time
Time label of each slice.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator<<).
Evolution_std< Vector > beta_evol
Values at successive time steps of the shift vector .
Spacelike time slice of a 3+1 spacetime with conformal decomposition in the maximal slicing and Dirac...
virtual const Scalar & trh() const
Computes the trace h, with respect to the flat metric ff , of .
virtual const Sym_tensor & hh(Param *par_bc=0x0, Param *par_mat=0x0) const
Deviation of the conformal metric from the flat metric : .
Evolution_std< Scalar > source_B_hh_evol
The potential of the source of equation for .
Evolution_std< Scalar > source_A_hh_evol
The A potential of the source of equation for .
virtual const Scalar & B_hh() const
Returns the potential of .
virtual void initial_data_cts(const Sym_tensor &uu, const Scalar &trk_in, const Scalar &trk_point, double pdt, double precis=1.e-12, int method_poisson_vect=6, const char *graph_device=0x0, const Scalar *ener_dens=0x0, const Vector *mom_dens=0x0, const Scalar *trace_stress=0x0)
Computes valid initial data by solving the constraint equations in the conformal thin-sandwich approa...
Evolution_std< Scalar > A_hh_evol
The A potential of .
virtual ~Tslice_dirac_max()
Destructor.
virtual const Scalar & trk() const
Trace K of the extrinsic curvature at the current time step (jtime ).
void hh_det_one(int j, Param *par_bc=0x0, Param *par_mat=0x0) const
Computes from the values of A and and using the condition , which fixes the trace of .
Evolution_std< Scalar > source_B_hata_evol
The potential of the source of equation for .
virtual void set_hh(const Sym_tensor &hh_in)
Sets the deviation of the conformal metric from the flat metric : .
void compute_sources(const Sym_tensor *strain_tensor=0x0) const
Computes the sources source_A_XXX_evol and source_B_XXX_evol , for the solution of the evolution equa...
virtual void set_khi_mu(const Scalar &khi_in, const Scalar &mu_in)
Sets the potentials and of the TT part of (see the documentation of Sym_tensor_tt for details).
virtual void sauve(FILE *fich, bool partial_save) const
Total or partial saves in a binary file.
virtual void set_trh(const Scalar &trh_in)
Sets the trace, with respect to the flat metric ff , of .
virtual const Scalar & A_hh() const
Returns the potential A of .
virtual const Vector & hdirac() const
Vector which vanishes in Dirac gauge.
Tslice_dirac_max(const Scalar &lapse_in, const Vector &shift_in, const Metric_flat &ff_in, const Scalar &psi_in, const Sym_tensor_trans &hh_in, const Sym_tensor &hata_in, int depth_in=3)
Constructor from conformal decomposition.
Evolution_std< Scalar > B_hh_evol
The potential of .
Evolution_std< Scalar > source_A_hata_evol
The potential A of the source of equation for .
Tensor field of valence 1.
Cmp exp(const Cmp &)
Exponential.
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
const Map & get_mp() const
Returns the mapping.
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
virtual void set_etat_zero()
Sets the logical state of all components to ETATZERO (zero state).
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.