File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ namespace QUESO
103103 // ! Helper function for sizing m_values
104104 void init_values ( const std::vector<unsigned int >& n_points );
105105
106+ // ! Helper function for checking domain extent
107+ void check_domain_bounds () const ;
108+
106109 // ! Parameter domain over which we use surrogate
107110 const BoxSubset<V,M>& m_domain;
108111
Original file line number Diff line number Diff line change 2929#include <queso/MpiComm.h>
3030#include <queso/GslVector.h>
3131#include <queso/GslMatrix.h>
32+ #include <queso/math_macros.h>
3233
3334// C++
3435#include <sstream>
@@ -46,6 +47,9 @@ namespace QUESO
4647
4748 // Size m_values
4849 this -> init_values (this -> m_n_points );
50+
51+ // Check the domain is bounded
52+ this -> check_domain_bounds ();
4953 }
5054
5155 template < class V , class M >
@@ -80,6 +84,17 @@ namespace QUESO
8084 this -> m_values .resize (n_total_points );
8185 }
8286
87+ template < class V , class M >
88+ void InterpolationSurrogateData < V ,M > ::check_domain_bounds () const
89+ {
90+ for (unsigned int i = 0 ; i < m_domain .vectorSpace ().dimLocal (); i ++ ) {
91+ queso_require_msg (queso_isfinite (m_domain .minValues ()[i ]),
92+ "Interpolation with an unbounded domain is unsupported" );
93+ queso_require_msg (queso_isfinite (m_domain .maxValues ()[i ]),
94+ "Interpolation with an unbounded domain is unsupported" );
95+ }
96+ }
97+
8398 template < class V , class M >
8499 void InterpolationSurrogateData < V ,M > ::set_values ( std ::vector < double > & values )
85100 {
You can’t perform that action at this time.
0 commit comments