KADATH
domain_shell_export_tau.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_mquant (const Val_domain& so, int mquant, int order, Array<double>& sec, int& pos_sec, int ncond) const {
30  if (so.check_if_zero())
31  pos_sec += ncond ;
32  else {
33 
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  // Loop on r :
43  for (int i=0 ; i<nbr_coefs(0)-order ; i++) {
44  pos_cf.set(0) = i ;
45  switch (baset) {
46  case COS_EVEN:
47  if (mquant==0) {
48  sec.set(pos_sec) = (*so.cf)(pos_cf) ;
49  pos_sec ++ ;
50  }
51  else if (j!=0) {
52  // Galerkin base
53  pos_galerkin = pos_cf ;
54  pos_galerkin.set(1) = 0 ;
55  sec.set(pos_sec) = (*so.cf)(pos_cf)
56  -2*(*so.cf)(pos_galerkin) ;
57  pos_sec ++ ;
58  }
59  break ;
60  case COS_ODD:
61  if (j!=nbr_coefs(1)-1) {
62  if (mquant==0) {
63  sec.set(pos_sec) = (*so.cf)(pos_cf) ;
64  pos_sec ++ ;
65  }
66  else if (j!=0) {
67  // Galerkin base
68  pos_galerkin = pos_cf ;
69  pos_galerkin.set(1) = 0 ;
70  sec.set(pos_sec) = (*so.cf)(pos_cf)
71  -(*so.cf)(pos_galerkin) ;
72  pos_sec ++ ;
73  }
74  }
75  break ;
76  case SIN_EVEN:
77  if ((j!=0) && (j!=nbr_coefs(1)-1)) {
78  if (mquant<=1) {
79  sec.set(pos_sec) = (*so.cf)(pos_cf) ;
80  pos_sec ++ ;
81  }
82  else if (j!=1) {
83  // Galerkin base
84  pos_galerkin = pos_cf ;
85  pos_galerkin.set(1) = 1 ;
86  sec.set(pos_sec) = (*so.cf)(pos_cf)
87  - j*(*so.cf)(pos_galerkin) ;
88  pos_sec ++ ;
89  }
90  }
91  break ;
92  case SIN_ODD:
93  if (j!=nbr_coefs(1)-1) {
94  if (mquant<=1) {
95  sec.set(pos_sec) = (*so.cf)(pos_cf) ;
96  pos_sec ++ ;
97  }
98  else if (j!=0) {
99  // Galerkin base
100  pos_galerkin = pos_cf ;
101  pos_galerkin.set(1) = 0 ;
102  sec.set(pos_sec) = (*so.cf)(pos_cf)
103  - (2*j+1)*(*so.cf)(pos_galerkin) ;
104  pos_sec ++ ;
105  }
106  }
107  break ;
108  default:
109  cerr << "Unknow theta basis in Domain_shell::export_tau_val_domain_mquant" << endl ;
110  abort() ;
111  }
112  }
113  }
114  }
115 }
116 
117 void Domain_shell::export_tau_val_domain (const Val_domain& so, int mlim, int order, Array<double>& sec, int& pos_sec, int ncond) const {
118 
119  if (so.check_if_zero())
120  pos_sec += ncond ;
121  else {
122 
123  so.coef() ;
124  int kmin = 2*mlim + 2 ;
125  Index pos_cf (nbr_coefs) ;
126  Index pos_galerkin (nbr_coefs) ;
127 
128  // Loop on phi :
129  for (int k=0 ; k<nbr_coefs(2)-1 ; k++)
130  if (k!=1) {
131  pos_cf.set(2) = k ;
132  // Loop on theta
133  int baset = (*so.get_base().bases_1d[1]) (k) ;
134  for (int j=0 ; j<nbr_coefs(1) ; j++) {
135  pos_cf.set(1) = j ;
136  // Loop on r :
137  for (int i=0 ; i<nbr_coefs(0)-order ; i++) {
138  pos_cf.set(0) = i ;
139  switch (baset) {
140  case COS_EVEN:
141  if (k<kmin) {
142  sec.set(pos_sec) = (*so.cf)(pos_cf) ;
143  pos_sec ++ ;
144  }
145  else if (j!=0) {
146  // Galerkin base
147  pos_galerkin = pos_cf ;
148  pos_galerkin.set(1) = 0 ;
149  sec.set(pos_sec) = (*so.cf)(pos_cf)
150  -2*(*so.cf)(pos_galerkin) ;
151  pos_sec ++ ;
152  }
153  break ;
154  case COS_ODD:
155  if (j!=nbr_coefs(1)-1) {
156  if (k<kmin) {
157  sec.set(pos_sec) = (*so.cf)(pos_cf) ;
158  pos_sec ++ ;
159  }
160  else if (j!=0) {
161  // Galerkin base
162  pos_galerkin = pos_cf ;
163  pos_galerkin.set(1) = 0 ;
164  sec.set(pos_sec) = (*so.cf)(pos_cf)
165  -(*so.cf)(pos_galerkin) ;
166  pos_sec ++ ;
167  }
168  }
169  break ;
170  case SIN_EVEN:
171  if ((j!=0) && (j!=nbr_coefs(1)-1)) {
172  if (k<kmin+2) {
173  sec.set(pos_sec) = (*so.cf)(pos_cf) ;
174  pos_sec ++ ;
175  }
176  else if (j!=1) {
177  // Galerkin
178  pos_galerkin = pos_cf ;
179  pos_galerkin.set(1) = 1 ;
180  sec.set(pos_sec) = (*so.cf)(pos_cf)
181  -j*(*so.cf)(pos_galerkin) ;
182  pos_sec ++ ;
183  }
184  }
185  break ;
186  case SIN_ODD:
187  if (j!=nbr_coefs(1)-1) {
188  if (k<kmin+2) {
189  sec.set(pos_sec) = (*so.cf)(pos_cf) ;
190  pos_sec ++ ;
191  }
192  else if (j!=0) {
193  // Galerkin
194  pos_galerkin = pos_cf ;
195  pos_galerkin.set(1) = 0 ;
196  sec.set(pos_sec) = (*so.cf)(pos_cf)
197  -(2*j+1)*(*so.cf)(pos_galerkin) ;
198  pos_sec ++ ;
199  }
200  }
201  break ;
202  default:
203  cerr << "Unknow theta basis in Domain_shell::export_tau_val_domain" << endl ;
204  abort() ;
205  }
206  }
207  }
208  }
209  }
210 }
211 
212 void Domain_shell::export_tau (const Tensor& tt, int dom, int order, Array<double>& res, int& pos_res, const Array<int>& ncond,
213  int n_cmp, Array<int>** p_cmp) const {
214  int val = tt.get_valence() ;
215  switch (val) {
216  case 0 :
217  if (tt.is_m_quant_affected()) {
218  // Special case for bosonic field
219  export_tau_val_domain_mquant (tt()(dom), tt.get_parameters().get_m_quant(), order, res, pos_res, ncond(0)) ;
220  }
221  else {
222  if (!tt.is_m_order_affected())
223  export_tau_val_domain (tt()(dom), 0, order, res, pos_res, ncond(0)) ;
224  else
225  export_tau_val_domain (tt()(dom), tt.get_parameters().get_m_order(), order, res, pos_res, ncond(0)) ;
226  }
227  break ;
228  case 1 : {
229  bool found = false ;
230  // Cartesian basis
231  if (tt.get_basis().get_basis(dom)==CARTESIAN_BASIS) {
232  if (n_cmp==-1) {
233  export_tau_val_domain (tt(1)(dom), 0, order, res, pos_res, ncond(0)) ;
234  export_tau_val_domain (tt(2)(dom), 0, order, res, pos_res, ncond(1)) ;
235  export_tau_val_domain (tt(3)(dom), 0, order, res, pos_res, ncond(2)) ;
236  }
237  else for (int i=0 ; i<n_cmp ; i++) {
238  if ((*p_cmp[i])(0)==1)
239  export_tau_val_domain (tt(1)(dom), 0, order, res, pos_res, ncond(i)) ;
240  if ((*p_cmp[i])(0)==2)
241  export_tau_val_domain (tt(2)(dom), 0, order, res, pos_res, ncond(i)) ;
242  if ((*p_cmp[i])(0)==3)
243  export_tau_val_domain (tt(3)(dom), 0, order, res, pos_res, ncond(i)) ;
244  }
245  found = true ;
246  }
247  // Spherical coordinates
248  if (tt.get_basis().get_basis(dom)==SPHERICAL_BASIS) {
249  if (n_cmp==-1) {
250  export_tau_val_domain (tt(1)(dom), 0, order, res, pos_res, ncond(0)) ;
251  export_tau_val_domain (tt(2)(dom), 1, order, res, pos_res, ncond(1)) ;
252  export_tau_val_domain (tt(3)(dom), 1, order, res, pos_res, ncond(2)) ;
253  }
254  else for (int i=0 ; i<n_cmp ; i++) {
255  if ((*p_cmp[i])(0)==1)
256  export_tau_val_domain (tt(1)(dom), 0, order, res, pos_res, ncond(i)) ;
257  if ((*p_cmp[i])(0)==2)
258  export_tau_val_domain (tt(2)(dom), 1, order, res, pos_res, ncond(i)) ;
259  if ((*p_cmp[i])(0)==3)
260  export_tau_val_domain (tt(3)(dom), 1, order, res, pos_res, ncond(i)) ;
261  }
262  found = true ;
263  }
264  // MTZ coordinates
265  if (tt.get_basis().get_basis(dom)==MTZ_BASIS) {
266  if (n_cmp==-1) {
267  export_tau_val_domain (tt(1)(dom), 0, order, res, pos_res, ncond(0)) ;
268  export_tau_val_domain (tt(2)(dom), 1, order, res, pos_res, ncond(1)) ;
269  export_tau_val_domain (tt(3)(dom), 1, order, res, pos_res, ncond(2)) ;
270  }
271  else for (int i=0 ; i<n_cmp ; i++) {
272  if ((*p_cmp[i])(0)==1)
273  export_tau_val_domain (tt(1)(dom), 0, order, res, pos_res, ncond(i)) ;
274  if ((*p_cmp[i])(0)==2)
275  export_tau_val_domain (tt(2)(dom), 1, order, res, pos_res, ncond(i)) ;
276  if ((*p_cmp[i])(0)==3)
277  export_tau_val_domain (tt(3)(dom), 1, order, res, pos_res, ncond(i)) ;
278  }
279  found = true ;
280  }
281  if (!found) {
282  cerr << "Unknown type of vector Domain_shell::export_tau" << endl ;
283  abort() ;
284  }
285  }
286  break ;
287  case 2 : {
288  bool found = false ;
289  // Cartesian basis and symetric
290  if ((tt.get_basis().get_basis(dom)==CARTESIAN_BASIS) && (tt.get_n_comp()==6)) {
291  if (n_cmp==-1) {
292  export_tau_val_domain (tt(1,1)(dom), 0, order, res, pos_res, ncond(0)) ;
293  export_tau_val_domain (tt(1,2)(dom), 0, order, res, pos_res, ncond(1)) ;
294  export_tau_val_domain (tt(1,3)(dom), 0, order, res, pos_res, ncond(2)) ;
295  export_tau_val_domain (tt(2,2)(dom), 0, order, res, pos_res, ncond(3)) ;
296  export_tau_val_domain (tt(2,3)(dom), 0, order, res, pos_res, ncond(4)) ;
297  export_tau_val_domain (tt(3,3)(dom), 0, order, res, pos_res, ncond(5)) ;
298  }
299  else for (int i=0 ; i<n_cmp ; i++) {
300  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
301  export_tau_val_domain (tt(1, 1)(dom), 0, order, res, pos_res, ncond(i)) ;
302  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
303  export_tau_val_domain (tt(1, 2)(dom), 0, order, res, pos_res, ncond(i)) ;
304  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
305  export_tau_val_domain (tt(1, 3)(dom), 0, order, res, pos_res, ncond(i)) ;
306  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
307  export_tau_val_domain (tt(2, 2)(dom), 0, order, res, pos_res, ncond(i)) ;
308  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
309  export_tau_val_domain (tt(2, 3)(dom), 0, order, res, pos_res, ncond(i)) ;
310  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
311  export_tau_val_domain (tt(3, 3)(dom), 0, order, res, pos_res, ncond(i)) ;
312  }
313  found = true ;
314  }
315  // Cartesian basis and not symetric
316  if ((tt.get_basis().get_basis(dom)==CARTESIAN_BASIS) && (tt.get_n_comp()==9)) {
317  if (n_cmp==-1) {
318  export_tau_val_domain (tt(1,1)(dom), 0, order, res, pos_res, ncond(0)) ;
319  export_tau_val_domain (tt(1,2)(dom), 0, order, res, pos_res, ncond(1)) ;
320  export_tau_val_domain (tt(1,3)(dom), 0, order, res, pos_res, ncond(2)) ;
321  export_tau_val_domain (tt(2,1)(dom), 0, order, res, pos_res, ncond(3)) ;
322  export_tau_val_domain (tt(2,2)(dom), 0, order, res, pos_res, ncond(4)) ;
323  export_tau_val_domain (tt(2,3)(dom), 0, order, res, pos_res, ncond(5)) ;
324  export_tau_val_domain (tt(3,1)(dom), 0, order, res, pos_res, ncond(6)) ;
325  export_tau_val_domain (tt(3,2)(dom), 0, order, res, pos_res, ncond(7)) ;
326  export_tau_val_domain (tt(3,3)(dom), 0, order, res, pos_res, ncond(8)) ;
327  }
328  else for (int i=0 ; i<n_cmp ; i++) {
329  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
330  export_tau_val_domain (tt(1, 1)(dom), 0, order, res, pos_res, ncond(i)) ;
331  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
332  export_tau_val_domain (tt(1, 2)(dom), 0, order, res, pos_res, ncond(i)) ;
333  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
334  export_tau_val_domain (tt(1, 3)(dom), 0, order, res, pos_res, ncond(i)) ;
335  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==1))
336  export_tau_val_domain (tt(2, 1)(dom), 0, order, res, pos_res, ncond(i)) ;
337  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
338  export_tau_val_domain (tt(2, 2)(dom), 0, order, res, pos_res, ncond(i)) ;
339  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
340  export_tau_val_domain (tt(2, 3)(dom), 0, order, res, pos_res, ncond(i)) ;
341  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==1))
342  export_tau_val_domain (tt(3, 1)(dom), 0, order, res, pos_res, ncond(i)) ;
343  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==2))
344  export_tau_val_domain (tt(3, 2)(dom), 0, order, res, pos_res, ncond(i)) ;
345  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
346  export_tau_val_domain (tt(3, 3)(dom), 0, order, res, pos_res, ncond(i)) ;
347  }
348  found = true ;
349  }
350  // Spherical coordinates and not symetric
351  if ((tt.get_basis().get_basis(dom)==SPHERICAL_BASIS) && (tt.get_n_comp()==9)) {
352  if (n_cmp==-1) {
353  export_tau_val_domain (tt(1,1)(dom), 0, order, res, pos_res, ncond(0)) ;
354  export_tau_val_domain (tt(1,2)(dom), 1, order, res, pos_res, ncond(1)) ;
355  export_tau_val_domain (tt(1,3)(dom), 1, order, res, pos_res, ncond(2)) ;
356  export_tau_val_domain (tt(2,1)(dom), 1, order, res, pos_res, ncond(3)) ;
357  export_tau_val_domain (tt(2,2)(dom), 2, order, res, pos_res, ncond(4)) ;
358  export_tau_val_domain (tt(2,3)(dom), 2, order, res, pos_res, ncond(5)) ;
359  export_tau_val_domain (tt(3,1)(dom), 1, order, res, pos_res, ncond(6)) ;
360  export_tau_val_domain (tt(3,2)(dom), 2, order, res, pos_res, ncond(7)) ;
361  export_tau_val_domain (tt(3,3)(dom), 2, order, res, pos_res, ncond(8)) ;
362  }
363  else for (int i=0 ; i<n_cmp ; i++) {
364  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
365  export_tau_val_domain (tt(1, 1)(dom), 0, order, res, pos_res, ncond(i)) ;
366  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
367  export_tau_val_domain (tt(1, 2)(dom), 1, order, res, pos_res, ncond(i)) ;
368  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
369  export_tau_val_domain (tt(1, 3)(dom), 1, order, res, pos_res, ncond(i)) ;
370  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==1))
371  export_tau_val_domain (tt(2, 1)(dom), 1, order, res, pos_res, ncond(i)) ;
372  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
373  export_tau_val_domain (tt(2, 2)(dom), 2, order, res, pos_res, ncond(i)) ;
374  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
375  export_tau_val_domain (tt(2, 3)(dom), 2, order, res, pos_res, ncond(i)) ;
376  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==1))
377  export_tau_val_domain (tt(3, 1)(dom), 1, order, res, pos_res, ncond(i)) ;
378  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==2))
379  export_tau_val_domain (tt(3, 2)(dom), 2, order, res, pos_res, ncond(i)) ;
380  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
381  export_tau_val_domain (tt(3, 3)(dom), 2, order, res, pos_res, ncond(i)) ;
382  }
383  found = true ;
384  }
385  // Spherical coordinates and not symetric
386  if ((tt.get_basis().get_basis(dom)==SPHERICAL_BASIS) && (tt.get_n_comp()==6)) {
387  if (n_cmp==-1) {
388  export_tau_val_domain (tt(1,1)(dom), 0, order, res, pos_res, ncond(0)) ;
389  export_tau_val_domain (tt(1,2)(dom), 1, order, res, pos_res, ncond(1)) ;
390  export_tau_val_domain (tt(1,3)(dom), 1, order, res, pos_res, ncond(2)) ;
391  export_tau_val_domain (tt(2,2)(dom), 2, order, res, pos_res, ncond(3)) ;
392  export_tau_val_domain (tt(2,3)(dom), 2, order, res, pos_res, ncond(4)) ;
393  export_tau_val_domain (tt(3,3)(dom), 2, order, res, pos_res, ncond(5)) ;
394  }
395  else for (int i=0 ; i<n_cmp ; i++) {
396  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
397  export_tau_val_domain (tt(1, 1)(dom), 0, order, res, pos_res, ncond(i)) ;
398  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
399  export_tau_val_domain (tt(1, 2)(dom), 1, order, res, pos_res, ncond(i)) ;
400  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
401  export_tau_val_domain (tt(1, 3)(dom), 1, order, res, pos_res, ncond(i)) ;
402  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
403  export_tau_val_domain (tt(2, 2)(dom), 2, order, res, pos_res, ncond(i)) ;
404  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
405  export_tau_val_domain (tt(2, 3)(dom), 2, order, res, pos_res, ncond(i)) ;
406  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
407  export_tau_val_domain (tt(3, 3)(dom), 2, order, res, pos_res, ncond(i)) ;
408  }
409  found = true ;
410  }//MTZ coordinates and not symetric
411  if ((tt.get_basis().get_basis(dom)==MTZ_BASIS) && (tt.get_n_comp()==9)) {
412  if (n_cmp==-1) {
413  export_tau_val_domain (tt(1,1)(dom), 0, order, res, pos_res, ncond(0)) ;
414  export_tau_val_domain (tt(1,2)(dom), 1, order, res, pos_res, ncond(1)) ;
415  export_tau_val_domain (tt(1,3)(dom), 1, order, res, pos_res, ncond(2)) ;
416  export_tau_val_domain (tt(2,1)(dom), 1, order, res, pos_res, ncond(3)) ;
417  export_tau_val_domain (tt(2,2)(dom), 2, order, res, pos_res, ncond(4)) ;
418  export_tau_val_domain (tt(2,3)(dom), 2, order, res, pos_res, ncond(5)) ;
419  export_tau_val_domain (tt(3,1)(dom), 1, order, res, pos_res, ncond(6)) ;
420  export_tau_val_domain (tt(3,2)(dom), 2, order, res, pos_res, ncond(7)) ;
421  export_tau_val_domain (tt(3,3)(dom), 2, order, res, pos_res, ncond(8)) ;
422  }
423  else for (int i=0 ; i<n_cmp ; i++) {
424  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
425  export_tau_val_domain (tt(1, 1)(dom), 0, order, res, pos_res, ncond(i)) ;
426  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
427  export_tau_val_domain (tt(1, 2)(dom), 1, order, res, pos_res, ncond(i)) ;
428  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
429  export_tau_val_domain (tt(1, 3)(dom), 1, order, res, pos_res, ncond(i)) ;
430  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==1))
431  export_tau_val_domain (tt(2, 1)(dom), 1, order, res, pos_res, ncond(i)) ;
432  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
433  export_tau_val_domain (tt(2, 2)(dom), 2, order, res, pos_res, ncond(i)) ;
434  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
435  export_tau_val_domain (tt(2, 3)(dom), 2, order, res, pos_res, ncond(i)) ;
436  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==1))
437  export_tau_val_domain (tt(3, 1)(dom), 1, order, res, pos_res, ncond(i)) ;
438  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==2))
439  export_tau_val_domain (tt(3, 2)(dom), 2, order, res, pos_res, ncond(i)) ;
440  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
441  export_tau_val_domain (tt(3, 3)(dom), 2, order, res, pos_res, ncond(i)) ;
442  }
443  found = true ;
444  }
445  // MTZ coordinates and not symetric
446  if ((tt.get_basis().get_basis(dom)==MTZ_BASIS) && (tt.get_n_comp()==6)) {
447  if (n_cmp==-1) {
448  export_tau_val_domain (tt(1,1)(dom), 0, order, res, pos_res, ncond(0)) ;
449  export_tau_val_domain (tt(1,2)(dom), 1, order, res, pos_res, ncond(1)) ;
450  export_tau_val_domain (tt(1,3)(dom), 1, order, res, pos_res, ncond(2)) ;
451  export_tau_val_domain (tt(2,2)(dom), 2, order, res, pos_res, ncond(3)) ;
452  export_tau_val_domain (tt(2,3)(dom), 2, order, res, pos_res, ncond(4)) ;
453  export_tau_val_domain (tt(3,3)(dom), 2, order, res, pos_res, ncond(5)) ;
454  }
455  else for (int i=0 ; i<n_cmp ; i++) {
456  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
457  export_tau_val_domain (tt(1, 1)(dom), 0, order, res, pos_res, ncond(i)) ;
458  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
459  export_tau_val_domain (tt(1, 2)(dom), 1, order, res, pos_res, ncond(i)) ;
460  if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
461  export_tau_val_domain (tt(1, 3)(dom), 1, order, res, pos_res, ncond(i)) ;
462  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
463  export_tau_val_domain (tt(2, 2)(dom), 2, order, res, pos_res, ncond(i)) ;
464  if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
465  export_tau_val_domain (tt(2, 3)(dom), 2, order, res, pos_res, ncond(i)) ;
466  if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
467  export_tau_val_domain (tt(3, 3)(dom), 2, order, res, pos_res, ncond(i)) ;
468  }
469  found = true ;
470  }
471  if (!found) {
472  cerr << "Unknown type of 2-tensor Domain_shell::export_tau" << endl ;
473  abort() ;
474  }
475  }
476  break ;
477  default :
478  cerr << "Valence " << val << " not implemented in Domain_shell::export_tau" << endl ;
479  break ;
480  }
481 }}
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(const Val_domain &eq, int mlim, int order, Array< double > &res, int &pos_res, int ncond) const
Exports a residual equation in the bulk.
void export_tau_val_domain_mquant(const Val_domain &eq, int mquant, int order, Array< double > &res, int &pos_res, int ncond) const
Exports a residual equation in the bulk.
virtual void export_tau(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 in the bulk.
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
Array< double > * cf
Pointer on the Array of the values in the coefficients space.
Definition: val_domain.hpp:77
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