LORENE
sym_tensor_tt.C
1 /*
2  * Methods of class Sym_tensor_tt
3  *
4  * (see file sym_tensor.h for documentation)
5  *
6  */
7 
8 /*
9  * Copyright (c) 2003-2004 Eric Gourgoulhon & Jerome Novak
10  *
11  * This file is part of LORENE.
12  *
13  * LORENE is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * LORENE is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with LORENE; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26  *
27  */
28 
29 
30 
31 
32 /*
33  * $Id: sym_tensor_tt.C,v 1.8 2016/12/05 16:18:17 j_novak Exp $
34  * $Log: sym_tensor_tt.C,v $
35  * Revision 1.8 2016/12/05 16:18:17 j_novak
36  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
37  *
38  * Revision 1.7 2014/10/13 08:53:43 j_novak
39  * Lorene classes and functions now belong to the namespace Lorene.
40  *
41  * Revision 1.6 2014/10/06 15:13:19 j_novak
42  * Modified #include directives to use c++ syntax.
43  *
44  * Revision 1.5 2005/04/01 14:28:32 j_novak
45  * Members p_eta and p_mu are now defined in class Sym_tensor.
46  *
47  * Revision 1.4 2004/03/30 14:01:19 j_novak
48  * Copy constructors and operator= now copy the "derived" members.
49  *
50  * Revision 1.3 2004/03/03 13:16:21 j_novak
51  * New potential khi (p_khi) and the functions manipulating it.
52  *
53  * Revision 1.2 2004/01/04 20:52:45 e_gourgoulhon
54  * Added assignement (operator=) to a Tensor_sym.
55  *
56  * Revision 1.1 2003/10/27 10:50:54 e_gourgoulhon
57  * First version.
58  *
59  *
60  *
61  * $Header: /cvsroot/Lorene/C++/Source/Tensor/sym_tensor_tt.C,v 1.8 2016/12/05 16:18:17 j_novak Exp $
62  *
63  */
64 
65 // Headers C
66 #include <cstdlib>
67 
68 // Headers Lorene
69 #include "tensor.h"
70 
71  //--------------//
72  // Constructors //
73  //--------------//
74 
75 // Standard constructor
76 // --------------------
77 namespace Lorene {
78 Sym_tensor_tt::Sym_tensor_tt(const Map& map, const Base_vect& triad_i,
79  const Metric& met)
80  : Sym_tensor_trans(map, triad_i, met ) {
81 
82  set_der_0x0() ;
83 
84 }
85 
86 // Copy constructor
87 // ----------------
89  : Sym_tensor_trans(source) {
90 
91  set_der_0x0() ;
92 
93  if (source.p_khi != 0x0) p_khi = new Scalar( *(source.p_khi) ) ;
94 
95 }
96 
97 
98 // Constructor from a file
99 // -----------------------
100 Sym_tensor_tt::Sym_tensor_tt(const Map& mapping, const Base_vect& triad_i,
101  const Metric& met, FILE* fd)
102  : Sym_tensor_trans(mapping, triad_i, met, fd) {
103 
104  set_der_0x0() ;
105 }
106 
107  //--------------//
108  // Destructor //
109  //--------------//
110 
112 
113  Sym_tensor_tt::del_deriv() ; // in order not to follow the virtual aspect
114  // of del_deriv()
115 
116 }
117 
118 
119 
120  //-------------------//
121  // Memory managment //
122  //-------------------//
123 
125 
126  if (p_khi != 0x0) delete p_khi ;
127 
128  set_der_0x0() ;
129 
131 
132 }
133 
135 
136  p_khi = 0x0 ;
137 }
138 
139 
140  //--------------//
141  // Assignment //
142  //--------------//
143 
145 
146  // Assignment of quantities common to all derived classes of Sym_tensor_trans
147  Sym_tensor_trans::operator=(source) ;
148 
149  del_deriv() ;
150 
151  if (source.p_khi != 0x0) p_khi = new Scalar( *(source.p_khi) ) ;
152 
153 }
154 
155 
157 
158  // Assignment of quantities common to all derived classes of Sym_tensor_trans
159  Sym_tensor_trans::operator=(source) ;
160 
161  del_deriv() ;
162 }
163 
164 
165 
167 
168  // Assignment of quantities common to all derived classes of Sym_tensor_trans
169  Sym_tensor_trans::operator=(source) ;
170 
171  del_deriv() ;
172 }
173 
174 
176 
177  // Assignment of quantities common to all derived classes of Sym_tensor_trans
178  Sym_tensor_trans::operator=(source) ;
179 
180  del_deriv() ;
181 }
182 
183 
184 void Sym_tensor_tt::operator=(const Tensor& source) {
185 
186  // Assignment of quantities common to all derived classes of Sym_tensor_trans
187  Sym_tensor_trans::operator=(source) ;
188 
189  del_deriv() ;
190 }
191 
192 
193 
194 
195 }
Metric for tensor calculation.
Definition: metric.h:90
Lorene prototypes.
Definition: app_hor.h:67
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
Base class for coordinate mappings.
Definition: map.h:688
Sym_tensor_tt(const Map &map, const Base_vect &triad_i, const Metric &met)
Standard constructor.
Definition: sym_tensor_tt.C:78
virtual void operator=(const Sym_tensor_tt &a)
Assignment to another Sym_tensor_tt.
Vectorial bases (triads) with respect to which the tensorial components are defined.
Definition: base_vect.h:105
virtual void operator=(const Sym_tensor_trans &a)
Assignment to another Sym_tensor_trans.
virtual void del_deriv() const
Deletes the derived quantities.
virtual void del_deriv() const
Deletes the derived quantities.
void set_der_0x0() const
Sets the pointers on derived quantities to 0x0.
Tensor handling.
Definition: tensor.h:294
Transverse symmetric tensors of rank 2.
Definition: sym_tensor.h:611
virtual ~Sym_tensor_tt()
Destructor.
Scalar * p_khi
Field such that the component .
Definition: sym_tensor.h:941
Symmetric tensors (with respect to two of their arguments).
Definition: tensor.h:1050
Class intended to describe valence-2 symmetric tensors.
Definition: sym_tensor.h:226
Transverse and traceless symmetric tensors of rank 2.
Definition: sym_tensor.h:933