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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 jfenwick 1897
2 jfenwick 3981 /*****************************************************************************
3 jfenwick 1897 *
4 jfenwick 5863 * Copyright (c) 2003-2016 by The University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 jfenwick 1897 *
7     * Primary Business: Queensland, Australia
8 jfenwick 6112 * Licensed under the Apache License, version 2.0
9     * http://www.apache.org/licenses/LICENSE-2.0
10 jfenwick 1897 *
11 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 jfenwick 4657 * Development 2012-2013 by School of Earth Sciences
13     * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 jfenwick 3981 *
15     *****************************************************************************/
16 jfenwick 1897
17 caltinay 6120 #ifndef __ESCRIPT_PARAMS_H__
18     #define __ESCRIPT_PARAMS_H__
19 caltinay 6001
20 jfenwick 1897 #include "system_dep.h"
21 trankine 2154 #include "Data.h" // for the operators
22 jfenwick 1897
23 caltinay 6001 #include <boost/python/list.hpp>
24    
25 jfenwick 1897 namespace escript
26     {
27    
28 jfenwick 2146 class Data;
29 jfenwick 2472 class DataLazy;
30 jfenwick 2146
31 jfenwick 1897 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 jfenwick 2146
40 jfenwick 2721 boost::python::list
41     listEscriptParams();
42    
43 jfenwick 1897 private:
44    
45     // If we get more params we can replace this with a map
46 caltinay 6120 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 caltinay 6141 int have_unzip;
57 caltinay 6120 int gmsh;
58     int gmsh_mpi;
59     mutable int temp_direct_solver;
60 jfenwick 2146
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 jfenwick 2472 int getTOO_MANY_LEVELS() {return too_many_levels;}
69 jfenwick 2721 int getRESOLVE_COLLECTIVE() {return resolve_collective;}
70 jfenwick 2795 int getLAZY_STR_FMT() {return lazy_str_fmt;}
71     int getLAZY_VERBOSE() {return lazy_verbose;}
72 jfenwick 2146
73     friend class escript::Data;
74 jfenwick 2472 friend class escript::DataLazy;
75 jfenwick 2272 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 jfenwick 2199 int axis_offset, int transpose);
89 jfenwick 3269 friend Data condEval(escript::Data& mask, escript::Data& trueval, escript::Data& falseval);
90 jfenwick 1897 };
91    
92    
93     extern EscriptParams escriptParams;
94    
95 jfenwick 2142 /**
96     \brief Set the value of a named parameter.
97     See listEscriptParams() (showEscriptParams() in python) for available parameters.
98     */
99 jfenwick 1897 void setEscriptParamInt(const char* name, int value);
100    
101 jfenwick 2142 /**
102     \brief get the value of a named parameter.
103     See listEscriptParams() (showEscriptParams() in python) for available parameters.
104     */
105 jfenwick 1897 int getEscriptParamInt(const char* name, int sentinel=0);
106    
107 jfenwick 2142 /**
108     \brief describe available paramters.
109 jfenwick 2721 \return a list of tuples (parameter name, value, description)
110 jfenwick 2142 */
111 jfenwick 2721 inline boost::python::list listEscriptParams()
112     {
113     return escriptParams.listEscriptParams();
114     }
115 jfenwick 2142
116 caltinay 6120 } // namespace escript
117 jfenwick 2721
118 caltinay 6120 #endif // __ESCRIPT_PARAMS_H__
119 jfenwick 2721

  ViewVC Help
Powered by ViewVC 1.1.26