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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3269 - (hide annotations)
Wed Oct 13 03:21:50 2010 UTC (10 years, 7 months ago) by jfenwick
File MIME type: text/plain
File size: 3570 byte(s)
Fixed some intel compiler warnings.
Put linearPDEs back the way it was and present a common interface for dudley and finley (as per Lutz)

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

  ViewVC Help
Powered by ViewVC 1.1.26