| 1 | /* |
| 2 | * Definition of Lorene class Excision_hor, friend class of Spheroid. |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * Copyright (c) 2009 Jose-Luis Jaramillo & Nicolas Vasset |
| 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 __EXCISIONHOR_H_ |
| 27 | #define __EXCISIONHOR_H_ |
| 28 | |
| 29 | /* |
| 30 | * $Header: /cvsroot/Lorene/C++/Include/excision_hor.h,v 1.3 2014/10/13 08:52:34 j_novak Exp $ |
| 31 | * |
| 32 | */ |
| 33 | #include "metric.h" |
| 34 | #include "spheroid.h" |
| 35 | |
| 36 | namespace Lorene { |
| 37 | /** |
| 38 | * Surface where boundary conditions for quantities in the bulk will be calculated |
| 39 | * It relies on geometrical properties of the associated Spheroid\ingroup (star) |
| 40 | * (*** WARNING! under development***) |
| 41 | * |
| 42 | */ |
| 43 | class Excision_hor { |
| 44 | |
| 45 | |
| 46 | // Data : |
| 47 | // ----- |
| 48 | protected: |
| 49 | /// The associated Spheroid object |
| 50 | Spheroid sph ; |
| 51 | |
| 52 | ///The value of the conformal factor on the 3-slice |
| 53 | Scalar conf_fact ; |
| 54 | |
| 55 | /** The lapse defined on the 3 slice*/ |
| 56 | Scalar lapse ; |
| 57 | |
| 58 | /** The Shift 3-vector on the slice **/ |
| 59 | Vector shift ; |
| 60 | |
| 61 | /** The 3-d metric on the slice*/ |
| 62 | Metric gamij ; |
| 63 | |
| 64 | /** The 3-d extrinsic curvature on the slice */ |
| 65 | Sym_tensor Kij ; |
| 66 | |
| 67 | /** The time step for evolution in parabolic drivers */ |
| 68 | double delta_t; |
| 69 | |
| 70 | /** The internal number of timesteps for one iteration. */ |
| 71 | double no_of_steps; |
| 72 | |
| 73 | /** Value of the impulsion-energy tensor on the spheroid */ |
| 74 | Sym_tensor Tij; |
| 75 | |
| 76 | |
| 77 | // Derived data : |
| 78 | // ------------ |
| 79 | protected: |
| 80 | mutable Scalar* p_get_BC_conf_fact ; ///< Source of Neumann BC on \f$ \psi \f$, derived from the vanishing expansion |
| 81 | mutable Scalar* p_get_BC_bmN ; ///< Source of Dirichlet BC for (b-N). |
| 82 | mutable Scalar* p_get_BC_bpN ; ///< Arbitrary source of Dirichlet BC for (b+N), case 0: based on a parabolic driver towards a constant value, case 1:from a component of projected Einstein Equations. . |
| 83 | mutable Vector* p_get_BC_shift ; ///< Source of Dirichlet BC for the shift, issued from BC on bpN and a gauge condition on the tangential shift. |
| 84 | |
| 85 | |
| 86 | // Constructors - Destructor |
| 87 | // ------------------------- |
| 88 | public: |
| 89 | |
| 90 | /** Constructor of an excision surface embedded in a 3-slice (\c Time_slice ) of 3+1 |
| 91 | * formalism. |
| 92 | * This is done from the \c Time_slice data. |
| 93 | * @param h_in : the location of the surface \e r = h_in (WARNING:must be |
| 94 | defined on a mono-domain angular grid) |
| 95 | * @param gij : the 3-metric on the 3-slice |
| 96 | * @param Kij : the extrinsic curvature of the 3-slice |
| 97 | * (covariant representation) |
| 98 | * @param timestep : time interval associated with the parabolic-driven boundary conditions. |
| 99 | * @param int_nos : Number of iterations to be done during timestep. |
| 100 | * @param Tij : Value of the impulsion-energy tensor on the spheroid |
| 101 | */ |
| 102 | Excision_hor(const Scalar& h_in, const Metric& gij, const Sym_tensor& Kij2, const Scalar& ppsi, const Scalar& nn, const Vector& beta,const Sym_tensor& Tij2, double timestep, int int_nos = 1) ; |
| 103 | Excision_hor(const Excision_hor& ) ; ///< Copy constructor |
| 104 | |
| 105 | /// Constructor from a file (see \c sauve(FILE*) ) |
| 106 | Excision_hor(FILE* ) ; |
| 107 | |
| 108 | virtual ~Excision_hor() ; ///< Destructor |
| 109 | |
| 110 | |
| 111 | // Memory management |
| 112 | // ----------------- |
| 113 | protected: |
| 114 | /// Deletes all the derived quantities |
| 115 | virtual void del_deriv() const ; |
| 116 | |
| 117 | /// Sets to \c 0x0 all the pointers on derived quantities |
| 118 | void set_der_0x0() const ; |
| 119 | |
| 120 | |
| 121 | // Mutators / assignment |
| 122 | // --------------------- |
| 123 | public: |
| 124 | /// Assignment to another Excision_hor |
| 125 | void operator=(const Excision_hor&) ; |
| 126 | |
| 127 | |
| 128 | // Accessors |
| 129 | // --------- |
| 130 | public: |
| 131 | /// Returns the spheroid |
| 132 | const Spheroid& get_sph() const {return sph; }; |
| 133 | |
| 134 | /// Returns the conformal factor associated with the surface |
| 135 | const Scalar& get_conf_fact() const {return conf_fact; } ; |
| 136 | |
| 137 | /// Returns the lapse function |
| 138 | const Scalar& get_lapse() const {return lapse ; } ; |
| 139 | |
| 140 | /// Returns the shift vector field. |
| 141 | const Vector& get_shift() const {return shift ; } ; |
| 142 | |
| 143 | /// Returns the symmetric tensor \f$ gamij \f$ |
| 144 | const Metric& get_gamij() const {return gamij ; } ; |
| 145 | |
| 146 | /// returns the 3-d extrinsic curvature \f$ K_{ij}\f$ |
| 147 | const Sym_tensor& get_Kij() const {return Kij ; } ; |
| 148 | |
| 149 | /// Returns the timestep used for evolution. |
| 150 | double get_delta_t() const {return delta_t ;}; |
| 151 | |
| 152 | /// Returns the internal number of timesteps for one iteration. |
| 153 | double get_no_of_steps() const {return no_of_steps ;}; |
| 154 | |
| 155 | /// Returns the value of the impulsion-energy tensor |
| 156 | const Sym_tensor& get_Tij() const{return Tij; } ; |
| 157 | |
| 158 | /// Sets the value of the conformal factor |
| 159 | Scalar& set_conf_fact() {del_deriv() ; return conf_fact ; } ; |
| 160 | |
| 161 | /// Sets the lapse function |
| 162 | Scalar& set_lapse() {del_deriv() ; return lapse ; } ; |
| 163 | |
| 164 | /// Sets the shift vector field |
| 165 | Vector& set_shift() {del_deriv() ; return shift ; } ; |
| 166 | |
| 167 | /// Sets the 3d metric of the TimeSlice |
| 168 | Metric& set_gamij() {del_deriv() ; return gamij ; } ; |
| 169 | |
| 170 | /// Sets the extrinsic curvature |
| 171 | Sym_tensor& set_Kij() {del_deriv() ; return Kij ; } ; |
| 172 | |
| 173 | /// Sets the value of the impulsion-energy tensor |
| 174 | Sym_tensor& set_Tij() {del_deriv() ; return Tij; } ; |
| 175 | |
| 176 | |
| 177 | double& set_delta_t() {del_deriv() ; return delta_t ; } ; |
| 178 | |
| 179 | double& set_no_of_steps() {del_deriv() ; return no_of_steps ; } ; |
| 180 | |
| 181 | |
| 182 | // Computational functions |
| 183 | // ----------------------- |
| 184 | public: |
| 185 | |
| 186 | /// Source of Neumann BC on \f$ \psi \f$, derived from the vanishing expansion. |
| 187 | const Scalar& get_BC_conf_fact() const ; |
| 188 | /// Source of Dirichlet BC for (b-N): case 0: based on an entropy prescription, case 1: from a component of projected Einstein Equations. |
| 189 | const Scalar& get_BC_bmN(int choice_bmN, double value = 1.) const ; |
| 190 | ///Case 0: Arbitrary source of Dirichlet BC for (b+N), based on a parabolic driver towards a constant value. |
| 191 | ///Case 1: Source of Dirichlet BC for (b+N), from a component of projected Einstein Equations. |
| 192 | const Scalar& get_BC_bpN(int choice_bpN, double c_bpn_lap = 1., double c_bpn_fin = 1., Scalar *bpN_fin = 0x0) const ; |
| 193 | /// Source of Dirichlet BC for the shift, issued from BC on bpN and a gauge condition on the tangential shift (based on a parabolic driver). |
| 194 | const Vector& get_BC_shift(double c_V_lap) const ; |
| 195 | |
| 196 | // Outputs |
| 197 | // ------- |
| 198 | public: |
| 199 | virtual void sauve(FILE *) const ; ///< Save in a file |
| 200 | |
| 201 | /// Display |
| 202 | friend ostream& operator<<(ostream& , const Spheroid& ) ; |
| 203 | |
| 204 | }; |
| 205 | |
| 206 | ostream& operator<<(ostream& , const Spheroid& ) ; |
| 207 | |
| 208 | |
| 209 | } |
| 210 | #endif |