KADATH
domain_shell_export_tau_boundary.cpp
1 /*
2  Copyright 2017 Philippe Grandclement
3 
4  This file is part of Kadath.
5 
6  Kadath is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Kadath is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Kadath. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "headcpp.hpp"
21 
22 #include "spheric.hpp"
23 #include "scalar.hpp"
24 #include "tensor_impl.hpp"
25 #include "tensor.hpp"
26 
27 namespace Kadath {
28 
29 void Domain_shell::export_tau_val_domain_boundary_mquant (const Val_domain& so, int mquant, int bound, Array<double>& sec, int& pos_sec, int ncond) const {
30 
31  if (so.check_if_zero())
32  pos_sec += ncond ;
33  else {
34  so.coef() ;
35  Index pos_cf (nbr_coefs) ;
36  Index pos_galerkin (nbr_coefs) ;
37 
38  // Loop on theta
39  int baset = (*so.get_base().bases_1d[1]) (0) ;
40  for (int j=0 ; j<nbr_coefs(1) ; j++) {
41  pos_cf.set(1) = j ;
42  switch (baset) {
43  case COS_EVEN:
44  if (mquant==0) {
45  sec.set(pos_sec) = val_boundary(bound, so, pos_cf) ;
46  pos_sec ++ ;
47  }
48  else if (j!=0) {
49  // Galerkin base
50  pos_galerkin = pos_cf ;
51  pos_galerkin.set(1) = 0 ;
52  sec.set(pos_sec) = val_boundary(bound, so, pos_cf)
53  -2.*val_boundary(bound, so, pos_galerkin) ;
54  pos_sec ++ ;
55  }
56  break ;
57  case COS_ODD:
58  if (j!=nbr_coefs(1)-1) {
59  if (mquant==0) {
60  sec.set(pos_sec) = val_boundary(bound, so, pos_cf) ;
61  pos_sec ++ ;
62  }
63  else if (j!=0) {
64  // Galerkin base
65  pos_galerkin = pos_cf ;
66  pos_galerkin.set(1) = 0 ;
67  sec.set(pos_sec) = val_boundary(bound, so, pos_cf)
68  -val_boundary(bound, so, pos_galerkin) ;
69  pos_sec ++ ;
70  }}
71  break ;
72  case SIN_EVEN:
73  if ((j!=0) && (j!=nbr_coefs(1)-1)) {
74  if (mquant<=1) {
75  sec.set(pos_sec) = val_boundary(bound, so, pos_cf) ;
76  pos_sec ++ ;
77  }
78  else if (j!=1) {
79  pos_galerkin = pos_cf ;
80  pos_galerkin.set(1) = 1 ;
81  sec.set(pos_sec) = val_boundary(bound, so, pos_cf)
82  -j*val_boundary(bound, so, pos_galerkin) ;
83  pos_sec ++ ;
84  }}
85  break ;
86  case SIN_ODD:
87  if (j!=nbr_coefs(1)-1) {
88  if (mquant<=1) {
89  sec.set(pos_sec) = val_boundary(bound, so, pos_cf) ;
90  pos_sec ++ ;
91  }
92  else if (j!=0) {
93  pos_galerkin = pos_cf ;
94  pos_galerkin.set(1) = 0 ;
95  sec.set(pos_sec) = val_boundary(bound, so, pos_cf)
96  -(2*j+1)*val_boundary(bound, so, pos_galerkin) ;
97  pos_sec ++ ;
98  }}
99 
100  break ;
101  default:
102  cerr << "Unknow theta basis in Domain_shell::export_tau_val_domain_boundary_mquant" << endl ;
103  abort() ;
104  }
105  }
106  }
107 }
108 
109 void Domain_shell::export_tau_val_domain_boundary (const Val_domain& so, int mlim, int bound, Array<double>& sec, int& pos_sec, int ncond) const {
110 
111  if (so.check_if_zero())
112  pos_sec += ncond ;
113  else {
114  so.coef() ;
115  int kmin = 2*mlim + 2 ;
116  Index pos_cf (nbr_coefs) ;
117  Index pos_galerkin (nbr_coefs) ;
118 
119  // Loop on phi :
120  for (int k=0 ; k<nbr_coefs(2)-1 ; k++)
121  if (k!=1) {
122  pos_cf.set(2) = k ;
123  // Loop on theta
124  int baset = (*so.get_base().bases_1d[1]) (k) ;
125  for (int j=0 ; j<nbr_coefs(1) ; j++) {
126  pos_cf.set(1) = j ;
127  switch (baset) {
128  case COS_EVEN:
129  if (k<kmin) {
130  sec.set(pos_sec) = val_boundary(bound, so, pos_cf) ;
131  pos_sec ++ ;
132  }
133  else if (j!=0) {
134  // Galerkin base
135  pos_galerkin = pos_cf ;
136  pos_galerkin.set(1) = 0 ;
137  sec.set(pos_sec) = val_boundary(bound, so, pos_cf)
138  -2.*val_boundary(bound, so, pos_galerkin) ;
139  pos_sec ++ ;
140  }
141  break ;
142  case COS_ODD:
143  if (j!=nbr_coefs(1)-1) {
144  if (k<kmin) {
145  sec.set(pos_sec) = val_boundary(bound, so, pos_cf) ;
146  pos_sec ++ ;
147  }
148  else if (j!=0) {
149  // Galerkin base
150  pos_galerkin = pos_cf ;
151  pos_galerkin.set(1) = 0 ;
152  sec.set(pos_sec) = val_boundary(bound, so, pos_cf)
153  -val_boundary(bound, so, pos_galerkin) ;
154  pos_sec ++ ;
155  }}
156  break ;
157  case SIN_EVEN:
158  if ((j!=0) && (j!=nbr_coefs(1)-1)) {
159  if (k<kmin+2) {
160  sec.set(pos_sec) = val_boundary(bound, so, pos_cf) ;
161  pos_sec ++ ;
162  }
163  else if (j!=1) {
164  // Galerkin
165  pos_galerkin = pos_cf ;
166  pos_galerkin.set(1) = 1 ;
167  sec.set(pos_sec) = val_boundary(bound, so, pos_cf)
168  -j*val_boundary(bound, so, pos_galerkin) ;
169  pos_sec ++ ;
170 
171  }
172  }
173  break ;
174  case SIN_ODD:
175  if (j!=nbr_coefs(1)-1) {
176  if (k<kmin+2) {
177  sec.set(pos_sec) = val_boundary(bound, so, pos_cf) ;
178  pos_sec ++ ;
179  }
180  else if (j!=0) {
181  // Galerkin
182  pos_galerkin = pos_cf ;
183  pos_galerkin.set(1) = 0 ;
184  sec.set(pos_sec) = val_boundary(bound, so, pos_cf)
185  -(2*j+1)*val_boundary(bound, so, pos_galerkin) ;
186  pos_sec ++ ;
187 
188  }
189  }
190  break ;
191  default:
192  cerr << "Unknow theta basis in Domain_shell::export_tau_val_domain_boundary" << endl ;
193  abort() ;
194  }
195  }
196  }
197  }
198 }
199 
200 void Domain_shell::export_tau_boundary (const Tensor& tt, int dom, int bound, Array<double>& res, int& pos_res, const Array<int>& ncond,
201  int n_cmp, Array<int>** p_cmp) const {
202 
203  // Check boundary
204  if ((bound!=INNER_BC) && (bound!=OUTER_BC)) {
205  cerr << "Unknown boundary in Domain_shell::export_tau_boundary" << endl ;
206  abort() ;
207  }
208 
209  int val = tt.get_valence() ;
210  switch (val) {
211  case 0 :
212  if (tt.is_m_quant_affected()) {
213  // Special case for bosonic field
214  export_tau_val_domain_boundary_mquant (tt()(dom), tt.get_parameters().get_m_quant(), bound, res, pos_res, ncond(0)) ;
215  }
216  else {
217  if (!tt.is_m_order_affected())
218  export_tau_val_domain_boundary (tt()(dom), 0, bound, res, pos_res, ncond(0)) ;
219  else
220  export_tau_val_domain_boundary (tt()(dom), tt.get_parameters().get_m_order(), bound, res, pos_res, ncond(0)) ;
221  }
222  break ;
223  case 1 : {
224  bool found = false ;
225  // Cartesian basis
226  if (tt.get_basis().get_basis(dom)==CARTESIAN_BASIS) {
227  if (n_cmp==-1) {
228  export_tau_val_domain_boundary (tt(1)(dom), 0, bound, res, pos_res, ncond(0)) ;
229  export_tau_val_domain_boundary (tt(2)(dom), 0, bound, res, pos_res, ncond(1)) ;
230  export_tau_val_domain_boundary (tt(3)(dom), 0, bound, res, pos_res, ncond(2)) ;
231  }
232  else for (int i=0 ; i<n_cmp ; i++) {
233  if ((*p_cmp[i])(0)==1)
234  export_tau_val_domain_boundary (tt(1)(dom), 0, bound, res, pos_res, ncond(i)) ;
235  if ((*p_cmp[i])(0)==2)
236  export_tau_val_domain_boundary (tt(2)(dom), 0, bound, res, pos_res, ncond(i)) ;
237  if ((*p_cmp[i])(0)==3)
238  export_tau_val_domain_boundary (tt(3)(dom), 0, bound, res, pos_res, ncond(i)) ;
239  }
240  found = true ;
241  }
242  // Spherical coordinates
243  if (tt.get_basis().get_basis(dom)==SPHERICAL_BASIS) {
244  if (n_cmp==-1) {
245  export_tau_val_domain_boundary (tt(1)(dom), 0, bound, res, pos_res, ncond(0)) ;
246  export_tau_val_domain_boundary (tt(2)(dom), 1, bound, res, pos_res, ncond(1)) ;
247  export_tau_val_domain_boundary (tt(3)(dom), 1, bound, res, pos_res, ncond(2)) ;
248  }
249  else for (int i=0 ; i<n_cmp ; i++) {
250  if ((*p_cmp[i])(0)==1)
251  export_tau_val_domain_boundary (tt(1)(dom), 0, bound, res, pos_res, ncond(i)) ;
252  if ((*p_cmp[i])(0)==2)
253  export_tau_val_domain_boundary (tt(2)(dom), 1, bound, res, pos_res, ncond(i)) ;
254  if ((*p_cmp[i])(0)==3)
255  export_tau_val_domain_boundary (tt(3)(dom), 1, bound, res, pos_res, ncond(i)) ;
256  }
257  found = true ;
258  }// MTZ coordinates
259  if (tt.get_basis().get_basis(dom)==MTZ_BASIS) {
260  if (n_cmp==-1) {
261  export_tau_val_domain_boundary (tt(1)(dom), 0, bound, res, pos_res, ncond(0)) ;
262  export_tau_val_domain_boundary (tt(2)(dom), 1, bound, res, pos_res, ncond(1)) ;
263  export_tau_val_domain_boundary (tt(3)(dom), 1, bound, res, pos_res, ncond(2)) ;
264  }
265  else for (int i=0 ; i<n_cmp ; i++) {
266  if ((*p_cmp[i])(0)==1)
267  export_tau_val_domain_boundary (tt(1)(dom), 0, bound, res, pos_res, ncond(i)) ;
268  if ((*p_cmp[i])(0)==2)
269  export_tau_val_domain_boundary (tt(2)(dom), 1, bound, res, pos_res, ncond(i)) ;
270  if ((*p_cmp[i])(0)==3)
271  export_tau_val_domain_boundary (tt(3)(dom), 1, bound, res, pos_res, ncond(i)) ;
272  }
273  found = true ;
274  }
275  if (!found) {
276  cerr << "Unknown type of vector Domain_shell::export_tau_boundary" << endl ;
277  abort() ;
278  }
279  }
280  break ;
281  case 2 : {
282  bool found = false ;
283  // Cartesian basis and symetric
284  if ((tt.get_basis().get_basis(dom)==CARTESIAN_BASIS) && (tt.get_n_comp()==6)) {
285  if (n_cmp==-1) {
286  export_tau_val_domain_boundary (tt(1,1)(dom), 0, bound, res, pos_res, ncond(0)) ;
287  export_tau_val_domain_boundary (tt(1,2)(dom), 0, bound, res, pos_res, ncond(1)) ;
288  export_tau_val_domain_boundary (tt(1,3)(dom), 0, bound, res, pos_res, ncond(2)) ;
289  export_tau_val_domain_boundary (tt(2,2)(dom), 0, bound, res, pos_res, ncond(3)) ;
290  export_tau_val_domain_boundary (tt(2,3)(dom), 0, bound, res, pos_res, ncond(4)) ;
291  export_tau_val_domain_boundary (tt(3,3)(dom), 0, bound, res, pos_res, ncond(5)) ;
292  }
293  else for (int i=0 ; i<n_cmp ; i++) {
294  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
295  export_tau_val_domain_boundary (tt(1, 1)(dom), 0, bound, res, pos_res, ncond(i)) ;
296  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
297  export_tau_val_domain_boundary (tt(1, 2)(dom), 0, bound, res, pos_res, ncond(i)) ;
298  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
299  export_tau_val_domain_boundary (tt(1, 3)(dom), 0, bound, res, pos_res, ncond(i)) ;
300  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
301  export_tau_val_domain_boundary (tt(2, 2)(dom), 0, bound, res, pos_res, ncond(i)) ;
302  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
303  export_tau_val_domain_boundary (tt(2, 3)(dom), 0, bound, res, pos_res, ncond(i)) ;
304  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
305  export_tau_val_domain_boundary (tt(3, 3)(dom), 0, bound, res, pos_res, ncond(i)) ;
306  }
307  found = true ;
308  }
309  // Cartesian basis and not symetric
310  if ((tt.get_basis().get_basis(dom)==CARTESIAN_BASIS) && (tt.get_n_comp()==9)) {
311  if (n_cmp==-1) {
312  export_tau_val_domain_boundary (tt(1,1)(dom), 0, bound, res, pos_res, ncond(0)) ;
313  export_tau_val_domain_boundary (tt(1,2)(dom), 0, bound, res, pos_res, ncond(1)) ;
314  export_tau_val_domain_boundary (tt(1,3)(dom), 0, bound, res, pos_res, ncond(2)) ;
315  export_tau_val_domain_boundary (tt(2,1)(dom), 0, bound, res, pos_res, ncond(3)) ;
316  export_tau_val_domain_boundary (tt(2,2)(dom), 0, bound, res, pos_res, ncond(4)) ;
317  export_tau_val_domain_boundary (tt(2,3)(dom), 0, bound, res, pos_res, ncond(5)) ;
318  export_tau_val_domain_boundary (tt(3,1)(dom), 0, bound, res, pos_res, ncond(6)) ;
319  export_tau_val_domain_boundary (tt(3,2)(dom), 0, bound, res, pos_res, ncond(7)) ;
320  export_tau_val_domain_boundary (tt(3,3)(dom), 0, bound, res, pos_res, ncond(8)) ;
321 
322  }
323  else for (int i=0 ; i<n_cmp ; i++) {
324  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
325  export_tau_val_domain_boundary (tt(1, 1)(dom), 0, bound, res, pos_res, ncond(i)) ;
326  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
327  export_tau_val_domain_boundary (tt(1, 2)(dom), 0, bound, res, pos_res, ncond(i)) ;
328  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
329  export_tau_val_domain_boundary (tt(1, 3)(dom), 0, bound, res, pos_res, ncond(i)) ;
330  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==1))
331  export_tau_val_domain_boundary (tt(2, 1)(dom), 0, bound, res, pos_res, ncond(i)) ;
332  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
333  export_tau_val_domain_boundary (tt(2, 2)(dom), 0, bound, res, pos_res, ncond(i)) ;
334  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
335  export_tau_val_domain_boundary (tt(2, 3)(dom), 0, bound, res, pos_res, ncond(i)) ;
336  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==1))
337  export_tau_val_domain_boundary (tt(3, 1)(dom), 0, bound, res, pos_res, ncond(i)) ;
338  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==2))
339  export_tau_val_domain_boundary (tt(3, 2)(dom), 0, bound, res, pos_res, ncond(i)) ;
340  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
341  export_tau_val_domain_boundary (tt(3, 3)(dom), 0, bound, res, pos_res, ncond(i)) ;
342  }
343  found = true ;
344  }
345  // Spherical coordinates and symetric
346  if ((tt.get_basis().get_basis(dom)==SPHERICAL_BASIS) && (tt.get_n_comp()==6)) {
347  if (n_cmp==-1) {
348  export_tau_val_domain_boundary (tt(1,1)(dom), 0, bound, res, pos_res, ncond(0)) ;
349  export_tau_val_domain_boundary (tt(1,2)(dom), 1, bound, res, pos_res, ncond(1)) ;
350  export_tau_val_domain_boundary (tt(1,3)(dom), 1, bound, res, pos_res, ncond(2)) ;
351  export_tau_val_domain_boundary (tt(2,2)(dom), 2, bound, res, pos_res, ncond(3)) ;
352  export_tau_val_domain_boundary (tt(2,3)(dom), 2, bound, res, pos_res, ncond(4)) ;
353  export_tau_val_domain_boundary (tt(3,3)(dom), 2, bound, res, pos_res, ncond(5)) ;
354  }
355  else for (int i=0 ; i<n_cmp ; i++) {
356  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
357  export_tau_val_domain_boundary (tt(1, 1)(dom), 0, bound, res, pos_res, ncond(i)) ;
358  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
359  export_tau_val_domain_boundary (tt(1, 2)(dom), 1, bound, res, pos_res, ncond(i)) ;
360  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
361  export_tau_val_domain_boundary (tt(1, 3)(dom), 1, bound, res, pos_res, ncond(i)) ;
362  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
363  export_tau_val_domain_boundary (tt(2, 2)(dom), 2, bound, res, pos_res, ncond(i)) ;
364  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
365  export_tau_val_domain_boundary (tt(2, 3)(dom), 2, bound, res, pos_res, ncond(i)) ;
366  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
367  export_tau_val_domain_boundary (tt(3, 3)(dom), 2, bound, res, pos_res, ncond(i)) ;
368  }
369  found = true ;
370  }
371  // Spherical coordinates and not symetric
372  if ((tt.get_basis().get_basis(dom)==SPHERICAL_BASIS) && (tt.get_n_comp()==9)) {
373  if (n_cmp==-1) {
374  export_tau_val_domain_boundary (tt(1,1)(dom), 0, bound, res, pos_res, ncond(0)) ;
375  export_tau_val_domain_boundary (tt(1,2)(dom), 1, bound, res, pos_res, ncond(1)) ;
376  export_tau_val_domain_boundary (tt(1,3)(dom), 1, bound, res, pos_res, ncond(2)) ;
377  export_tau_val_domain_boundary (tt(2,1)(dom), 1, bound, res, pos_res, ncond(3)) ;
378  export_tau_val_domain_boundary (tt(2,2)(dom), 2, bound, res, pos_res, ncond(4)) ;
379  export_tau_val_domain_boundary (tt(2,3)(dom), 2, bound, res, pos_res, ncond(5)) ;
380  export_tau_val_domain_boundary (tt(3,1)(dom), 1, bound, res, pos_res, ncond(6)) ;
381  export_tau_val_domain_boundary (tt(3,2)(dom), 2, bound, res, pos_res, ncond(7)) ;
382  export_tau_val_domain_boundary (tt(3,3)(dom), 2, bound, res, pos_res, ncond(8)) ;
383  }
384  else for (int i=0 ; i<n_cmp ; i++) {
385  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
386  export_tau_val_domain_boundary (tt(1, 1)(dom), 0, bound, res, pos_res, ncond(i)) ;
387  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
388  export_tau_val_domain_boundary (tt(1, 2)(dom), 1, bound, res, pos_res, ncond(i)) ;
389  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
390  export_tau_val_domain_boundary (tt(1, 3)(dom), 1, bound, res, pos_res, ncond(i)) ;
391  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==1))
392  export_tau_val_domain_boundary (tt(2, 1)(dom), 1, bound, res, pos_res, ncond(i)) ;
393  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
394  export_tau_val_domain_boundary (tt(2, 2)(dom), 2, bound, res, pos_res, ncond(i)) ;
395  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
396  export_tau_val_domain_boundary (tt(2, 3)(dom), 2, bound, res, pos_res, ncond(i)) ;
397  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==1))
398  export_tau_val_domain_boundary (tt(3, 1)(dom), 1, bound, res, pos_res, ncond(i)) ;
399  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==2))
400  export_tau_val_domain_boundary (tt(3, 2)(dom), 2, bound, res, pos_res, ncond(i)) ;
401  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
402  export_tau_val_domain_boundary (tt(3, 3)(dom), 2, bound, res, pos_res, ncond(i)) ;
403  }
404  found = true ;
405  }
406  // MTZ coordinates and symetric
407  if ((tt.get_basis().get_basis(dom)==MTZ_BASIS) && (tt.get_n_comp()==6)) {
408  if (n_cmp==-1) {
409  export_tau_val_domain_boundary (tt(1,1)(dom), 0, bound, res, pos_res, ncond(0)) ;
410  export_tau_val_domain_boundary (tt(1,2)(dom), 1, bound, res, pos_res, ncond(1)) ;
411  export_tau_val_domain_boundary (tt(1,3)(dom), 1, bound, res, pos_res, ncond(2)) ;
412  export_tau_val_domain_boundary (tt(2,2)(dom), 2, bound, res, pos_res, ncond(3)) ;
413  export_tau_val_domain_boundary (tt(2,3)(dom), 2, bound, res, pos_res, ncond(4)) ;
414  export_tau_val_domain_boundary (tt(3,3)(dom), 2, bound, res, pos_res, ncond(5)) ;
415  }
416  else for (int i=0 ; i<n_cmp ; i++) {
417  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
418  export_tau_val_domain_boundary (tt(1, 1)(dom), 0, bound, res, pos_res, ncond(i)) ;
419  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
420  export_tau_val_domain_boundary (tt(1, 2)(dom), 1, bound, res, pos_res, ncond(i)) ;
421  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
422  export_tau_val_domain_boundary (tt(1, 3)(dom), 1, bound, res, pos_res, ncond(i)) ;
423  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
424  export_tau_val_domain_boundary (tt(2, 2)(dom), 2, bound, res, pos_res, ncond(i)) ;
425  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
426  export_tau_val_domain_boundary (tt(2, 3)(dom), 2, bound, res, pos_res, ncond(i)) ;
427  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
428  export_tau_val_domain_boundary (tt(3, 3)(dom), 2, bound, res, pos_res, ncond(i)) ;
429  }
430  found = true ;
431  }
432  // MTZ coordinates and not symetric
433  if ((tt.get_basis().get_basis(dom)==MTZ_BASIS) && (tt.get_n_comp()==9)) {
434  if (n_cmp==-1) {
435  export_tau_val_domain_boundary (tt(1,1)(dom), 0, bound, res, pos_res, ncond(0)) ;
436  export_tau_val_domain_boundary (tt(1,2)(dom), 1, bound, res, pos_res, ncond(1)) ;
437  export_tau_val_domain_boundary (tt(1,3)(dom), 1, bound, res, pos_res, ncond(2)) ;
438  export_tau_val_domain_boundary (tt(2,1)(dom), 1, bound, res, pos_res, ncond(3)) ;
439  export_tau_val_domain_boundary (tt(2,2)(dom), 2, bound, res, pos_res, ncond(4)) ;
440  export_tau_val_domain_boundary (tt(2,3)(dom), 2, bound, res, pos_res, ncond(5)) ;
441  export_tau_val_domain_boundary (tt(3,1)(dom), 1, bound, res, pos_res, ncond(6)) ;
442  export_tau_val_domain_boundary (tt(3,2)(dom), 2, bound, res, pos_res, ncond(7)) ;
443  export_tau_val_domain_boundary (tt(3,3)(dom), 2, bound, res, pos_res, ncond(8)) ;
444  }
445  else for (int i=0 ; i<n_cmp ; i++) {
446  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
447  export_tau_val_domain_boundary (tt(1, 1)(dom), 0, bound, res, pos_res, ncond(i)) ;
448  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
449  export_tau_val_domain_boundary (tt(1, 2)(dom), 1, bound, res, pos_res, ncond(i)) ;
450  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
451  export_tau_val_domain_boundary (tt(1, 3)(dom), 1, bound, res, pos_res, ncond(i)) ;
452  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==1))
453  export_tau_val_domain_boundary (tt(2, 1)(dom), 1, bound, res, pos_res, ncond(i)) ;
454  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
455  export_tau_val_domain_boundary (tt(2, 2)(dom), 2, bound, res, pos_res, ncond(i)) ;
456  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
457  export_tau_val_domain_boundary (tt(2, 3)(dom), 2, bound, res, pos_res, ncond(i)) ;
458  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==1))
459  export_tau_val_domain_boundary (tt(3, 1)(dom), 1, bound, res, pos_res, ncond(i)) ;
460  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==2))
461  export_tau_val_domain_boundary (tt(3, 2)(dom), 2, bound, res, pos_res, ncond(i)) ;
462  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
463  export_tau_val_domain_boundary (tt(3, 3)(dom), 2, bound, res, pos_res, ncond(i)) ;
464  }
465  found = true ;
466  }
467  if (!found) {
468  cerr << "Unknown type of 2-tensor Domain_shell::export_tau_boundary" << endl ;
469  abort() ;
470  }
471  }
472  break ;
473  default :
474  cerr << "Valence " << val << " not implemented in Domain_shell::export_tau_boundary" << endl ;
475  break ;
476  }
477 }}
reference set(const Index &pos)
Read/write of an element.
Definition: array.hpp:186
Bases_container bases_1d
Arrays containing the various basis of decomposition.
int get_basis(int nd) const
Read only the basis in a given domain.
Definition: base_tensor.hpp:93
void export_tau_val_domain_boundary_mquant(const Val_domain &eq, int mquant, int bound, Array< double > &res, int &pos_res, int ncond) const
Exports all the residual equations corresponding to a tensorial one on a given boundary It makes use ...
virtual double val_boundary(int, const Val_domain &, const Index &) const
Computes the value of a field at a boundary.
void export_tau_val_domain_boundary(const Val_domain &eq, int mlim, int bound, Array< double > &res, int &pos_res, int ncond) const
Exports all the residual equations corresponding to a tensorial one on a given boundary It makes use ...
virtual void export_tau_boundary(const Tensor &, int, int, Array< double > &, int &, const Array< int > &, int n_cmp=-1, Array< int > **p_cmp=0x0) const
Exports all the residual equations corresponding to a tensorial one on a given boundary It makes use ...
Dim_array nbr_coefs
Number of coefficients.
Definition: space.hpp:66
Class that gives the position inside a multi-dimensional Array.
Definition: index.hpp:38
int & set(int i)
Read/write of the position in a given dimension.
Definition: index.hpp:72
int get_m_order() const
Returns .
Definition: tensor.hpp:737
int get_m_quant() const
Returns .
Definition: tensor.hpp:747
Tensor handling.
Definition: tensor.hpp:149
bool is_m_order_affected() const
Checks whether the additional parameter order is affected (not very used).
Definition: tensor.hpp:323
const Param_tensor & get_parameters() const
Returns a pointer on the possible additional parameter.
Definition: tensor.hpp:311
const Base_tensor & get_basis() const
Returns the vectorial basis (triad) on which the components are defined.
Definition: tensor.hpp:504
int get_n_comp() const
Returns the number of stored components.
Definition: tensor.hpp:514
int get_valence() const
Returns the valence.
Definition: tensor.hpp:509
bool is_m_quant_affected() const
Checks whether the additional parameter is affected (used for boson stars for instance).
Definition: tensor.hpp:326
Class for storing the basis of decompositions of a field and its values on both the configuration and...
Definition: val_domain.hpp:69
bool check_if_zero() const
Check whether the logical state is zero or not.
Definition: val_domain.hpp:142
void coef() const
Computes the coefficients.
Definition: val_domain.cpp:622
const Base_spectral & get_base() const
Returns the basis of decomposition.
Definition: val_domain.hpp:122