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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6120 - (show annotations)
Mon Apr 4 01:33:51 2016 UTC (2 years, 11 months ago) by caltinay
File MIME type: text/plain
File size: 3766 byte(s)
guilty as charged.

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 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 void setEscriptParamInt(const char* name, int value);
99
100 /**
101 \brief get the value of a named parameter.
102 See listEscriptParams() (showEscriptParams() in python) for available parameters.
103 */
104 int getEscriptParamInt(const char* name, int sentinel=0);
105
106 /**
107 \brief describe available paramters.
108 \return a list of tuples (parameter name, value, description)
109 */
110 inline boost::python::list listEscriptParams()
111 {
112 return escriptParams.listEscriptParams();
113 }
114
115 } // namespace escript
116
117 #endif // __ESCRIPT_PARAMS_H__
118

  ViewVC Help
Powered by ViewVC 1.1.26