Debian Codegraph @

C++/Include/excision_surf.h

raw symbols SCIP
1 /*
2 * Definition of Lorene class Excision_surf, friend class of Spheroid.
3 *
4 */
5
6 /*
7 * Copyright (c) 2008 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 __EXCISIONSURF_H_
27 #define __EXCISIONSURF_H_
28
29 /*
30 * $Header: /cvsroot/Lorene/C++/Include/excision_surf.h,v 1.7 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_surf {
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 /** The 2d expansion, directly evolved from the initial excision with Einstein Equations */
74 Scalar expa;
75
76 /** The time derivative of the expansion, derived from Einstein equations and arbitrary evolution */
77 Scalar dt_expa;
78
79
80 // Derived data :
81 // ------------
82 protected:
83
84 mutable Scalar* p_get_BC_conf_fact_1 ; ///< Source of Neumann boundary condition on \f$ \psi \f$,
85 mutable Scalar* p_get_BC_lapse_1 ; ///< Source of Dirichlet boundary condition of \f$ N \f$
86 mutable Vector* p_get_BC_shift_1 ; ///< Source of Dirichlet BC for the shift vector \f$ \beta^{i} \f$
87 mutable Scalar* p_get_BC_Npsi_1 ; ///< Source of Neumann boundary condition on \f$ \psi \f$.
88 mutable Scalar* p_get_BC_conf_fact_2 ; ///< Source of Neumann boundary condition on \f$ \psi \f$,
89 mutable Scalar* p_get_BC_conf_fact_3 ; ///< Source of Neumann boundary condition on \f$ \psi \f$,
90 mutable Scalar* p_get_BC_conf_fact_4 ; ///< Source of Birichlet boundary condition on \f$ \psi \f$,
91 mutable Scalar* p_get_BC_lapse_2 ; ///< Source of Dirichlet boundary condition of \f$ N \f$
92 mutable Scalar* p_get_BC_lapse_3 ; ///< Source of Dirichlet condtion on \f$ N \f$, based on einstein equations.
93 mutable Scalar* p_get_BC_lapse_4 ; ///< Source of Dirichlet condtion on \f$ N \f$, based on einstein equations (conservation of isotropic gauge)
94 mutable Scalar* p_derive_t_expa ; ///< Computation of an updated expansion scalar.
95 mutable Vector* p_get_BC_shift_2 ; ///< Source of Dirichlet BC for the shift vector \f$ \beta^{i} \f$
96 mutable Vector* p_get_BC_shift_3 ; ///< Source of Dirichlet BC for the shift vector \f$ \beta^{i} \f$, partly derived from kinematical relation
97 mutable Vector* p_get_BC_shift_4 ; ///< Source of Dirichlet BC for the shift vector \f$ \beta^{i} \f$, partly from projection of Einstein Equations
98 mutable Scalar* p_get_BC_Npsi_2 ; ///< Source of Dirichlet boundary condition on \f$ N \psi \f$.
99 mutable Scalar* p_get_BC_Npsi_3 ; ///< Source of Dirichlet boundary condition on \f$ N \psi \f$.
100 mutable Scalar* p_get_BC_Npsi_4 ; ///< Source of Dirichlet boundary condition on \f$ N \psi \f$.
101 mutable Scalar* p_get_BC_Npsi_5 ; ///< Source of Neumann boundary condition on \f$ N \psi \f$.
102
103
104 // Constructors - Destructor
105 // -------------------------
106 public:
107
108 /** Constructor of an excision surface embedded in a 3-slice (\c Time_slice ) of 3+1
109 * formalism.
110 * This is done from the \c Time_slice data.
111 * @param h_in : the location of the surface \e r = h_in (WARNING:must be
112 defined on a mono-domain angular grid)
113 * @param gij : the 3-metric on the 3slice
114 * @param Kij : the extrinsic curvature of the 3-slice
115 * (covariant representation)
116 * @param timestep : time interval associated with the parabolic-driven boundary conditions.
117 * @param int_nos : Number of iterations to be done during timestep.
118 */
119 Excision_surf(const Scalar& h_in, const Metric& gij, const Sym_tensor& Kij2, const Scalar& ppsi, const Scalar& nn, const Vector& beta, double timestep, int int_nos) ;
120 Excision_surf(const Excision_surf& ) ; ///< Copy constructor
121
122 /// Constructor from a file (see \c sauve(FILE*) )
123 Excision_surf(FILE* ) ;
124
125 virtual ~Excision_surf() ; ///< Destructor
126
127
128 // Memory management
129 // -----------------
130 protected:
131 /// Deletes all the derived quantities
132 virtual void del_deriv() const ;
133
134 /// Sets to \c 0x0 all the pointers on derived quantities
135 void set_der_0x0() const ;
136
137
138
139 // Mutators / assignment
140 // ---------------------
141 public:
142 /// Assignment to another Excision_surf
143 void operator=(const Excision_surf&) ;
144
145
146 // Functions/Accessors
147 //---------------------
148
149 /** Computes the parameters for the hyperbolic evolution in set_expa_hyperb(), so that the expansion has a C1 matching
150 * with initial data. Sets also values for expa() and dt_expa() accordingly with initial conditions */
151 void get_evol_params_from_ID(double alpha, double beta, double gamma, Scalar& Ee, Vector& Jj, Sym_tensor& Ss) ;
152
153 ///Sets a new value for expansion rescaled over lapse (and its derivative), obtained by parabolic evolution.
154 void set_expa_parab(double c_theta_lap, double c_theta_fin, Scalar& expa_fin) ;
155 /**Sets a new value for expansion rescaled over lapse (and its derivative), obtained by hyperbolic evolution.
156 * Parameters for the hyperbolic driver are determined by the function Excision_surf::get_evol_params_from_ID()
157 * so that the expansion stays of regularity $C^{1}$ throughout.
158 * All manipulated quantities are 2-dimensional.
159 */
160 void set_expa_hyperb(double alph0, double beta0, double gamma0) ;
161
162
163 // Accessors
164 // ---------
165 public:
166 /// Returns the spheroid
167 const Spheroid& get_sph() const {return sph; };
168
169 /// Returns the conformal factor associated with the surface
170 const Scalar& get_conf_fact() const {return conf_fact; } ;
171
172 /// Returns the lapse function
173 const Scalar& get_lapse() const {return lapse ; } ;
174
175 /// Returns the shift vector field.
176 const Vector& get_shift() const {return shift ; } ;
177
178 /// Returns the symmetric tensor \f$ gamij \f$
179 const Metric& get_gamij() const {return gamij ; } ;
180
181 /// returns the 3-d extrinsic curvature \f$ K_{ij}\f$
182 const Sym_tensor& get_Kij() const {return Kij ; } ;
183
184 /// Returns the timestep used for evolution.
185 double get_delta_t() const {return delta_t ;};
186
187 /// Returns the internal number of timesteps for one iteration.
188 double get_no_of_steps() const {return no_of_steps ;};
189
190 /// Returns the assumed expansion associated to the excised surface at t.
191 const Scalar & get_expa() const {return expa; };
192
193 /// Returns the assumed time derivative of the expansion at t, evolved by functions of this class;
194 const Scalar& get_dt_expa() const {return dt_expa;} ;
195
196 /// Sets a new spheroid from data
197 Spheroid& set_sph() {del_deriv() ; return sph ;};
198
199 /// Sets the value of the conformal factor
200 Scalar& set_conf_fact() {del_deriv() ; return conf_fact ; } ;
201
202 /// Sets the lapse function
203 Scalar& set_lapse() {del_deriv() ; return lapse ; } ;
204
205 /// Sets the shift vector field
206 Vector& set_shift() {del_deriv() ; return shift ; } ;
207
208 /// Sets the 3d metric of the TimeSlice
209 Metric& set_gamij() {del_deriv() ; return gamij ; } ;
210
211 /// Sets the extrinsic curvature
212 Sym_tensor& set_Kij() {del_deriv() ; return Kij ; } ;
213
214 double set_delta_t() {del_deriv() ; return delta_t ; } ;
215
216 double set_no_of_steps() {del_deriv() ; return no_of_steps ; } ;
217
218 /// Sets the expansion function on the surface at time t (considering to protect this function)
219
220 Scalar& set_expa() {del_deriv(); return expa;};
221
222 /// Sets the time derivative of the expansion function on the surface at time t (considering to protect this function)
223
224 Scalar& set_dt_expa() {del_deriv(); return dt_expa;};
225
226 // Computational functions
227 // -----------------------
228 public:
229 /// Source for a Neumann BC on the conformal factor. If boolean isMOTS is false, it is based on expansion value of the spheroid or the value of exppa; it is based on zero expansion if isMOTS is true.
230 const Scalar& get_BC_conf_fact_1(bool isMOTS = false) const ;
231 // Source for an arbitrary Dirichlet BC on the lapse
232 const Scalar& get_BC_lapse_1(double value) const ;
233 // Source for a global Dirichlet BC on the shift, imposing a conformal Killing symmetry on \f$ \varphi \f$.
234 const Vector& get_BC_shift_1(double Omega) const ;
235 // Source for a Dirichlet arbitrary BC on (N*Psi1)
236 const Scalar& get_BC_Npsi_1(double value) const ;
237 /// Source for the Dirichlet BC on the conformal factor, based on a parabolic driver for the conformal factor
238 const Scalar& get_BC_conf_fact_2(double c_psi_lap, double c_psi_fin, Scalar& expa_fin) const ;
239 /// Source for the Neumann BC on the conformal factor, based on a parabolic driver for the expansio
240 const Scalar& get_BC_conf_fact_3(double c_theta_lap, double c_theta_fin, Scalar& expa_fin) const ;
241 /// Source for the Dirchlet BC on the conformal factor, based on the consistency condition derived from the trace
242 const Scalar& get_BC_conf_fact_4() const ;
243 /// Source for Dirichlet BC on the lapse, based on a parabolic driver towards arbitrary constant value
244 const Scalar& get_BC_lapse_2(double lapse_fin, double c_lapse_lap, double c_lapse_fi) const ;
245 /// Source for Dirichlet BC on the lapse, based on einstein equations
246 const Scalar& get_BC_lapse_3(Scalar& dttheta, Scalar& Ee, Vector& Jj, Sym_tensor& Sij, bool sph_sym = true) const ;
247 /// Source for Dirichlet BC on the lapse, based on einstein equations (conservation of isotropic gauge)
248 const Scalar& get_BC_lapse_4 (Scalar& old_nn, Vector& beta_point, Sym_tensor& strain_tens) const ;
249 /// Forms the prospective time derivative for the expansion using projected Einstein equations. Does NOT modify the member dt_expa: do it by hand!
250 const Scalar& derive_t_expa(Scalar& Ee, Vector& Jj, Sym_tensor& Sij) const;
251 /// Source for a Dirichlet BC on the shift, based on a Parabolic driver; no assumptions are made except a global conformal Killing symmetry.
252 const Vector& get_BC_shift_2(double c_bb_lap, double c_bb_fin, double c_V_lap, double epsilon) const ;
253 /// Source for a Dirichlet BC on the shift, based on a Parabolic driver; Radial part is dealt with using a kinematical relation.
254 const Vector& get_BC_shift_3(Scalar& dtpsi, double c_V_lap, double epsilon) const ;
255 /// Source for a Dirichlet BC on the shift, based on a Parabolic driver; Radial part is dealt with using projection of Einstein Equations.
256 const Vector & get_BC_shift_4(Scalar& dttheta, Scalar& Ee, Vector& Jj, Sym_tensor& Sij, double c_V_lap, double epsilon, bool sph_sym= true) const ;
257 /// Source for the Dirichlet BC on (N*Psi1), based on a parabolic driver.
258 const Scalar& get_BC_Npsi_2(double value, double c_npsi_lap, double c_npsi_fin) const ;
259 /// Source for the Dirichlet BC on (N*Psi1), with Kerr_Schild-like form for the lapse boundary.
260 const Scalar& get_BC_Npsi_3(double n_0, double beta) const ;
261 /// Source for a Dirichlet BC on (N*Psi1), fixing a constant surface gravity in space and time.
262 const Scalar& get_BC_Npsi_4(double Kappa) const ;
263 /// Source for a Neumann BC on (N*Psi1), fixing a constant surface gravity in space and time.
264 const Scalar& get_BC_Npsi_5(double Kappa) const ;
265 // Outputs
266 // -------
267 public:
268 virtual void sauve(FILE *) const ; ///< Save in a file
269
270 /// Display
271 friend ostream& operator<<(ostream& , const Spheroid& ) ;
272
273 };
274
275 ostream& operator<<(ostream& , const Spheroid& ) ;
276
277
278 }
279 #endif