sym_tensor_tt.C

00001 /*
00002  *  Methods of class Sym_tensor_tt
00003  *
00004  *   (see file sym_tensor.h for documentation)
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2003-2004 Eric Gourgoulhon & Jerome Novak
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License as published by
00015  *   the Free Software Foundation; either version 2 of the License, or
00016  *   (at your option) any later version.
00017  *
00018  *   LORENE is distributed in the hope that it will be useful,
00019  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *   GNU General Public License for more details.
00022  *
00023  *   You should have received a copy of the GNU General Public License
00024  *   along with LORENE; if not, write to the Free Software
00025  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  *
00027  */
00028 
00029 
00030 char sym_tensor_tt_C[] = "$Header: /cvsroot/Lorene/C++/Source/Tensor/sym_tensor_tt.C,v 1.5 2005/04/01 14:28:32 j_novak Exp $" ;
00031 
00032 /*
00033  * $Id: sym_tensor_tt.C,v 1.5 2005/04/01 14:28:32 j_novak Exp $
00034  * $Log: sym_tensor_tt.C,v $
00035  * Revision 1.5  2005/04/01 14:28:32  j_novak
00036  * Members p_eta and p_mu are now defined in class Sym_tensor.
00037  *
00038  * Revision 1.4  2004/03/30 14:01:19  j_novak
00039  * Copy constructors and operator= now copy the "derived" members.
00040  *
00041  * Revision 1.3  2004/03/03 13:16:21  j_novak
00042  * New potential khi (p_khi) and the functions manipulating it.
00043  *
00044  * Revision 1.2  2004/01/04 20:52:45  e_gourgoulhon
00045  * Added assignement (operator=) to a Tensor_sym.
00046  *
00047  * Revision 1.1  2003/10/27 10:50:54  e_gourgoulhon
00048  * First version.
00049  *
00050  *
00051  *
00052  * $Header: /cvsroot/Lorene/C++/Source/Tensor/sym_tensor_tt.C,v 1.5 2005/04/01 14:28:32 j_novak Exp $
00053  *
00054  */
00055 
00056 // Headers C
00057 #include <stdlib.h>
00058 
00059 // Headers Lorene
00060 #include "tensor.h"
00061 
00062             //--------------//
00063             // Constructors //
00064             //--------------//
00065 
00066 // Standard constructor 
00067 // --------------------
00068 Sym_tensor_tt::Sym_tensor_tt(const Map& map, const Base_vect& triad_i,
00069         const Metric& met) 
00070     : Sym_tensor_trans(map, triad_i, met ) {
00071                 
00072     set_der_0x0() ;
00073 
00074 }
00075 
00076 // Copy constructor
00077 // ----------------
00078 Sym_tensor_tt::Sym_tensor_tt (const Sym_tensor_tt& source)
00079     : Sym_tensor_trans(source) {
00080     
00081     set_der_0x0() ;
00082 
00083     if (source.p_khi != 0x0) p_khi = new Scalar( *(source.p_khi) ) ; 
00084     
00085 }   
00086 
00087 
00088 // Constructor from a file
00089 // -----------------------
00090 Sym_tensor_tt::Sym_tensor_tt(const Map& mapping, const Base_vect& triad_i, 
00091     const Metric& met, FILE* fd) 
00092     : Sym_tensor_trans(mapping, triad_i, met, fd) {
00093 
00094     set_der_0x0() ;
00095 }
00096 
00097             //--------------//
00098             //  Destructor  //
00099             //--------------//
00100 
00101 Sym_tensor_tt::~Sym_tensor_tt() {
00102 
00103   Sym_tensor_tt::del_deriv() ;  // in order not to follow the virtual aspect
00104                                     // of del_deriv()
00105 
00106 }
00107 
00108 
00109 
00110             //-------------------//
00111             // Memory managment  //
00112             //-------------------//
00113 
00114 void Sym_tensor_tt::del_deriv() const {
00115 
00116     if (p_khi != 0x0) delete p_khi ; 
00117     
00118     set_der_0x0() ;
00119     
00120     Sym_tensor_trans::del_deriv() ;
00121 
00122 }
00123 
00124 void Sym_tensor_tt::set_der_0x0() const {
00125 
00126   p_khi = 0x0 ;
00127 }
00128 
00129 
00130             //--------------//
00131             //  Assignment  //
00132             //--------------//
00133 
00134 void Sym_tensor_tt::operator=(const Sym_tensor_tt& source) {
00135     
00136     // Assignment of quantities common to all derived classes of Sym_tensor_trans
00137     Sym_tensor_trans::operator=(source) ; 
00138     
00139     del_deriv() ; 
00140     
00141     if (source.p_khi != 0x0) p_khi = new Scalar( *(source.p_khi) ) ; 
00142     
00143 }
00144 
00145 
00146 void Sym_tensor_tt::operator=(const Sym_tensor_trans& source) {
00147     
00148     // Assignment of quantities common to all derived classes of Sym_tensor_trans
00149     Sym_tensor_trans::operator=(source) ; 
00150 
00151     del_deriv() ;   
00152 }
00153 
00154 
00155 
00156 void Sym_tensor_tt::operator=(const Sym_tensor& source) {
00157     
00158     // Assignment of quantities common to all derived classes of Sym_tensor_trans
00159     Sym_tensor_trans::operator=(source) ; 
00160 
00161     del_deriv() ;   
00162 }
00163 
00164 
00165 void Sym_tensor_tt::operator=(const Tensor_sym& source) {
00166     
00167     // Assignment of quantities common to all derived classes of Sym_tensor_trans
00168     Sym_tensor_trans::operator=(source) ; 
00169     
00170     del_deriv() ;   
00171 }
00172 
00173 
00174 void Sym_tensor_tt::operator=(const Tensor& source) {
00175     
00176     // Assignment of quantities common to all derived classes of Sym_tensor_trans
00177     Sym_tensor_trans::operator=(source) ; 
00178     
00179     del_deriv() ;   
00180 }
00181 
00182 
00183 
00184 

Generated on Tue Feb 7 01:35:20 2012 for LORENE by  doxygen 1.4.6