LORENE
coord.h
1 /*
2  * Definition of Lorene class Coord
3  *
4  */
5 
6 /*
7  * Copyright (c) 1999-2000 Jean-Alain Marck
8  * Copyright (c) 1999-2001 Eric Gourgoulhon
9  *
10  * This file is part of LORENE.
11  *
12  * LORENE is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * LORENE is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with LORENE; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  */
27 
28 
29 #ifndef __COORD_H_
30 #define __COORD_H_
31 
32 
33 /*
34  * $Id: coord.h,v 1.7 2014/10/13 08:52:33 j_novak Exp $
35  * $Log: coord.h,v $
36  * Revision 1.7 2014/10/13 08:52:33 j_novak
37  * Lorene classes and functions now belong to the namespace Lorene.
38  *
39  * Revision 1.6 2014/10/06 15:09:39 j_novak
40  * Modified #include directives to use c++ syntax.
41  *
42  * Revision 1.5 2004/03/22 13:12:40 j_novak
43  * Modification of comments to use doxygen instead of doc++
44  *
45  * Revision 1.4 2003/11/06 14:43:37 e_gourgoulhon
46  * Gave a name to const arguments in certain method prototypes (e.g.
47  * constructors) to correct a bug of DOC++.
48  *
49  * Revision 1.3 2002/10/16 14:36:28 j_novak
50  * Reorganization of #include instructions of standard C++, in order to
51  * use experimental version 3 of gcc.
52  *
53  * Revision 1.2 2002/06/17 14:05:16 j_novak
54  * friend functions are now also declared outside the class definition
55  *
56  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
57  * LORENE
58  *
59  * Revision 2.1 1999/10/15 09:15:56 eric
60  * Depoussierage.
61  * Documentation.
62  *
63  * Revision 2.0 1999/02/15 10:41:51 hyc
64  * *** empty log message ***
65  *
66  * Revision 2.1 1999/02/15 09:59:50 hyc
67  * *** empty log message ***
68  *
69  * Revision 2.0 1999/01/15 09:10:39 hyc
70  * *** empty log message ***
71  *
72  *
73  * $Header: /cvsroot/Lorene/C++/Include/coord.h,v 1.7 2014/10/13 08:52:33 j_novak Exp $
74  *
75  */
76 
77 // Fichier includes
78 #include <cstdlib>
79 #include <cstdio>
80 #include "mtbl.h"
81 
82 namespace Lorene {
83 class Map ;
84 
90 class Coord {
91 
92  // Data :
93  // -----
94  public:
95  const Map* mp ;
96  Mtbl* (*met_fait)(const Map* ) ;
97  mutable Mtbl* c ;
98 
99  // Constructors, destructor :
100  // ------------------------
101  public:
102  Coord() ;
103 
112  Coord(const Map* mp, Mtbl* (*construct)(const Map*) ) ;
113 
114 
115  private:
119  Coord(const Coord & ) ;
120 
121  public:
122  ~Coord() ;
123 
124  // Various methods :
125  // ---------------
126 
130  private:
131  void operator=(const Coord& ) ;
132 
133  public:
144  void set(const Map* mp, Mtbl* (*construct)(const Map*) ) ;
145 
151  void fait() const ;
152 
154  void del_t() const ;
155 
156  friend ostream& operator<<(ostream& , const Coord& ) ;
157 
158  } ;
159 ostream& operator<<(ostream& , const Coord& ) ;
160 
161 // Prototypage de l'arithmetique
168 Mtbl operator+(const Coord&) ;
169 Mtbl operator-(const Coord&) ;
170 
171 Mtbl operator+(const Coord& a, const Coord& b) ;
172 Mtbl operator-(const Coord& a, const Coord& b) ;
173 Mtbl operator*(const Coord& a, const Coord& b) ;
174 
175 Mtbl operator+(const Coord& a, const Mtbl& b) ;
176 Mtbl operator-(const Coord& a, const Mtbl& b) ;
177 Mtbl operator*(const Coord& a, const Mtbl& b) ;
178 
179 Mtbl operator+(const Mtbl& a, const Coord& b) ;
180 Mtbl operator-(const Mtbl& a, const Coord& b) ;
181 Mtbl operator*(const Mtbl& a, const Coord& b) ;
182 
184 }
185 #endif
Multi-domain array.
Definition: mtbl.h:118
Lorene prototypes.
Definition: app_hor.h:67
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Base class for coordinate mappings.
Definition: map.h:688
Coord()
Default constructor.
Definition: coord.C:83
const Map * mp
Mapping on which the Coord is defined.
Definition: coord.h:95
Mtbl * c
The coordinate values at each grid point.
Definition: coord.h:97
friend ostream & operator<<(ostream &, const Coord &)
Display.
Definition: coord.C:104
~Coord()
Destructor.
Definition: coord.C:95
Cmp operator+(const Cmp &)
Definition: cmp_arithm.C:107
Active physical coordinates and mapping derivatives.
Definition: coord.h:90
void fait() const
Computes, at each point of the grid, the value of the coordinate or mapping derivative represented by...
Definition: coord.C:119
void operator=(const Coord &)
Assignement operator (private and not implemented to make Coord a non-copyable class) ...
Cmp operator-(const Cmp &)
- Cmp
Definition: cmp_arithm.C:111
void del_t() const
Logical destructor (deletes the Mtbl member *c ).
Definition: coord.C:128