KADATH
space.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 #include "space.hpp"
22 #include <assert.h>
23 namespace Kadath {
24 double eta_lim_chi (double chi, double rext, double a, double eta_c) ;
25 double chi_lim_eta (double chi, double rext, double a, double chi_c) ;
26 
27 Space::Space () : nbr_domains(0), ndim(0), type_base(0), domains(0x0) {
28 }
29 
30 
32  if (domains != 0x0) {
33  for (int i=0 ; i<nbr_domains ; i++)
34  delete domains[i] ;
35  delete [] domains ;
36  }
37 }
38 
39 ostream& operator<< (ostream& o, const Space& so) {
40  o << "Space of " << so.nbr_domains << " domains" << endl ;
41  for (int i=0 ; i<so.nbr_domains ; i++) {
42  o << "Domain " << i+1 << endl ;
43  o << *so.domains[i] << endl ;
44  o << "********************" << endl ;
45  }
46  switch (so.type_base) {
47  case CHEB_TYPE :
48  o << "Chebyshev polynomials are used." << endl ;
49  break ;
50  case LEG_TYPE :
51  o << "Legendre polynomials are used." << endl ;
52  break ;
53  default :
54  cerr << "Unknown type of base" << endl ;
55  abort() ;
56  }
57  return o ;
58 }
59 
60 void Space::save (FILE*) const {
61  cerr << "save not implemented for" << endl ;
62  cerr << *this << endl ;
63  abort() ;
64 }
65 
67  cerr << "get_indices_matching_non_std not implemented for" << endl ;
68  cerr << *this << endl ;
69  abort() ;
70 }
71 }
The Space class is an ensemble of domains describing the whole space of the computation.
Definition: space.hpp:1362
virtual ~Space()
Destructor.
Definition: space.cpp:31
virtual Array< int > get_indices_matching_non_std(int dom, int bound) const
Gives the number of the other domains, touching a given boundary.
Definition: space.cpp:66
int type_base
Type of basis used (i.e. using either Chebyshev or Legendre polynomials).
Definition: space.hpp:1367
virtual void save(FILE *) const
Saving function.
Definition: space.cpp:60
Space()
Standard constructor.
Definition: space.cpp:27
Domain ** domains
Pointers on the various Domains.
Definition: space.hpp:1368
int nbr_domains
Number od Domains.
Definition: space.hpp:1365