/[escript]/branches/subworld2/escriptcore/src/EscriptParams.h
ViewVC logotype

Contents of /branches/subworld2/escriptcore/src/EscriptParams.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5504 - (show annotations)
Wed Mar 4 22:58:13 2015 UTC (4 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 3774 byte(s)
Again with a more up to date copy


1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2015 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
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_EscriptParams_H
18 #define escript_EscriptParams_H
19 #include "system_dep.h"
20 #include <boost/python/list.hpp>
21 #include "Data.h" // for the operators
22
23 namespace escript
24 {
25
26 class Data;
27 class DataLazy;
28
29 class EscriptParams
30 {
31 public:
32 ESCRIPT_DLL_API
33 EscriptParams();
34
35 ESCRIPT_DLL_API
36 int getInt(const char* name, int sentinel=0) const;
37
38 ESCRIPT_DLL_API
39 void setInt(const char* name, int value);
40
41 boost::python::list
42 listEscriptParams();
43
44 private:
45
46 // If we get more params we can replace this with a map
47 int too_many_lines;
48 int autolazy;
49 int too_many_levels;
50 int resolve_collective;
51 int lazy_str_fmt;
52 int lapack_support;
53 int lazy_verbose;
54 int amg_disabled;
55 int has_netcdf;
56 int gmsh;
57 int gmsh_mpi;
58 mutable int temp_direct_solver;
59
60 protected:
61 // This is to provide fast access for methods in Data.
62 // Its a little bit ugly, needing all those friends but I really want to
63 // limit outside access to the char* interface
64
65 int getTOO_MANY_LINES() {return too_many_lines;}
66 int getAUTOLAZY() { return autolazy;}
67 int getTOO_MANY_LEVELS() {return too_many_levels;}
68 int getRESOLVE_COLLECTIVE() {return resolve_collective;}
69 int getLAZY_STR_FMT() {return lazy_str_fmt;}
70 int getLAZY_VERBOSE() {return lazy_verbose;}
71
72 friend class escript::Data;
73 friend class escript::DataLazy;
74 friend Data operator+(const boost::python::api::object&, const escript::Data&);
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 escript::Data&, 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 boost::python::api::object&);
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 C_GeneralTensorProduct(escript::Data& arg_0, escript::Data& arg_1,
87 int axis_offset, int transpose);
88 friend Data condEval(escript::Data& mask, escript::Data& trueval, escript::Data& falseval);
89 };
90
91
92 extern EscriptParams escriptParams;
93
94 /**
95 \brief Set the value of a named parameter.
96 See listEscriptParams() (showEscriptParams() in python) for available parameters.
97 */
98 ESCRIPT_DLL_API
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 ESCRIPT_DLL_API
106 int getEscriptParamInt(const char* name, int sentinel=0);
107
108 /**
109 \brief describe available paramters.
110 \return a list of tuples (parameter name, value, description)
111 */
112 ESCRIPT_DLL_API
113 inline boost::python::list listEscriptParams()
114 {
115 return escriptParams.listEscriptParams();
116 }
117
118
119
120 }
121 #endif

  ViewVC Help
Powered by ViewVC 1.1.26