21 #include "system_of_eqs.hpp"
23 #include "metric_nophi.hpp"
24 #include "term_eq.hpp"
26 #include "tensor_impl.hpp"
27 #include "name_tools.hpp"
28 #include "metric_tensor.hpp"
34 cerr <<
"Metric_flat_nophi only defined wrt spherical tensorial basis for now..." << endl ;
42 Metric_flat_nophi::~Metric_flat_nophi() {
56 for (
int i=1 ; i<=3 ; i++)
57 for (
int j=i ; j<=3 ; j++)
76 for (
int i=1 ; i<=3 ; i++)
77 for (
int j=i ; j<=3 ; j++)
88 cerr <<
"Computation of Christo not explicit for Metric_flat_nophi" << endl ;
94 so.
set_val_t()->set_index_type (ind) *= -1 ;
96 so.
set_der_t()->set_index_type (ind) *= -1 ;
113 for (
int i=1 ; i<val_res ; i++)
116 if (auxi.
der_t!=0x0) {
119 for (
int i=1 ; i<val_res ; i++)
128 bool need_sum = false ;
130 for (
int i=1 ; i<val_res ; i++)
156 cerr <<
"Metric_flat_nophi::derive partial only defined for tensor data" << endl ;
161 case SPHERICAL_BASIS :
164 cerr <<
"Unknown tensorial basis in Metric_flat_nophi::derive_partial" << endl ;
185 for (
int i=1 ; i<val_res ; i++)
188 if (auxi.
der_t!=0x0) {
191 for (
int i=1 ; i<val_res ; i++)
201 bool need_sum = false ;
203 for (
int i=1 ; i<val_res ; i++)
208 return (part_der + auxi) ;
211 if (auxi.
der_t==0x0) {
232 cerr <<
"Metric_flat_nophi::derive only defined for tensor data" << endl ;
237 case SPHERICAL_BASIS :
240 cerr <<
"Unknown tensorial basis in Metric_flat_nophi::derive" << endl ;
265 cerr <<
"Metric_flat_nophi::derive_with_other only defined for tensor data" << endl ;
270 case SPHERICAL_BASIS :
273 cerr <<
"Unknown tensorial basis in Metric_flat_nophi::derive_with_other" << endl ;
283 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 connection_spher(const Term_eq &so) const
Computes the part of the gradient involving the connections, in spherical orthonormal 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...
Class that deals with flat metric assuming a axisymmetric setting (nothing depends on ).
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...
const Base_tensor & basis
The tensorial basis used.
virtual void manipulate_ind(Term_eq &, int) const
Uses the Metric to manipulate one of the index of a Term_eq (i.e.
virtual Term_eq derive(int, char, const Term_eq &) const
Computes the covariant derivative of a Term_eq (assumes Cartesian basis of decomposition).
virtual void compute_con(int) const
Computes the contravariant representation, in a given Domain.
virtual void compute_christo(int) const
Computes the Christoffel symbols, in a given Domain.
Term_eq derive_spher(int tder, char indder, const Term_eq &so) const
Computes the flat covariant derivative, in orthonormal spherical coordinates.
virtual void update()
Updates the derived quantities (Christoffels etc..) This is done only for the ones that are needed,...
virtual void compute_cov(int) const
Computes the covariant representation, 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 Term_eq derive_partial(int, char, const Term_eq &) const
Computes the partial derivative of a Term_eq (assumes Cartesian basis of decomposition).
virtual int give_type(int) const
Returns the type of tensorial basis of the covariant representation, in a given Domain.
virtual void set_system(System_of_eqs &syst, const char *name)
Associate the metric to a given system of equations.
Term_eq derive_with_other(int tder, char indder, const Term_eq &so, const Metric *othermet) const
Computes the flat covariant derivative.
Metric_flat_nophi(const Space &sp, const Base_tensor &bb)
Standard constructor.
Particular type of Tensor, dedicated to the desription of metrics.
Purely abstract class for metric handling.
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.
const System_of_eqs * syst
Pointer of the system of equations where the metric is used (only one for now).
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
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_nbr_domains() const
Returns the number of Domains.
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.