| 1 | /* |
| 2 | * Definition of Lorene class Mtbl_cf |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * Copyright (c) 1999-2000 Jean-Alain Marck |
| 8 | * Copyright (c) 1999-2005 Eric Gourgoulhon |
| 9 | * Copyright (c) 1999-2001 Philippe Grandclement |
| 10 | * Copyright (c) 1999-2001 Jerome Novak |
| 11 | * |
| 12 | * This file is part of LORENE. |
| 13 | * |
| 14 | * LORENE is free software; you can redistribute it and/or modify |
| 15 | * it under the terms of the GNU General Public License as published by |
| 16 | * the Free Software Foundation; either version 2 of the License, or |
| 17 | * (at your option) any later version. |
| 18 | * |
| 19 | * LORENE is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | * GNU General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with LORENE; if not, write to the Free Software |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 27 | * |
| 28 | */ |
| 29 | |
| 30 | |
| 31 | #ifndef __MTBL_CF_H_ |
| 32 | #define __MTBL_CF_H_ |
| 33 | |
| 34 | /* |
| 35 | * $Id: mtbl_cf.h,v 1.10 2014/10/13 08:52:36 j_novak Exp $ |
| 36 | * $Log: mtbl_cf.h,v $ |
| 37 | * Revision 1.10 2014/10/13 08:52:36 j_novak |
| 38 | * Lorene classes and functions now belong to the namespace Lorene. |
| 39 | * |
| 40 | * Revision 1.9 2006/06/06 14:56:59 j_novak |
| 41 | * Summation functions for angular coefficients at xi=+/-1. |
| 42 | * |
| 43 | * Revision 1.8 2005/04/04 21:30:42 e_gourgoulhon |
| 44 | * Added argument lambda to method poisson_angu |
| 45 | * to treat the generalized angular Poisson equation: |
| 46 | * Lap_ang u + lambda u = source. |
| 47 | * |
| 48 | * Revision 1.7 2004/03/22 13:12:42 j_novak |
| 49 | * Modification of comments to use doxygen instead of doc++ |
| 50 | * |
| 51 | * Revision 1.6 2003/11/06 14:43:37 e_gourgoulhon |
| 52 | * Gave a name to const arguments in certain method prototypes (e.g. |
| 53 | * constructors) to correct a bug of DOC++. |
| 54 | * |
| 55 | * Revision 1.5 2003/10/19 19:44:41 e_gourgoulhon |
| 56 | * Introduced new method display (to replace the old affiche_seuil). |
| 57 | * |
| 58 | * Revision 1.4 2003/10/15 21:09:22 e_gourgoulhon |
| 59 | * Added method poisson_regu. |
| 60 | * |
| 61 | * Revision 1.3 2002/09/13 09:17:33 j_novak |
| 62 | * Modif. commentaires |
| 63 | * |
| 64 | * Revision 1.2 2002/06/17 14:05:17 j_novak |
| 65 | * friend functions are now also declared outside the class definition |
| 66 | * |
| 67 | * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon |
| 68 | * LORENE |
| 69 | * |
| 70 | * Revision 2.28 2000/09/11 13:52:21 eric |
| 71 | * Ajout des methodes mult_cp() et mult_sp(). |
| 72 | * |
| 73 | * Revision 2.27 2000/08/16 10:42:54 eric |
| 74 | * Suppression du membre dzpuis. |
| 75 | * |
| 76 | * Revision 2.26 2000/08/04 11:41:52 eric |
| 77 | * Ajout de l'operateur (int l) et de la fonction set(int l) pour l'acces |
| 78 | * individuel aux Tbl. |
| 79 | * |
| 80 | * Revision 2.25 2000/03/06 10:26:24 eric |
| 81 | * Ajout des fonctions val_point_symy, val_point_asymy. |
| 82 | * |
| 83 | * Revision 2.24 2000/02/25 13:53:44 eric |
| 84 | * Suppression de la fonction nettoie(). |
| 85 | * |
| 86 | * Revision 2.23 1999/12/29 13:11:34 eric |
| 87 | * Ajout de la fonction val_point_jk. |
| 88 | * |
| 89 | * Revision 2.22 1999/12/07 14:51:52 eric |
| 90 | * Changement ordre des arguments (phi,theta,xi) --> (xi,theta,phi) |
| 91 | * dans la routine val_point. |
| 92 | * |
| 93 | * Revision 2.21 1999/12/06 16:45:48 eric |
| 94 | * Ajout de la fonction val_point. |
| 95 | * |
| 96 | * Revision 2.20 1999/11/23 14:30:12 novak |
| 97 | * Ajout des membres mult_ct et mult_st |
| 98 | * |
| 99 | * Revision 2.19 1999/11/16 13:06:22 novak |
| 100 | * Ajout de mult_x et scost |
| 101 | * |
| 102 | * Revision 2.18 1999/10/29 15:07:10 eric |
| 103 | * Suppression des fonctions membres min() et max(): |
| 104 | * elles deviennent des fonctions externes. |
| 105 | * Ajout de fonctions mathematiques (abs, norme, etc...). |
| 106 | * |
| 107 | * Revision 2.17 1999/10/21 13:42:00 eric |
| 108 | * *** empty log message *** |
| 109 | * |
| 110 | * Revision 2.16 1999/10/21 12:49:13 eric |
| 111 | * Ajout de la fonction membre nettoie(). |
| 112 | * |
| 113 | * Revision 2.15 1999/10/18 15:06:50 eric |
| 114 | * La fonction membre annule() est rebaptisee annule_hard(). |
| 115 | * Introduction de la fonction membre annule(int, int). |
| 116 | * |
| 117 | * Revision 2.14 1999/10/18 13:39:13 eric |
| 118 | * Suppression de l'argument base dans les routines de derivation. |
| 119 | * |
| 120 | * Revision 2.13 1999/10/13 15:49:22 eric |
| 121 | * Ajout du membre base. |
| 122 | * Modification des constructeurs (la base doit etre passee en argument). |
| 123 | * |
| 124 | * Revision 2.12 1999/10/01 14:49:19 eric |
| 125 | * Depoussierage. |
| 126 | * Documentation. |
| 127 | * |
| 128 | * Revision 2.11 1999/09/07 14:33:43 phil |
| 129 | * ajout de la fonction ssint(int*) |
| 130 | * |
| 131 | * Revision 2.10 1999/04/26 17:02:40 phil |
| 132 | * ajout de sx2(int*) |
| 133 | * |
| 134 | * Revision 2.9 1999/04/26 16:24:02 phil |
| 135 | * ajout de mult2_xm1_zec(int*) |
| 136 | * |
| 137 | * Revision 2.8 1999/04/26 16:12:27 phil |
| 138 | * ajout de mult_xm1_zec(int *) |
| 139 | * |
| 140 | * Revision 2.7 1999/04/26 15:48:43 phil |
| 141 | * ajout de sxm1_zec(int*) |
| 142 | * |
| 143 | * Revision 2.6 1999/04/26 14:50:30 phil |
| 144 | * ajout de sx(int*) |
| 145 | * |
| 146 | * Revision 2.5 1999/04/26 12:19:38 phil |
| 147 | * ajout lapang |
| 148 | * |
| 149 | * Revision 2.4 1999/03/03 10:32:44 hyc |
| 150 | * *** empty log message *** |
| 151 | * |
| 152 | * Revision 2.3 1999/03/02 18:55:00 eric |
| 153 | * Ajout de la fonction affiche_seuil. |
| 154 | * |
| 155 | * |
| 156 | * $Header: /cvsroot/Lorene/C++/Include/mtbl_cf.h,v 1.10 2014/10/13 08:52:36 j_novak Exp $ |
| 157 | * |
| 158 | */ |
| 159 | |
| 160 | // Headers Lorene |
| 161 | #include "tbl.h" |
| 162 | #include "base_val.h" |
| 163 | #include "grilles.h" |
| 164 | |
| 165 | namespace Lorene { |
| 166 | class Mg3d ; |
| 167 | |
| 168 | /** |
| 169 | * Coefficients storage for the multi-domain spectral method. |
| 170 | * |
| 171 | * This class is essentially an array (on the various physical domains) |
| 172 | * of \c Tbl specially designed for |
| 173 | * storage of the coefficients of the spectral expansions in each domain. |
| 174 | * It is intended to be |
| 175 | * used in conjunction with the class \c Mtbl (see class \c Valeur ). |
| 176 | * A difference between a \c Mtbl and a \c Mtbl_cf , both defined one |
| 177 | * the same grid \c Mg3d , is that each \c Tbl of the \c Mtbl_cf |
| 178 | * has 2 more elements in the \f$\phi\f$-dimension (Dim_tbl::dim[2]) than the |
| 179 | * corresponding \c Tbl of the \c Mtbl . |
| 180 | * A \c Mbl_cf is initialy created with a \e logical state \c ETATZERO . |
| 181 | * Arithmetic operations are provided with the usual meaning (see |
| 182 | * below). |
| 183 | * |
| 184 | * \ingroup (spec) |
| 185 | */ |
| 186 | class Mtbl_cf { |
| 187 | |
| 188 | // Data : |
| 189 | // ----- |
| 190 | private: |
| 191 | /// Pointer on the multi-grid \c Mgd3 on which \c this is defined |
| 192 | const Mg3d* mg ; |
| 193 | /// Number of domains (zones) |
| 194 | int nzone ; |
| 195 | /// Logical state (\c ETATNONDEF , \c ETATQCQ or \c ETATZERO ). |
| 196 | int etat ; |
| 197 | |
| 198 | public: |
| 199 | /// Bases of the spectral expansions |
| 200 | Base_val base ; |
| 201 | |
| 202 | /** Array (size \c nzone ) of pointers on the \c Tbl 's which |
| 203 | * contain the spectral coefficients in each domain |
| 204 | */ |
| 205 | Tbl** t ; |
| 206 | |
| 207 | // Constructors - Destructor |
| 208 | // ------------------------- |
| 209 | |
| 210 | public: |
| 211 | /// Constructor |
| 212 | Mtbl_cf(const Mg3d& mgrid, const Base_val& basis) ; |
| 213 | /// Constructor |
| 214 | Mtbl_cf(const Mg3d* p_mgrid, const Base_val& basis) ; |
| 215 | |
| 216 | /// Constructor from a file (see \c sauve(FILE*) ) |
| 217 | Mtbl_cf(const Mg3d&, FILE* ) ; |
| 218 | |
| 219 | /// Copy constructor |
| 220 | Mtbl_cf(const Mtbl_cf& ) ; |
| 221 | /// Destructor |
| 222 | ~Mtbl_cf() ; |
| 223 | |
| 224 | // Assignement |
| 225 | // ----------- |
| 226 | /// Assignement to another \c Mtbl_cf |
| 227 | void operator=(const Mtbl_cf& ) ; |
| 228 | /// Assignement to a \c double |
| 229 | void operator=(double ) ; |
| 230 | /// Assignement to a \c int |
| 231 | void operator=(int ) ; |
| 232 | |
| 233 | // Memory management |
| 234 | // ----------------- |
| 235 | private: |
| 236 | /** Logical destructor: dellocates the memory occupied by the \c Tbl |
| 237 | * array \c t . |
| 238 | */ |
| 239 | void del_t() ; |
| 240 | |
| 241 | public: |
| 242 | |
| 243 | /** |
| 244 | * Sets the logical state to \c ETATNONDEF (undefined). |
| 245 | * Deallocates the memory occupied by the \c Tbl array \c t . |
| 246 | */ |
| 247 | void set_etat_nondef() ; |
| 248 | |
| 249 | /** |
| 250 | * Sets the logical state to \c ETATZERO (zero). |
| 251 | * Deallocates the memory occupied by the \c Tbl array \c t . |
| 252 | */ |
| 253 | void set_etat_zero() ; |
| 254 | |
| 255 | /** |
| 256 | * Sets the logical state to \c ETATQCQ (ordinary state). |
| 257 | * If the state (member \c etat ) is already \c ETATQCQ , this |
| 258 | * function does nothing. Otherwise, it performs the memory allocation |
| 259 | * for the \c Tbl array \c t . |
| 260 | */ |
| 261 | void set_etat_qcq() ; |
| 262 | |
| 263 | /** |
| 264 | * Sets the \c Mtbl_cf to zero in a hard way. |
| 265 | * 1/ Sets the logical state to \c ETATQCQ , i.e. to an ordinary state. |
| 266 | * 2/ Allocates the memory of the \c Tbl array \c t , and fills it |
| 267 | * with zeros. NB: this function must be used for debugging purposes only. |
| 268 | * For other operations, the functions \c set_etat_zero() |
| 269 | * or \c annule(int, int) must be perferred. |
| 270 | */ |
| 271 | void annule_hard() ; |
| 272 | |
| 273 | /** |
| 274 | * Sets the \c Mtbl_cf to zero in some domains. |
| 275 | * @param l_min [input] The \c Mtbl_cf will be set (logically) to zero |
| 276 | * in the domains whose indices are in the range |
| 277 | * \c [l_min, l_max] . |
| 278 | * @param l_max [input] see the comments for \c l_min . |
| 279 | * |
| 280 | * Note that \c annule(0, nzone-1) is equivalent to |
| 281 | * \c set_etat_zero() . |
| 282 | */ |
| 283 | void annule(int l_min, int l_max) ; |
| 284 | |
| 285 | // Access to individual elements |
| 286 | // ----------------------------- |
| 287 | public: |
| 288 | |
| 289 | /** |
| 290 | * Read/write of the \c Tbl containing the coefficients |
| 291 | * in a given domain. |
| 292 | * @param l [input] domain index |
| 293 | */ |
| 294 | Tbl& set(int l) { |
| 295 | assert(l < nzone) ; |
| 296 | assert(etat == ETATQCQ) ; |
| 297 | return *(t[l]) ; |
| 298 | }; |
| 299 | |
| 300 | |
| 301 | /** |
| 302 | * Read-only of the \c Tbl containing the coefficients |
| 303 | * in a given domain. |
| 304 | * @param l [input] domain index |
| 305 | */ |
| 306 | const Tbl& operator()(int l) const { |
| 307 | assert(l < nzone) ; |
| 308 | assert(etat == ETATQCQ) ; |
| 309 | return *(t[l]) ; |
| 310 | }; |
| 311 | |
| 312 | |
| 313 | /** Read/write of a particular element. |
| 314 | * @param l [input] domain index |
| 315 | * @param k [input] \f$\phi\f$ index |
| 316 | * @param j [input] \f$\theta\f$ index |
| 317 | * @param i [input] \e r (\f$\xi\f$) index |
| 318 | */ |
| 319 | double& set(int l, int k, int j, int i) { |
| 320 | assert(l < nzone) ; |
| 321 | assert(etat == ETATQCQ) ; |
| 322 | return (t[l])->set(k, j, i) ; |
| 323 | }; |
| 324 | |
| 325 | |
| 326 | /** Read-only of a particular element. |
| 327 | * @param l [input] domain index |
| 328 | * @param k [input] \f$\phi\f$ index |
| 329 | * @param j [input] \f$\theta\f$ index |
| 330 | * @param i [input] \e r (\f$\xi\f$) index |
| 331 | */ |
| 332 | double operator()(int l, int k, int j, int i) const { |
| 333 | assert(etat != ETATNONDEF) ; |
| 334 | assert(l < nzone) ; |
| 335 | if (etat == ETATZERO) { |
| 336 | double zero = 0. ; |
| 337 | return zero ; |
| 338 | } |
| 339 | else return (*t[l])(k, j, i) ; |
| 340 | }; |
| 341 | |
| 342 | /** Computes the value of the field represented by \c *this at an |
| 343 | * arbitrary point, by means of the spectral expansion. |
| 344 | * @param l [input] index of the domain |
| 345 | * @param x [input] value of the coordinate \f$\xi\f$ |
| 346 | * @param theta [input] value of the coordinate \f$\theta'\f$ |
| 347 | * @param phi [input] value of the coordinate \f$\phi'\f$ |
| 348 | * @return value at the point \f$(\xi, \theta', \phi')\f$ in |
| 349 | * the domain no. \e l of the field whose spectral coefficients |
| 350 | * are stored in \c *this . |
| 351 | */ |
| 352 | double val_point(int l, double x, double theta, double phi) const ; |
| 353 | |
| 354 | /** Computes the value of the field represented by \c *this at an |
| 355 | * arbitrary point, by means of the spectral expansion. |
| 356 | * Case where the field is symmetric with respect to the y=0 plane. |
| 357 | * @param l [input] index of the domain |
| 358 | * @param x [input] value of the coordinate \f$\xi\f$ |
| 359 | * @param theta [input] value of the coordinate \f$\theta'\f$ |
| 360 | * @param phi [input] value of the coordinate \f$\phi'\f$ |
| 361 | * @return value at the point \f$(\xi, \theta', \phi')\f$ in |
| 362 | * the domain no. \e l of the field whose spectral coefficients |
| 363 | * are stored in \c *this . |
| 364 | */ |
| 365 | double val_point_symy(int l, double x, double theta, double phi) const ; |
| 366 | |
| 367 | /** Computes the value of the field represented by \c *this at an |
| 368 | * arbitrary point, by means of the spectral expansion. |
| 369 | * Case where the field is antisymmetric with respect to the y=0 plane. |
| 370 | * @param l [input] index of the domain |
| 371 | * @param x [input] value of the coordinate \f$\xi\f$ |
| 372 | * @param theta [input] value of the coordinate \f$\theta'\f$ |
| 373 | * @param phi [input] value of the coordinate \f$\phi'\f$ |
| 374 | * @return value at the point \f$(\xi, \theta', \phi')\f$ in |
| 375 | * the domain no. \e l of the field whose spectral coefficients |
| 376 | * are stored in \c *this . |
| 377 | */ |
| 378 | double val_point_asymy(int l, double x, double theta, double phi) const ; |
| 379 | |
| 380 | /** Computes the value of the field represented by \c *this at an |
| 381 | * arbitrary point in \f$\xi\f$, but collocation point in |
| 382 | * \f$(\theta', \phi')\f$, by means of the spectral expansion. |
| 383 | * @param l [input] index of the domain |
| 384 | * @param x [input] value of the coordinate \f$\xi\f$ |
| 385 | * @param j [input] index of the collocation point in \f$\theta'\f$ |
| 386 | * @param k [input] index of the collocation point in \f$\phi'\f$ |
| 387 | * @return value at the point |
| 388 | * \f$(\xi, {\theta'}_j, {\phi'}_k)\f$ in |
| 389 | * the domain no. \e l of the field whose spectral coefficients |
| 390 | * are stored in \c *this . |
| 391 | */ |
| 392 | double val_point_jk(int l, double x, int j, int k) const ; |
| 393 | |
| 394 | /** Computes the value of the field represented by \c *this at an |
| 395 | * arbitrary point in \f$\xi\f$, but collocation point in |
| 396 | * \f$(\theta', \phi')\f$, by means of the spectral expansion. |
| 397 | * Case where the field is symmetric with respect to the y=0 plane. |
| 398 | * @param l [input] index of the domain |
| 399 | * @param x [input] value of the coordinate \f$\xi\f$ |
| 400 | * @param j [input] index of the collocation point in \f$\theta'\f$ |
| 401 | * @param k [input] index of the collocation point in \f$\phi'\f$ |
| 402 | * @return value at the point |
| 403 | * \f$(\xi, {\theta'}_j, {\phi'}_k)\f$ in |
| 404 | * the domain no. \e l of the field whose spectral coefficients |
| 405 | * are stored in \c *this . |
| 406 | */ |
| 407 | double val_point_jk_symy(int l, double x, int j, int k) const ; |
| 408 | |
| 409 | /** Computes the value of the field represented by \c *this at an |
| 410 | * arbitrary point in \f$\xi\f$, but collocation point in |
| 411 | * \f$(\theta', \phi')\f$, by means of the spectral expansion. |
| 412 | * Case where the field is antisymmetric with respect to the y=0 plane. |
| 413 | * @param l [input] index of the domain |
| 414 | * @param x [input] value of the coordinate \f$\xi\f$ |
| 415 | * @param j [input] index of the collocation point in \f$\theta'\f$ |
| 416 | * @param k [input] index of the collocation point in \f$\phi'\f$ |
| 417 | * @return value at the point |
| 418 | * \f$(\xi, {\theta'}_j, {\phi'}_k)\f$ in |
| 419 | * the domain no. \e l of the field whose spectral coefficients |
| 420 | * are stored in \c *this . |
| 421 | */ |
| 422 | double val_point_jk_asymy(int l, double x, int j, int k) const ; |
| 423 | |
| 424 | /** Computes the angular coefficient of index \c j,k of the field |
| 425 | * represented by \c *this at \f$\xi = 1 \f$ by means of the spectral expansion. |
| 426 | * @param l [input] index of the domain |
| 427 | * @param j [input] index in \f$\theta\f$-direction |
| 428 | * @param k [input] index in \f$\phi\f$-direction |
| 429 | * @return coefficient at the boundary \f$\xi = 1\f$ |
| 430 | * in the domain no. \e l of the field whose spectral coefficients |
| 431 | * are stored in \c *this . |
| 432 | */ |
| 433 | double val_out_bound_jk(int l, int j, int k) const ; |
| 434 | |
| 435 | /** Computes the angular coefficient of index \c j,k of the field |
| 436 | * represented by \c *this at \f$\xi = -1 \f$ by means of the |
| 437 | * spectral expansion. Not defined in the nucleus. |
| 438 | * @param l [input] index of the domain |
| 439 | * @param j [input] index in \f$\theta\f$-direction |
| 440 | * @param k [input] index in \f$\phi\f$-direction |
| 441 | * @return coefficient at the boundary \f$\xi = -1\f$ |
| 442 | * in the domain no. \e l of the field whose spectral coefficients |
| 443 | * are stored in \c *this . |
| 444 | */ |
| 445 | double val_in_bound_jk(int l, int j, int k) const ; |
| 446 | |
| 447 | |
| 448 | |
| 449 | // Extraction of information |
| 450 | // ------------------------- |
| 451 | public: |
| 452 | /// Returns the \c Mg3d on which the \c Mtbl_cf is defined |
| 453 | const Mg3d* get_mg() const { return mg ; }; |
| 454 | |
| 455 | /// Returns the logical state |
| 456 | int get_etat() const { return etat ; }; |
| 457 | |
| 458 | /// Returns the number of zones (domains) |
| 459 | int get_nzone() const { return nzone ; } ; |
| 460 | |
| 461 | |
| 462 | // Outputs |
| 463 | // ------- |
| 464 | public: |
| 465 | |
| 466 | /// Save in a file |
| 467 | void sauve(FILE *) const ; |
| 468 | |
| 469 | /** Prints the coefficients whose values are greater than a given threshold, |
| 470 | * as well as the corresponding basis |
| 471 | * @param threshold [input] Value above which a coefficient is printed |
| 472 | * (default: 1.e-7) |
| 473 | * @param precision [input] Number of printed digits (default: 4) |
| 474 | * @param ostr [input] Output stream used for the printing (default: cout) |
| 475 | */ |
| 476 | void display(double threshold = 1.e-7, int precision = 4, |
| 477 | ostream& ostr = cout) const ; |
| 478 | |
| 479 | /** Prints only the values greater than a given threshold. |
| 480 | * @param ostr [input] Output stream used for the printing |
| 481 | * @param precision [input] Number of printed digits (default: 4) |
| 482 | * @param threshold [input] Value above which an array element is printed |
| 483 | * (default: 1.e-7) |
| 484 | */ |
| 485 | void affiche_seuil(ostream& ostr, int precision = 4, |
| 486 | double threshold = 1.e-7) const ; |
| 487 | /// Display |
| 488 | friend ostream& operator<<(ostream& , const Mtbl_cf& ) ; |
| 489 | |
| 490 | // Member arithmetics |
| 491 | // ------------------ |
| 492 | public: |
| 493 | /// += Mtbl_cf |
| 494 | void operator+=(const Mtbl_cf & ) ; |
| 495 | /// -= Mtbl_cf |
| 496 | void operator-=(const Mtbl_cf & ) ; |
| 497 | /// *= double |
| 498 | void operator*=(double ) ; |
| 499 | /// /= double |
| 500 | void operator/=(double ) ; |
| 501 | |
| 502 | // Linear operators |
| 503 | // ---------------- |
| 504 | public: |
| 505 | /// \f${\partial \over \partial \xi} \f$ |
| 506 | void dsdx() ; |
| 507 | |
| 508 | /// \f${\partial^2\over \partial \xi^2} \f$ |
| 509 | void d2sdx2() ; |
| 510 | |
| 511 | /** \f${1 \over \xi} \f$ (\e r -sampling = \c RARE ) \\ |
| 512 | * Id (\e r sampling = \c FIN ) \\ |
| 513 | * \f${1 \over \xi-1} \f$ (\e r -sampling = \c UNSURR ) |
| 514 | */ |
| 515 | void sx() ; |
| 516 | |
| 517 | /** \f${1 \over \xi^2}\f$ (\e r -sampling = \c RARE ) \\ |
| 518 | * Id (\e r sampling = \c FIN ) \\ |
| 519 | * \f${1 \over (\xi-1)^2}\f$ (\e r -sampling = \c UNSURR ) |
| 520 | */ |
| 521 | void sx2() ; |
| 522 | |
| 523 | /** \f$\xi \, Id\f$ (\e r -sampling = \c RARE ) \\ |
| 524 | * Id (\e r sampling = \c FIN ) \\ |
| 525 | * \f$(\xi-1) \, Id \f$ (\e r -sampling = \c UNSURR ) |
| 526 | */ |
| 527 | void mult_x() ; |
| 528 | |
| 529 | /** Id (\e r sampling = \c RARE, FIN ) \\ |
| 530 | * \f${1 \over (\xi-1)}\f$ (\e r -sampling = \c UNSURR ) |
| 531 | */ |
| 532 | void sxm1_zec() ; |
| 533 | |
| 534 | /** Id (\e r sampling = \c RARE, FIN ) \\ |
| 535 | * \f$(\xi-1) \, Id\f$ (\e r -sampling = \c UNSURR ) |
| 536 | */ |
| 537 | void mult_xm1_zec() ; |
| 538 | |
| 539 | /** Id (\e r sampling = \c RARE, FIN ) \\ |
| 540 | * \f$(\xi-1)^2 \, Id\f$ (\e r -sampling = \c UNSURR ) |
| 541 | */ |
| 542 | void mult2_xm1_zec() ; |
| 543 | |
| 544 | /// \f${\partial \over \partial \theta}\f$ |
| 545 | void dsdt() ; |
| 546 | |
| 547 | /// \f${\partial^2 \over \partial \theta^2}\f$ |
| 548 | void d2sdt2() ; |
| 549 | |
| 550 | /// \f$Id\over\sin\theta\f$ |
| 551 | void ssint() ; |
| 552 | |
| 553 | /// \f$Id\over\cos\theta\f$ |
| 554 | void scost() ; |
| 555 | |
| 556 | /// \f$\cos\theta \, Id\f$ |
| 557 | void mult_ct() ; |
| 558 | |
| 559 | /// \f$\sin\theta \, Id\f$ |
| 560 | void mult_st() ; |
| 561 | |
| 562 | /// \f${\partial \over \partial \phi}\f$ |
| 563 | void dsdp() ; |
| 564 | |
| 565 | /// \f${\partial^2 \over \partial \phi^2}\f$ |
| 566 | void d2sdp2() ; |
| 567 | |
| 568 | /// \f$\cos\phi \, Id\f$ |
| 569 | void mult_cp() ; |
| 570 | |
| 571 | /// \f$\sin\phi \, Id\f$ |
| 572 | void mult_sp() ; |
| 573 | |
| 574 | /// Angular Laplacian |
| 575 | void lapang() ; |
| 576 | |
| 577 | // PDE resolution |
| 578 | //--------------- |
| 579 | public: |
| 580 | /** Resolution of the generalized angular Poisson equation. |
| 581 | * The generalized angular Poisson equation is |
| 582 | * \f$\Delta_{\theta\varphi} u + \lambda u = \sigma\f$, |
| 583 | * where \f$\Delta_{\theta\varphi} u := \frac{\partial^2 u} |
| 584 | * {\partial \theta^2} + \frac{1}{\tan \theta} \frac{\partial u} |
| 585 | * {\partial \theta} +\frac{1}{\sin^2 \theta}\frac{\partial^2 u} |
| 586 | * {\partial \varphi^2}\f$. |
| 587 | * |
| 588 | * Before the call to \c poisson_angu() , \c *this contains the |
| 589 | * coefficients of the source \f$\sigma\f$; after the call, it contains the |
| 590 | * coefficients of the solution \f$u\f$. |
| 591 | * |
| 592 | * @param lambda [input] coefficient \f$\lambda\f$ in the above equation |
| 593 | * (default value = 0) |
| 594 | */ |
| 595 | void poisson_angu(double lambda = 0) ; |
| 596 | |
| 597 | } ; |
| 598 | ostream& operator<<(ostream& , const Mtbl_cf& ) ; |
| 599 | |
| 600 | /** |
| 601 | * \defgroup mtbl_cf_mat Mtbl_cf Mathematics |
| 602 | * \ingroup (spec) |
| 603 | * |
| 604 | * @{ |
| 605 | */ |
| 606 | /// + Mtbl_cf |
| 607 | Mtbl_cf operator+(const Mtbl_cf& ) ; |
| 608 | /// \c - Mtbl_cf |
| 609 | Mtbl_cf operator-(const Mtbl_cf& ) ; |
| 610 | /// Mtbl_cf + Mtbl_cf |
| 611 | Mtbl_cf operator+(const Mtbl_cf&, const Mtbl_cf& ) ; |
| 612 | /// Mtbl_cf - Mtbl_cf |
| 613 | Mtbl_cf operator-(const Mtbl_cf&, const Mtbl_cf& ) ; |
| 614 | /// Mtbl_cf * double |
| 615 | Mtbl_cf operator*(const Mtbl_cf&, double ) ; |
| 616 | /// double * Mtbl_cf |
| 617 | Mtbl_cf operator*(double, const Mtbl_cf& ) ; |
| 618 | /// Mtbl_cf * int |
| 619 | Mtbl_cf operator*(const Mtbl_cf&, int ) ; |
| 620 | /// int * Mtbl_cf |
| 621 | Mtbl_cf operator*(int, const Mtbl_cf& ) ; |
| 622 | /// Mtbl_cf / double |
| 623 | Mtbl_cf operator/(const Mtbl_cf&, double ) ; |
| 624 | /// Mtbl_cf / int |
| 625 | Mtbl_cf operator/(const Mtbl_cf&, int ) ; |
| 626 | |
| 627 | /// Absolute value |
| 628 | Mtbl_cf abs(const Mtbl_cf& ) ; |
| 629 | |
| 630 | /** |
| 631 | * Maximum values of the \c Mtbl_cf elements in each domain. |
| 632 | * @return 1-D \c Tbl of size the number of domains, the elements of which |
| 633 | * are the set of the maximum values in each domain. |
| 634 | */ |
| 635 | Tbl max(const Mtbl_cf& ) ; |
| 636 | |
| 637 | /** |
| 638 | * Minimum values of the \c Mtbl_cf elements in each domain. |
| 639 | * @return 1-D \c Tbl of size the number of domains, the elements of which |
| 640 | * are the set of the minimum values in each domain. |
| 641 | */ |
| 642 | Tbl min(const Mtbl_cf& ) ; |
| 643 | |
| 644 | /** |
| 645 | * Sums of the absolute values of all the \c Mtbl_cf elements in each domain. |
| 646 | * @return 1-D \c Tbl of size the number of domains, the elements of which |
| 647 | * are the set of the sums of the absolute values in each domain. |
| 648 | */ |
| 649 | Tbl norme(const Mtbl_cf& ) ; |
| 650 | |
| 651 | /** |
| 652 | * Relative difference between two \c Mtbl_cf (norme version). |
| 653 | * @return 1-D \c Tbl of size the number of domains, the elements of which |
| 654 | * are \c norme[a(l)-b(l)]/norme[b(l)] if \c b(l)!=0 and |
| 655 | * \c norme[a(l)-b(l)] if \c b(l)=0 , where \c a(l) and |
| 656 | * \c b(l) denote symbolically the values of \c a and \c b |
| 657 | * in domain no. \c l . |
| 658 | */ |
| 659 | Tbl diffrel(const Mtbl_cf& a, const Mtbl_cf& b) ; |
| 660 | |
| 661 | /** |
| 662 | * Relative difference between two \c Mtbl_cf (max version). |
| 663 | * @return 1-D \c Tbl of size the number of domains, the elements of which |
| 664 | * are \c max[abs(a(l)-b(l))]/max[abs(b(l))] if \c b(l)!=0 and |
| 665 | * \c max[abs(a(l)-b(l))] if \c b(l)=0 , where \c a(l) and |
| 666 | * \c b(l) denote symbolically the values of \c a and \c b |
| 667 | * in domain no. \c l . |
| 668 | */ |
| 669 | Tbl diffrelmax(const Mtbl_cf& a, const Mtbl_cf& b) ; |
| 670 | |
| 671 | /**@} */ |
| 672 | |
| 673 | } |
| 674 | #endif |