130 met_div(source.met_div) {
143 const Metric& met, FILE* fd)
246 if (dynamic_cast<const Map_af*>(
mp) != 0x0) {
259 *
this = htt + 0.5 * ( *
this - tmp ) ;
293 assert((dzp == 0) || (dzp == 4)) ;
298 if (dynamic_cast<const Map_af*>(
mp) != 0x0) {
319 double precis,
int it_max) {
324 assert (ptmp != 0x0) ;
325 assert (ptmp !=
this) ;
329 assert( (precis > 0.) && (it_max > 0) ) ;
342 for (
int it=0; it<=it_max; it++) {
346 htrace = hij(1,1) * hij(2,3) * hij(2,3)
347 + hij(2,2) * hij(1,3) * hij(1,3) + hij(3,3) * hij(1,2) * hij(1,2)
348 - 2.* hij(1,2) * hij(1,3) * hij(2,3)
349 - hij(1,1) * hij(2,2) * hij(3,3) ;
353 htrace += hij(1,2) * hij(1,2) + hij(1,3) * hij(1,3)
354 + hij(2,3) * hij(2,3) - hij(1,1) * hij(2,2)
355 - hij(1,1) * hij(3,3) - hij(2,2) * hij(3,3) ;
362 double diff =
max(
max(
abs(htrace - htrace_prev))) ;
364 cout <<
"Sym_tensor_trans::trace_from_det_one : " 365 <<
"iteration : " << it <<
" convergence on trace(h): " << diff << endl ;
367 if (diff < precis) break ;
368 else htrace_prev = htrace ;
371 cout <<
"Sym_tensor_trans::trace_from_det_one : convergence not reached \n" ;
372 cout <<
" for the required accuracy (" << precis <<
") ! " << endl ;
Metric for tensor calculation.
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
const Metric *const met_div
Metric with respect to which the divergence and the trace are defined.
Tensor field of valence 0 (or component of a tensorial field).
Scalar poisson() const
Solves the scalar Poisson equation with *this as a source.
Base class for coordinate mappings.
int get_n_comp() const
Returns the number of stored components.
const Tensor_sym & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
const Base_vect * triad
Vectorial basis (triad) with respect to which the tensor components are defined.
Scalar * p_trace
Trace with respect to the metric *met_div.
void set_tt_trace(const Sym_tensor_tt &a, const Scalar &h, Param *par=0x0)
Assigns the derived members p_tt and p_trace and updates the components accordingly.
virtual void operator=(const Sym_tensor &a)
Assignment to another Sym_tensor.
const Vector & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of *this with respect to some metric , by raising the index of...
Vectorial bases (triads) with respect to which the tensorial components are defined.
virtual void operator=(const Sym_tensor_trans &a)
Assignment to another Sym_tensor_trans.
Scalar trace() const
Trace on two different type indices for a valence 2 tensor.
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values in the compactified ext...
virtual void del_deriv() const
Deletes the derived quantities.
Sym_tensor_tt * p_tt
Traceless part with respect to the metric *met_div.
void set_der_0x0() const
Sets the pointers on derived quantities to 0x0.
Itbl type_indice
1D array of integers (class Itbl ) of size valence containing the type of each index: COV for a cova...
virtual void del_deriv() const
Deletes the derived quantities.
int get_dzpuis() const
Returns dzpuis.
Scalar ** cmp
Array of size n_comp of pointers onto the components.
const Sym_tensor_tt & tt_part(Param *par=0x0) const
Returns the transverse traceless part of the tensor, the trace being defined with respect to metric *...
virtual ~Sym_tensor_trans()
Destructor.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
const Metric & get_met_div() const
Returns the metric with respect to which the divergence and the trace are defined.
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...
Transverse symmetric tensors of rank 2.
virtual void inc_dzpuis(int inc=1)
Increases by inc units the value of dzpuis and changes accordingly the values in the compactified ext...
Cmp abs(const Cmp &)
Absolute value.
Sym_tensor_trans(const Map &map, const Base_vect &triad_i, const Metric &met)
Standard constructor.
Symmetric tensors (with respect to two of their arguments).
bool check_dzpuis(int dzi) const
Returns false if the last domain is compactified and *this is not zero in this domain and dzpuis is n...
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
const Scalar & the_trace() const
Returns the trace of the tensor with respect to metric *met_div.
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.
Transverse and traceless symmetric tensors of rank 2.