base_vect.h
/*
* Definition of Lorene classes Base_vect
* Base_vect_cart
* Base_vect_spher
*
*/
/*
* Copyright (c) 2000-2001 Eric Gourgoulhon
*
* 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 as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 __BASE_VECT_H_
#define __BASE_VECT_H_
/*
* $Id: base_vect.h,v 1.7 2014/10/13 08:52:31 j_novak Exp $
* $Log: base_vect.h,v $
* Revision 1.7 2014/10/13 08:52:31 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.6 2014/10/06 15:09:39 j_novak
* Modified #include directives to use c++ syntax.
*
* Revision 1.5 2004/03/22 13:12:40 j_novak
* Modification of comments to use doxygen instead of doc++
*
* Revision 1.4 2002/10/16 14:36:28 j_novak
* Reorganization of #include instructions of standard C++, in order to
* use experimental version 3 of gcc.
*
* Revision 1.3 2002/09/13 09:17:31 j_novak
* Modif. commentaires
*
* Revision 1.2 2002/06/17 14:05:16 j_novak
* friend functions are now also declared outside the class definition
*
* Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
* LORENE
*
* Revision 2.6 2000/02/28 15:42:15 eric
* Ajout de la fonction Base_vect_cart::get_align().
*
* Revision 2.5 2000/02/09 14:45:40 eric
* *** empty log message ***
*
* Revision 2.4 2000/02/09 13:22:50 eric
* REFONTE COMPLETE DE LA CLASSE
* L'identification n'est plus base sur un membre statique (numero
* d'instance) mais sur les caracteres physiques (rot_phi, etc...)
* Ajout des constructeurs par copie et lecture de fichier.
*
* Revision 2.3 2000/01/12 16:27:13 eric
* Les constructeurs a un seul argument sont declares explicit.
*
* Revision 2.2 2000/01/10 13:34:52 eric
* Modif commentairez.
*
* Revision 2.1 2000/01/10 13:26:49 eric
* Ajout de la fonction set_rot_phi.
*
* Revision 2.0 2000/01/10 12:43:15 eric
* *** empty log message ***
*
*
* $Header: /cvsroot/Lorene/C++/Include/base_vect.h,v 1.7 2014/10/13 08:52:31 j_novak Exp $
*
*/
// Headers C
#include <cstdio>
#include "headcpp.h"
// Lorene classes
namespace Lorene {
class Tenseur ;
//-----------------------------------//
// class Base_vect (base class) //
//-----------------------------------//
class Base_vect {
// Data :
// -----
protected:
char name[100] ;
// Constructors - Destructor
// -------------------------
protected:
Base_vect() ;
explicit Base_vect(const char* name_i) ;
Base_vect(const Base_vect& ) ;
protected:
explicit Base_vect(FILE* ) ;
public:
virtual ~Base_vect() ;
// Mutator / Assignment
// --------------------
private:
void operator=(const Base_vect& ) ;
public:
void set_name(const char* name_i) ;
// Extraction of information
// -------------------------
public:
const char* get_name() const ;
virtual int identify() const = 0 ;
// Outputs
// -------
public:
virtual void sauve(FILE* ) const ;
friend ostream& operator<<(ostream& , const Base_vect& ) ;
protected:
virtual ostream& operator>>(ostream &) const = 0 ;
// Miscellaneous
// -------------
public:
static Base_vect* bvect_from_file(FILE* ) ;
virtual bool operator==(const Base_vect& ) const = 0 ;
bool operator!=(const Base_vect& ) const ;
virtual void change_basis(Tenseur& ) const = 0 ;
};
ostream& operator<<(ostream& , const Base_vect& ) ;
//-----------------------------------//
// class Base_vect_cart //
//-----------------------------------//
class Base_vect_cart : public Base_vect {
// Data :
// -----
private:
double rot_phi ;
int align ;
// Constructors - Destructor
// -------------------------
public:
explicit Base_vect_cart(double rot_phi_i) ;
Base_vect_cart(double rot_phi_i, const char* name_i) ;
Base_vect_cart(const Base_vect_cart& ) ;
protected:
explicit Base_vect_cart(FILE* ) ;
friend Base_vect* Base_vect::bvect_from_file(FILE* ) ;
public:
virtual ~Base_vect_cart() ;
// Mutators
// --------
public:
void operator=(const Base_vect_cart& ) ;
void set_rot_phi(double rot_phi_i) ;
private:
void set_align() ;
// Miscellaneous
// -------------
public:
virtual bool operator==(const Base_vect& ) const ;
virtual void change_basis(Tenseur& ) const ;
virtual int identify() const ;
int get_align() const {return align;} ;
// Outputs
// -------
public:
virtual void sauve(FILE* ) const ;
protected:
virtual ostream& operator>>(ostream &) const ;
};
//-----------------------------------//
// class Base_vect_spher //
//-----------------------------------//
class Base_vect_spher : public Base_vect {
// Data :
// -----
private:
double ori_x ;
double ori_y ;
double ori_z ;
double rot_phi ;
// Constructors - Destructor
// -------------------------
public:
Base_vect_spher(double xa0, double ya0, double za0,
double rot_phi_i) ;
Base_vect_spher(double xa0, double ya0, double za0,
double rot_phi_i, const char* name_i) ;
Base_vect_spher(const Base_vect_spher& ) ;
protected:
explicit Base_vect_spher(FILE* ) ;
friend Base_vect* Base_vect::bvect_from_file(FILE* ) ;
public:
virtual ~Base_vect_spher() ;
// Mutators
// --------
public:
void operator=(const Base_vect_spher& ) ;
public:
void set_ori(double xa0, double ya0, double za0) ;
void set_rot_phi(double rot_phi_i) ;
// Miscellaneous
// -------------
public:
virtual bool operator==(const Base_vect& ) const ;
virtual void change_basis(Tenseur& ) const ;
virtual int identify() const ;
// Outputs
// -------
public:
virtual void sauve(FILE* ) const ;
protected:
virtual ostream& operator>>(ostream &) const ;
};
}
#endif
Lorene::Base_vect_cart::set_rot_phi
void set_rot_phi(double rot_phi_i)
Sets a new value to the angle rot_phi between the x –axis and the absolute frame X –axis.
Definition base_vect_cart.C:212
Lorene::Base_vect_cart::~Base_vect_cart
virtual ~Base_vect_cart()
Destructor.
Definition base_vect_cart.C:152
Lorene::Base_vect_cart::get_align
int get_align() const
Returns the indicator of alignment with respect to the absolute frame.
Definition base_vect.h:285
Lorene::Base_vect_cart::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition base_vect_cart.C:262
Lorene::Base_vect_cart::set_align
void set_align()
Computes align from the value of rot_phi.
Definition base_vect_cart.C:179
Lorene::Base_vect_cart::align
int align
Indicator of alignment with respect to the absolute frame: \ align = 1 : basis aligned with the absol...
Definition base_vect.h:217
Lorene::Base_vect_cart::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition base_vect_cart.C:254
Lorene::Base_vect_cart::identify
virtual int identify() const
Returns a number to identify the sub-classe of Base_vect the object belongs to.
Definition base_vect_from_file.C:74
Lorene::Base_vect_cart::operator==
virtual bool operator==(const Base_vect &) const
Comparison operator (egality).
Definition base_vect_cart.C:224
Lorene::Base_vect_cart::Base_vect_cart
Base_vect_cart(double rot_phi_i)
Standard constructor.
Definition base_vect_cart.C:110
Lorene::Base_vect_cart::rot_phi
double rot_phi
Angle between the x –axis and the absolute frame X –axis.
Definition base_vect.h:207
Lorene::Base_vect_cart::change_basis
virtual void change_basis(Tenseur &) const
Change the basis in which the components of a tensor are expressed.
Definition base_vect_cart.C:280
Lorene::Base_vect_cart::operator=
void operator=(const Base_vect_cart &)
Assignment to another Base_vect_cart.
Definition base_vect_cart.C:165
Lorene::Base_vect_spher::ori_y
double ori_y
Absolute coordinate Y of the origin.
Definition base_vect.h:314
Lorene::Base_vect_spher::~Base_vect_spher
virtual ~Base_vect_spher()
Destructor.
Definition base_vect_spher.C:150
Lorene::Base_vect_spher::operator=
void operator=(const Base_vect_spher &)
Assignment to another Base_vect_spher.
Definition base_vect_spher.C:162
Lorene::Base_vect_spher::ori_x
double ori_x
Absolute coordinate X of the origin.
Definition base_vect.h:313
Lorene::Base_vect_spher::ori_z
double ori_z
Absolute coordinate Z of the origin.
Definition base_vect.h:315
Lorene::Base_vect_spher::operator==
virtual bool operator==(const Base_vect &) const
Comparison operator (egality).
Definition base_vect_spher.C:195
Lorene::Base_vect_spher::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition base_vect_spher.C:246
Lorene::Base_vect_spher::rot_phi
double rot_phi
Angle between the x –axis and the absolute frame X –axis.
Definition base_vect.h:318
Lorene::Base_vect_spher::set_ori
void set_ori(double xa0, double ya0, double za0)
Sets a new origin.
Definition base_vect_spher.C:175
Lorene::Base_vect_spher::set_rot_phi
void set_rot_phi(double rot_phi_i)
Sets a new value to the angle rot_phi between the x –axis and the absolute frame X –axis.
Definition base_vect_spher.C:184
Lorene::Base_vect_spher::Base_vect_spher
Base_vect_spher(double xa0, double ya0, double za0, double rot_phi_i)
Standard constructor.
Definition base_vect_spher.C:103
Lorene::Base_vect_spher::identify
virtual int identify() const
Returns a number to identify the sub-classe of Base_vect the object belongs to.
Definition base_vect_from_file.C:76
Lorene::Base_vect_spher::change_basis
virtual void change_basis(Tenseur &) const
Change the basis in which the components of a tensor are expressed.
Definition base_vect_spher.C:276
Lorene::Base_vect_spher::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition base_vect_spher.C:257
Lorene::Base_vect
Vectorial bases (triads) with respect to which the tensorial components are defined.
Definition base_vect.h:105
Lorene::Base_vect::Base_vect
Base_vect()
Standard constructor.
Definition base_vect.C:87
Lorene::Base_vect::operator!=
bool operator!=(const Base_vect &) const
Comparison operator (difference).
Definition base_vect.C:174
Lorene::Base_vect::identify
virtual int identify() const =0
Returns a number to identify the sub-classe of Base_vect the object belongs to.
Lorene::Base_vect::bvect_from_file
static Base_vect * bvect_from_file(FILE *)
Construction of a vectorial basis from a file (see sauve(FILE* ) ).
Definition base_vect_from_file.C:84
Lorene::Base_vect::get_name
const char * get_name() const
Returns the basis name.
Definition base_vect.C:140
Lorene::Base_vect::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition base_vect.C:150
Lorene::Base_vect::set_name
void set_name(const char *name_i)
Sets the basis name.
Definition base_vect.C:134
Lorene::Base_vect::~Base_vect
virtual ~Base_vect()
Destructor.
Definition base_vect.C:123
Lorene::Base_vect::operator<<
friend ostream & operator<<(ostream &, const Base_vect &)
Display.
Definition base_vect.C:162
Lorene::Base_vect::operator==
virtual bool operator==(const Base_vect &) const =0
Comparison operator (egality).
Lorene::Base_vect::operator=
void operator=(const Base_vect &)
Assignement operator (not implemented).
Lorene::Base_vect::name
char name[100]
Name of the basis.
Definition base_vect.h:110
Lorene::Base_vect::change_basis
virtual void change_basis(Tenseur &) const =0
Change the basis in which the components of a tensor are expressed.
Lorene::Base_vect::operator>>
virtual ostream & operator>>(ostream &) const =0
Operator >>.
Lorene::Tenseur
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition tenseur.h:301
Lorene
Lorene prototypes.
Definition app_hor.h:64