connection.h
/*
* Definition of Lorene class Connection
*
*/
/*
* Copyright (c) 2003-2004 Eric Gourgoulhon & Jerome Novak
*
* This file is part of LORENE.
*
* LORENE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* LORENE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LORENE; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __CONNECTION_H_
#define __CONNECTION_H_
/*
* $Id: connection.h,v 1.14 2014/10/13 08:52:33 j_novak Exp $
* $Log: connection.h,v $
* Revision 1.14 2014/10/13 08:52:33 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.13 2004/03/22 13:12:40 j_novak
* Modification of comments to use doxygen instead of doc++
*
* Revision 1.12 2004/01/04 20:50:24 e_gourgoulhon
* Class Connection: data member delta is now of type Tensor_sym (and no
* longer of type Tensor_delta).
*
* Revision 1.11 2003/12/30 22:56:40 e_gourgoulhon
* Replaced member flat_conn (flat connection) by flat_met (flat metric)
* Added argument flat_met to the constructors of Connection.
* Suppressed method fait_ricci() (the computation of the Ricci is
* now devoted to the virtual method ricci()).
*
* Revision 1.10 2003/12/27 14:56:20 e_gourgoulhon
* -- Method derive_cov() suppressed.
* -- Change of the position of the derivation index from the first one
* to the last one in methods p_derive_cov() and p_divergence().
*
* Revision 1.9 2003/10/16 14:21:33 j_novak
* The calculation of the divergence of a Tensor is now possible.
*
* Revision 1.8 2003/10/06 13:58:45 j_novak
* The memory management has been improved.
* Implementation of the covariant derivative with respect to the exact Tensor
* type.
*
* Revision 1.7 2003/10/06 06:52:26 e_gourgoulhon
* Corrected documentation.
*
* Revision 1.6 2003/10/05 21:04:25 e_gourgoulhon
* Improved comments
*
* Revision 1.5 2003/10/03 14:07:23 e_gourgoulhon
* Added derived class Connection_fcart.
*
* Revision 1.4 2003/10/02 21:31:11 e_gourgoulhon
* Added methods fait_delta and update
* flat_conn is now a modifiable pointer.
*
* Revision 1.3 2003/10/02 15:44:23 j_novak
* The destructor is now public...
*
* Revision 1.2 2003/10/01 15:41:49 e_gourgoulhon
* Added mapping
*
* Revision 1.1 2003/09/29 21:14:10 e_gourgoulhon
* First version --- not ready yet.
*
*
*
* $Header: /cvsroot/Lorene/C++/Include/connection.h,v 1.14 2014/10/13 08:52:33 j_novak Exp $
*
*/
// Lorene headers
#include "tensor.h"
namespace Lorene {
class Metric ;
class Metric_flat ;
//--------------------------//
// class Connection //
//--------------------------//
class Connection {
// Data :
// -----
protected:
const Map* const mp ;
const Base_vect* const triad ;
Tensor_sym delta ;
bool assoc_metric ;
private:
const Metric_flat* flat_met ;
// Derived data :
// ------------
protected:
mutable Tensor* p_ricci ;
// Constructors - Destructor
// -------------------------
public:
Connection(const Tensor_sym& delta_i, const Metric_flat& flat_met_i) ;
Connection(const Metric& met, const Metric_flat& flat_met_i) ;
Connection(const Connection& ) ;
protected:
Connection(const Map&, const Base_vect& ) ;
public:
virtual ~Connection() ;
// Memory management
// -----------------
protected:
void del_deriv() const ;
void set_der_0x0() const ;
// Mutators / assignment
// ---------------------
public:
void operator=(const Connection&) ;
void update(const Tensor_sym& delta_i) ;
void update(const Metric& met) ;
// Accessors
// ---------
public:
const Map& get_mp() const {return *mp; } ;
const Tensor_sym& get_delta() const {return delta; } ;
// Computational methods
// ---------------------
public:
virtual Tensor* p_derive_cov(const Tensor& tens) const ;
virtual Tensor* p_divergence(const Tensor& tens) const ;
virtual const Tensor& ricci() const ;
private:
void fait_delta(const Metric& ) ;
};
//-------------------------------//
// class Connection_flat //
//-------------------------------//
class Connection_flat : public Connection {
// Constructors - Destructor
// -------------------------
protected:
Connection_flat(const Map&, const Base_vect&) ;
public:
Connection_flat(const Connection_flat & ) ;
virtual ~Connection_flat() ;
// Mutators / assignment
// ---------------------
public:
void operator=(const Connection_flat&) ;
// Computational methods
// ---------------------
public:
virtual Tensor* p_derive_cov(const Tensor& tens) const = 0 ;
virtual Tensor* p_divergence(const Tensor& tens) const = 0 ;
virtual const Tensor& ricci() const ;
};
//-------------------------------//
// class Connection_fspher //
//-------------------------------//
class Connection_fspher : public Connection_flat {
// Constructors - Destructor
// -------------------------
public:
Connection_fspher(const Map&, const Base_vect_spher&) ;
Connection_fspher(const Connection_fspher& ) ;
public:
virtual ~Connection_fspher() ;
// Mutators / assignment
// ---------------------
public:
void operator=(const Connection_fspher&) ;
// Computational methods
// ---------------------
public:
virtual Tensor* p_derive_cov(const Tensor& tens) const ;
virtual Tensor* p_divergence(const Tensor& tens) const ;
};
//-------------------------------//
// class Connection_fcart //
//-------------------------------//
class Connection_fcart : public Connection_flat {
// Constructors - Destructor
// -------------------------
public:
Connection_fcart(const Map&, const Base_vect_cart&) ;
Connection_fcart(const Connection_fcart& ) ;
public:
virtual ~Connection_fcart() ;
// Mutators / assignment
// ---------------------
public:
void operator=(const Connection_fcart&) ;
// Computational methods
// ---------------------
public:
virtual Tensor* p_derive_cov(const Tensor& tens) const ;
virtual Tensor* p_divergence(const Tensor& tens) const ;
};
}
#endif
Lorene::Base_vect_cart
Cartesian vectorial bases (triads).
Definition base_vect.h:201
Lorene::Base_vect_spher
Spherical orthonormal vectorial bases (triads).
Definition base_vect.h:308
Lorene::Base_vect
Vectorial bases (triads) with respect to which the tensorial components are defined.
Definition base_vect.h:105
Lorene::Connection_fcart::operator=
void operator=(const Connection_fcart &)
Assignment to another Connection_fcart.
Definition connection_fcart.C:136
Lorene::Connection_fcart::Connection_fcart
Connection_fcart(const Map &, const Base_vect_cart &)
Contructor from a Cartesian flat-metric-orthonormal basis.
Definition connection_fcart.C:109
Lorene::Connection_fcart::~Connection_fcart
virtual ~Connection_fcart()
destructor
Definition connection_fcart.C:126
Lorene::Connection_fcart::p_divergence
virtual Tensor * p_divergence(const Tensor &tens) const
Computes the divergence of a tensor (with respect to the current connection).
Definition connection_fcart.C:238
Lorene::Connection_fcart::p_derive_cov
virtual Tensor * p_derive_cov(const Tensor &tens) const
Computes the covariant derivative of a tensor (with respect to the current connection).
Definition connection_fcart.C:152
Lorene::Connection_flat::Connection_flat
Connection_flat(const Map &, const Base_vect &)
Contructor from a triad, has to be defined in the derived classes.
Definition connection_flat.C:77
Lorene::Connection_flat::ricci
virtual const Tensor & ricci() const
Computes (if not up to date) and returns the Ricci tensor associated with the current connection.
Definition connection_flat.C:121
Lorene::Connection_flat::p_derive_cov
virtual Tensor * p_derive_cov(const Tensor &tens) const =0
Computes the covariant derivative of a tensor (with respect to the current connection).
Lorene::Connection_flat::~Connection_flat
virtual ~Connection_flat()
destructor
Definition connection_flat.C:97
Lorene::Connection_flat::p_divergence
virtual Tensor * p_divergence(const Tensor &tens) const =0
Computes the divergence of a tensor (with respect to the current connection).
Lorene::Connection_flat::operator=
void operator=(const Connection_flat &)
Assignment to another Connection_flat.
Definition connection_flat.C:107
Lorene::Connection_fspher::Connection_fspher
Connection_fspher(const Map &, const Base_vect_spher &)
Contructor from a spherical flat-metric-orthonormal basis.
Definition connection_fspher.C:142
Lorene::Connection_fspher::operator=
void operator=(const Connection_fspher &)
Assignment to another Connection_fspher.
Definition connection_fspher.C:168
Lorene::Connection_fspher::p_divergence
virtual Tensor * p_divergence(const Tensor &tens) const
Computes the divergence of a tensor (with respect to the current connection).
Definition connection_fspher.C:431
Lorene::Connection_fspher::~Connection_fspher
virtual ~Connection_fspher()
destructor
Definition connection_fspher.C:158
Lorene::Connection_fspher::p_derive_cov
virtual Tensor * p_derive_cov(const Tensor &tens) const
Computes the covariant derivative of a tensor (with respect to the current connection).
Definition connection_fspher.C:183
Lorene::Connection::p_ricci
Tensor * p_ricci
Pointer of the Ricci tensor associated with the connection.
Definition connection.h:164
Lorene::Connection::assoc_metric
bool assoc_metric
Indicates whether the connection is associated with a metric (in which case the Ricci tensor is symme...
Definition connection.h:147
Lorene::Connection::flat_met
const Metric_flat * flat_met
Flat metric with respect to which (member delta ) is defined.
Definition connection.h:156
Lorene::Connection::get_delta
const Tensor_sym & get_delta() const
Returns the tensor which defines the connection with respect to the flat one: is the difference bet...
Definition connection.h:271
Lorene::Connection::operator=
void operator=(const Connection &)
Assignment to another Connection.
Definition connection.C:225
Lorene::Connection::set_der_0x0
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition connection.C:213
Lorene::Connection::~Connection
virtual ~Connection()
Destructor.
Definition connection.C:195
Lorene::Connection::Connection
Connection(const Tensor_sym &delta_i, const Metric_flat &flat_met_i)
Standard constructor ab initio.
Definition connection.C:129
Lorene::Connection::update
void update(const Tensor_sym &delta_i)
Update the connection when it is defined ab initio.
Definition connection.C:235
Lorene::Connection::triad
const Base_vect *const triad
Triad with respect to which the connection coefficients are defined.
Definition connection.h:124
Lorene::Connection::p_derive_cov
virtual Tensor * p_derive_cov(const Tensor &tens) const
Computes the covariant derivative of a tensor (with respect to the current connection).
Definition connection.C:307
Lorene::Connection::mp
const Map *const mp
Reference mapping.
Definition connection.h:119
Lorene::Connection::delta
Tensor_sym delta
Tensor which defines the connection with respect to the flat one: is the difference between the con...
Definition connection.h:141
Lorene::Connection::ricci
virtual const Tensor & ricci() const
Computes (if not up to date) and returns the Ricci tensor associated with the current connection.
Definition connection.C:662
Lorene::Connection::get_mp
const Map & get_mp() const
Returns the mapping.
Definition connection.h:253
Lorene::Connection::p_divergence
virtual Tensor * p_divergence(const Tensor &tens) const
Computes the divergence of a tensor (with respect to the current connection).
Definition connection.C:463
Lorene::Connection::fait_delta
void fait_delta(const Metric &)
Computes the difference between the connection coefficients and that a the flat connection in the ca...
Definition connection.C:278
Lorene::Connection::del_deriv
void del_deriv() const
Deletes all the derived quantities.
Definition connection.C:205
Lorene::Metric_flat
Flat metric for tensor calculation.
Definition metric.h:261
Lorene::Metric
Metric for tensor calculation.
Definition metric.h:90
Lorene::Tensor_sym
Symmetric tensors (with respect to two of their arguments).
Definition tensor.h:1037
Lorene::Tensor
Tensor handling.
Definition tensor.h:288
Lorene
Lorene prototypes.
Definition app_hor.h:64
Lorene::Map
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Definition map.C:139