21 #include "system_of_eqs.hpp"
24 #include "term_eq.hpp"
26 #include "tensor_impl.hpp"
27 #include "name_tools.hpp"
28 #include "metric_tensor.hpp"
78 cerr <<
"Computation of Christo not explicit for Metric_flat" << endl ;
86 case CARTESIAN_BASIS :
89 case SPHERICAL_BASIS :
93 for (
int i=1 ; i<=3 ; i++)
94 for (
int j=i ; j<=3 ; j++)
100 cerr <<
"Unknown tensorial basis in Metric_flat::compute_ricci_tensor" << endl ;
117 case CARTESIAN_BASIS :
120 case SPHERICAL_BASIS :
127 cerr <<
"Unknown tensorial basis in Metric_flat::compute_ricci_tensor" << endl ;
142 so.
set_val_t()->set_index_type (ind) *= -1 ;
144 so.
set_der_t()->set_index_type (ind) *= -1 ;
164 for (
int i=1 ; i<val_res ; i++)
167 if (auxi.
der_t!=0x0) {
170 for (
int i=1 ; i<val_res ; i++)
179 bool need_sum = false ;
181 for (
int i=1 ; i<val_res ; i++)
209 for (
int i=1 ; i<val_res ; i++)
212 if (auxi.
der_t!=0x0) {
215 for (
int i=1 ; i<val_res ; i++)
224 bool need_sum = false ;
226 for (
int i=1 ; i<val_res ; i++)
254 for (
int i=1 ; i<val_res ; i++)
257 if (auxi.
der_t!=0x0) {
260 for (
int i=1 ; i<val_res ; i++)
269 bool need_sum = false ;
271 for (
int i=1 ; i<val_res ; i++)
298 cerr <<
"Metric_flat::derive partial only defined for tensor data" << endl ;
303 case CARTESIAN_BASIS :
305 case SPHERICAL_BASIS :
310 cerr <<
"Unknown tensorial basis in Metric_flat::derive_partial" << endl ;
334 for (
int i=1 ; i<val_res ; i++)
337 if (auxi.
der_t!=0x0) {
340 for (
int i=1 ; i<val_res ; i++)
350 bool need_sum = false ;
352 for (
int i=1 ; i<val_res ; i++)
357 return (part_der + auxi) ;
360 if (auxi.
der_t==0x0) {
386 for (
int i=1 ; i<val_res ; i++)
389 if (auxi.
der_t!=0x0) {
392 for (
int i=1 ; i<val_res ; i++)
402 bool need_sum = false ;
404 for (
int i=1 ; i<val_res ; i++)
409 return (part_der + auxi) ;
412 if (auxi.
der_t==0x0) {
433 cerr <<
"Metric_flat::derive only defined for tensor data" << endl ;
438 case CARTESIAN_BASIS :
440 case SPHERICAL_BASIS :
445 cerr <<
"Unknown tensorial basis in Metric_flat::derive" << endl ;
481 cerr <<
"Metric_flat::derive_with_other only defined for tensor data" << endl ;
486 case CARTESIAN_BASIS :
488 case SPHERICAL_BASIS :
493 cerr <<
"Unknown tensorial basis in Metric_flat::derive_with_other" << endl ;
503 cerr <<
"Metric already set for the system" << endl ;
Describes the tensorial basis used by the various tensors.
int get_basis(int nd) const
Read only the basis in a given domain.
virtual Term_eq derive_flat_spher(int tipe, char ind, const Term_eq &so, const Metric *manip) const
Computes the flat derivative of a Term_eq, in spherical orthonormal coordinates.
virtual Term_eq partial_mtz(const Term_eq &so) const
Computes the part of the gradient containing the partial derivative of the field, in orthonormal coor...
virtual Term_eq partial_cart(const Term_eq &so) const
Computes the part of the gradient containing the partial derivative of the field, in Cartesian coordi...
virtual Term_eq connection_spher(const Term_eq &so) const
Computes the part of the gradient involving the connections, in spherical orthonormal coordinates.
Val_domain const & get_radius() const
Returns the generalized radius.
virtual Term_eq derive_flat_cart(int tipe, char ind, const Term_eq &so, const Metric *manip) const
Computes the flat derivative of a Term_eq, in Cartesian coordinates.
virtual Term_eq partial_spher(const Term_eq &so) const
Computes the part of the gradient containing the partial derivative of the field, in spherical orthon...
virtual Term_eq derive_flat_mtz(int tipe, char ind, const Term_eq &so, const Metric *manip) const
Computes the flat derivative of a Term_eq, in spherical coordinates where the constant radii sections...
virtual Term_eq connection_mtz(const Term_eq &so) const
Computes the part of the gradient involving the connections, in spherical coordinates where the const...
Class that deals with flat metric.
virtual void compute_cov(int) const
Computes the covariant representation, in a given Domain.
virtual Term_eq derive_partial(int, char, const Term_eq &) const
Computes the partial derivative of a Term_eq (assumes Cartesian basis of decomposition).
Term_eq derive_partial_cart(int tder, char indder, const Term_eq &so) const
Computes the partial derivative part of the covariant derivative, in Cartesian coordinates.
Term_eq derive_partial_spher(int tder, char indder, const Term_eq &so) const
Computes the partial derivative part of the covariant derivative, in orthonormal spherical coordinate...
Term_eq derive_spher(int tder, char indder, const Term_eq &so) const
Computes the flat covariant derivative, in orthonormal spherical coordinates.
Term_eq derive_with_other(int tder, char indder, const Term_eq &so, const Metric *othermet) const
Computes the flat covariant derivative.
Term_eq derive_mtz(int tder, char indder, const Term_eq &so) const
Computes the flat covariant derivative, in orthonormal coordinates where the constant radii sections ...
const Base_tensor & basis
The tensorial basis used.
virtual int give_type(int) const
Returns the type of tensorial basis of the covariant representation, in a given Domain.
virtual void compute_ricci_tensor(int) const
Computes the Ricci tensor, in a given Domain.
Term_eq derive_with_other_cart(int tder, char indder, const Term_eq &so, const Metric *othermet) const
Computes the flat covariant derivative, in Cartesian coordinates.
virtual void update()
Updates the derived quantities (Christoffels etc..) This is done only for the ones that are needed,...
Term_eq derive_partial_mtz(int tder, char indder, const Term_eq &so) const
Computes the partial derivative part of the covariant derivative, in orthonormal coordinates where th...
virtual void set_system(System_of_eqs &syst, const char *name)
Associate the metric to a given system of equations.
virtual void manipulate_ind(Term_eq &, int) const
Uses the Metric to manipulate one of the index of a Term_eq (i.e.
virtual void compute_christo(int) const
Computes the Christoffel symbols, in a given Domain.
virtual Term_eq derive(int, char, const Term_eq &) const
Computes the covariant derivative of a Term_eq (assumes Cartesian basis of decomposition).
Term_eq derive_with_other_mtz(int tder, char indder, const Term_eq &so, const Metric *othermet) const
Computes the flat covariant derivative, in orthonormal coordinates where the constant radii sections ...
Term_eq derive_cart(int tder, char indder, const Term_eq &so) const
Computes the flat covariant derivative, in Cartesian coordinates.
virtual void compute_ricci_scalar(int) const
Computes the Ricci scalar, in a given Domain.
Term_eq derive_with_other_spher(int tder, char indder, const Term_eq &so, const Metric *othermet) const
Computes the flat covariant derivative, in orthonormal spherical coordinates.
virtual void compute_con(int) const
Computes the contravariant representation, in a given Domain.
Particular type of Tensor, dedicated to the desription of metrics.
Purely abstract class for metric handling.
MMPtr_array< Term_eq > p_ricci_tensor
Array of pointers on various Term_eq.
const Space & espace
The associated Space.
MMPtr_array< Term_eq > p_met_cov
Array of pointers on various Term_eq.
MMPtr_array< Term_eq > p_met_con
Array of pointers on various Term_eq.
MMPtr_array< Term_eq > p_ricci_scalar
Array of pointers on various Term_eq.
const System_of_eqs * syst
Pointer of the system of equations where the metric is used (only one for now).
The class Scalar does not really implements scalars in the mathematical sense but rather tensorial co...
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
virtual void annule_hard()
Sets the value to zero everywhere in the collocation space (the logical state of the Val_domain is NO...
void std_base()
Sets the standard basis of decomposition.
The Space class is an ensemble of domains describing the whole space of the computation.
const Domain * get_domain(int i) const
returns a pointer on the domain.
int get_ndim() const
Returns the number of dimensions.
Class used to describe and solve a system of equations.
char * name_met
Name by which the metric is recognized.
Metric * met
Pointer on the associated Metric, if defined.
void set_name_ind(int dd, char name)
Sets the name of one index ; the names must have been affected first.
void set_name_affected()
Affects the name of the indices.
virtual void std_base()
Sets the standard spectal bases of decomposition for each component.
Scalar & set(const Array< int > &ind)
Returns the value of a component (read/write version).
char const * get_name_ind() const
int get_valence() const
Returns the valence.
bool is_name_affected() const
Check whether the names of the indices have been affected.
Tensor do_summation_one_dom(int dd) const
Does the inner contraction of the Tensor in a given domain.
const Space & get_space() const
Returns the Space.
This class is intended to describe the manage objects appearing in the equations.
Tensor * der_t
Pointer on the variation, if the Term_eq is a Tensor.
void set_der_t(Tensor)
Sets the tensorial variation (only the values in the pertinent Domain are copied).
int get_type_data() const
void set_val_t(Tensor)
Sets the tensorial value (only the values in the pertinent Domain are copied).
Tensor * val_t
Pointer on the value, if the Term_eq is a Tensor.