| 1 | /* |
| 2 | * Definition of Lorene class Change_var |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * Copyright (c) 2003 Philippe Grandclement |
| 8 | * |
| 9 | * This file is part of LORENE. |
| 10 | * |
| 11 | * LORENE is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License version 2 |
| 13 | * as published by the Free Software Foundation. |
| 14 | * |
| 15 | * LORENE is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with LORENE; if not, write to the Free Software |
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | #ifndef __CHANGE_VAR_H_ |
| 27 | #define __CHANGE_VAR_H_ |
| 28 | |
| 29 | /* |
| 30 | * $Id: change_var.h,v 1.6 2014/10/13 08:52:32 j_novak Exp $ |
| 31 | * $Log: change_var.h,v $ |
| 32 | * Revision 1.6 2014/10/13 08:52:32 j_novak |
| 33 | * Lorene classes and functions now belong to the namespace Lorene. |
| 34 | * |
| 35 | * Revision 1.5 2004/06/22 08:49:56 p_grandclement |
| 36 | * Addition of everything needed for using the logarithmic mapping |
| 37 | * |
| 38 | * Revision 1.4 2004/05/14 08:51:00 p_grandclement |
| 39 | * *** empty log message *** |
| 40 | * |
| 41 | * Revision 1.3 2004/03/23 14:54:45 j_novak |
| 42 | * More documentation |
| 43 | * |
| 44 | * Revision 1.2 2004/03/05 09:18:48 p_grandclement |
| 45 | * Addition of operator sec_order_r2 |
| 46 | * |
| 47 | * Revision 1.1 2003/12/11 14:57:00 p_grandclement |
| 48 | * I had forgotten the .h (sorry folks...) |
| 49 | * |
| 50 | * |
| 51 | * $Header: /cvsroot/Lorene/C++/Include/change_var.h,v 1.6 2014/10/13 08:52:32 j_novak Exp $ |
| 52 | * |
| 53 | */ |
| 54 | |
| 55 | #include "proto.h" |
| 56 | |
| 57 | // Defines the various types of variable changes with the associated |
| 58 | // functions F, G, F' and G' |
| 59 | |
| 60 | #define STD 1 |
| 61 | double one (double) ; |
| 62 | double zero (double) ; |
| 63 | |
| 64 | #define W_BETA 2 |
| 65 | double ide (double) ; |
| 66 | |
| 67 | #define W_BETA_INF 3 |
| 68 | double part_ln (double) ; |
| 69 | double part_ln_der (double) ; |
| 70 | |
| 71 | #define H_BETA 4 |
| 72 | |
| 73 | #define LAMBDA_RN 5 |
| 74 | double plus_log(double) ; |
| 75 | double moins_sur(double) ; |
| 76 | |
| 77 | #define NU_RN 6 |
| 78 | double moins_log(double) ; |
| 79 | double plus_sur(double) ; |
| 80 | |
| 81 | namespace Lorene { |
| 82 | /** |
| 83 | * This class defines a variable change to be used when solving |
| 84 | * elliptic equations. In {\em one particular domain}, |
| 85 | * the change is defined as |
| 86 | * follows : \ingroup (ellip) |
| 87 | * |
| 88 | * \f$W = F\left(r\right) + G \left(r\right) w\f$ |
| 89 | * |
| 90 | * where \f$W\f$ is the usual variable, i.e. the one that is \f$\mathcal{C}^1\f$ |
| 91 | * and \f$w\f$ is the variable used for solving the elliptic equation. |
| 92 | * The functions \f$F\f$ and \f$G\f$ are arbitrary functions of \f$r\f$. |
| 93 | * The type of change must be explicitely implemented in the constructor for |
| 94 | * {\tt Change_var}. |
| 95 | * |
| 96 | **/ |
| 97 | |
| 98 | class Change_var { |
| 99 | |
| 100 | protected: |
| 101 | double (* func_F) (double) ; /// Pointer on the function \f$F\f$. |
| 102 | double (* der_F) (double) ; /// Pointer on the derivative of \f$F\f$. |
| 103 | double (* func_G) (double) ; /// Pointer on the function \f$G\f$. |
| 104 | double (* der_G) (double) ; /// Pointer on the derivative of \f$G\f$. |
| 105 | |
| 106 | double mult_F ; /// Multiplicative factor for F ## PROVISORY |
| 107 | double add_F ; /// Additive factor for F ## PROVISORY |
| 108 | |
| 109 | public: |
| 110 | |
| 111 | /** |
| 112 | * Standard constructor. Case with without parameter. |
| 113 | * {\tt var} defines explicitely the type of variable to be used. |
| 114 | * Are currently implemented : |
| 115 | * \begin{itemize} |
| 116 | * \item {\tt var} \f$= {\rm STD} \Longrightarrow F=0 \, \& \, G=1\f$. |
| 117 | * \item {\tt var} \f$= {\rm W\_BETA} \Longrightarrow F=1 \, \& \, G = r\f$. |
| 118 | * \item {\tt var} \f$= {\rm W\_BETA\_INF} \Longrightarrow F = 1+ \frac{1}{3}r^2\ln r \, \& \, G = r\f$. |
| 119 | * \item {\tt var} \f$= {\rm H\_BETA} \Longrightarrow F=1 \, \&\, G=1\f$. |
| 120 | * \item {\tt var} \f$= {\rm LAMBDA_RN} \Longrightarrow F=-\ln r \, \& \, G=1\f$. |
| 121 | * \item {\tt var} \f$= {\rm NU_RN} \Longrightarrow F=\ln r \, \& \, G=1\f$. |
| 122 | * \end{itemize} |
| 123 | **/ |
| 124 | |
| 125 | Change_var (int var) ; |
| 126 | |
| 127 | /** |
| 128 | * Standard constructor. Case with one multiplicative parameter for F |
| 129 | * {\tt var} defines explicitely the type of variable to be used. |
| 130 | **/ |
| 131 | |
| 132 | Change_var (int var, double) ; |
| 133 | |
| 134 | /** |
| 135 | * Standard constructor. Case with one multiplicative parameter for F and one additive. |
| 136 | * {\tt var} defines explicitely the type of variable to be used. |
| 137 | **/ |
| 138 | |
| 139 | Change_var (int var, double, double) ; |
| 140 | |
| 141 | |
| 142 | Change_var (const Change_var& so) ; /// Constructor by copy. |
| 143 | ~Change_var() ; /// Standard destructor. |
| 144 | |
| 145 | public: |
| 146 | double val_F (double x) ; /// Returns the value of \f$F\f$ at {\tt x}. |
| 147 | double val_der_F (double x) ; /// Returns the value of \f$F'\f$ at {\tt x}. |
| 148 | double val_G (double x) ; /// Returns the value of \f$G\f$ at {\tt x}. |
| 149 | double val_der_G (double x) ; /// Returns the value of \f$G'\f$ at {\tt x}. |
| 150 | } ; |
| 151 | |
| 152 | } |
| 153 | #endif |