/[escript]/trunk/escriptcore/src/EscriptParams.h
ViewVC logotype

Contents of /trunk/escriptcore/src/EscriptParams.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6141 - (show annotations)
Wed Apr 6 03:51:30 2016 UTC (2 years, 8 months ago) by caltinay
File MIME type: text/plain
File size: 3786 byte(s)
more namespacing of defines.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17 #ifndef __ESCRIPT_PARAMS_H__
18 #define __ESCRIPT_PARAMS_H__
19
20 #include "system_dep.h"
21 #include "Data.h" // for the operators
22
23 #include <boost/python/list.hpp>
24
25 namespace escript
26 {
27
28 class Data;
29 class DataLazy;
30
31 class EscriptParams
32 {
33 public:
34 EscriptParams();
35
36 int getInt(const char* name, int sentinel=0) const;
37
38 void setInt(const char* name, int value);
39
40 boost::python::list
41 listEscriptParams();
42
43 private:
44
45 // If we get more params we can replace this with a map
46 int too_many_lines;
47 int autolazy;
48 int too_many_levels;
49 int resolve_collective;
50 int lazy_str_fmt;
51 int lapack_support;
52 int lazy_verbose;
53 int amg_disabled;
54 int has_netcdf;
55 int have_trilinos;
56 int have_unzip;
57 int gmsh;
58 int gmsh_mpi;
59 mutable int temp_direct_solver;
60
61 protected:
62 // This is to provide fast access for methods in Data.
63 // Its a little bit ugly, needing all those friends but I really want to
64 // limit outside access to the char* interface
65
66 int getTOO_MANY_LINES() {return too_many_lines;}
67 int getAUTOLAZY() { return autolazy;}
68 int getTOO_MANY_LEVELS() {return too_many_levels;}
69 int getRESOLVE_COLLECTIVE() {return resolve_collective;}
70 int getLAZY_STR_FMT() {return lazy_str_fmt;}
71 int getLAZY_VERBOSE() {return lazy_verbose;}
72
73 friend class escript::Data;
74 friend class escript::DataLazy;
75 friend Data operator+(const boost::python::api::object&, const escript::Data&);
76 friend Data operator-(const boost::python::api::object&, const escript::Data&);
77 friend Data operator*(const boost::python::api::object&, const escript::Data&);
78 friend Data operator/(const boost::python::api::object&, const escript::Data&);
79 friend Data operator+(const escript::Data&, const escript::Data&);
80 friend Data operator-(const escript::Data&, const escript::Data&);
81 friend Data operator*(const escript::Data&, const escript::Data&);
82 friend Data operator/(const escript::Data&, const escript::Data&);
83 friend Data operator+(const escript::Data&, const boost::python::api::object&);
84 friend Data operator-(const escript::Data&, const boost::python::api::object&);
85 friend Data operator*(const escript::Data&, const boost::python::api::object&);
86 friend Data operator/(const escript::Data&, const boost::python::api::object&);
87 friend Data C_GeneralTensorProduct(escript::Data& arg_0, escript::Data& arg_1,
88 int axis_offset, int transpose);
89 friend Data condEval(escript::Data& mask, escript::Data& trueval, escript::Data& falseval);
90 };
91
92
93 extern EscriptParams escriptParams;
94
95 /**
96 \brief Set the value of a named parameter.
97 See listEscriptParams() (showEscriptParams() in python) for available parameters.
98 */
99 void setEscriptParamInt(const char* name, int value);
100
101 /**
102 \brief get the value of a named parameter.
103 See listEscriptParams() (showEscriptParams() in python) for available parameters.
104 */
105 int getEscriptParamInt(const char* name, int sentinel=0);
106
107 /**
108 \brief describe available paramters.
109 \return a list of tuples (parameter name, value, description)
110 */
111 inline boost::python::list listEscriptParams()
112 {
113 return escriptParams.listEscriptParams();
114 }
115
116 } // namespace escript
117
118 #endif // __ESCRIPT_PARAMS_H__
119

  ViewVC Help
Powered by ViewVC 1.1.26