4
// ***********************************************************************
7
// Copyright (2009) Sandia Corporation
9
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
10
// license for use of this work by or on behalf of the U.S. Government.
12
// This library is free software; you can redistribute it and/or modify
13
// it under the terms of the GNU Lesser General Public License as
14
// published by the Free Software Foundation; either version 2.1 of the
15
// License, or (at your option) any later version.
17
// This library is distributed in the hope that it will be useful, but
18
// WITHOUT ANY WARRANTY; without even the implied warranty of
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
// Lesser General Public License for more details.
22
// You should have received a copy of the GNU Lesser General Public
23
// License along with this library; if not, write to the Free Software
24
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26
// Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
28
// ***********************************************************************
31
#include "Stokhos_SparseGridQuadrature.hpp"
33
#ifdef HAVE_STOKHOS_DAKOTA
36
Stokhos::getMyPoints( int order, int np, double p[], double x[] ){
38
long int pointer = p[0];
39
const OneDOrthogPolyBasis<int,double>* basis = (const OneDOrthogPolyBasis<int,double>*) pointer;
40
Teuchos::Array<double> quad_points;
41
Teuchos::Array<double> quad_weights;
42
Teuchos::Array< Teuchos::Array<double> > quad_values;
43
basis->getQuadPoints(2*order-1, quad_points, quad_weights, quad_values);
44
for(std::size_t i = 0; i<quad_points.size(); i++){
45
x[i] = quad_points[i];
52
Stokhos::getMyWeights( int order, int np, double p[], double w[] ){
54
long int pointer = p[0];
55
const OneDOrthogPolyBasis<int,double>* basis = (const OneDOrthogPolyBasis<int,double>*) pointer;
56
Teuchos::Array<double> quad_points;
57
Teuchos::Array<double> quad_weights;
58
Teuchos::Array< Teuchos::Array<double> > quad_values;
59
basis->getQuadPoints(2*order-1, quad_points, quad_weights, quad_values);
61
for(std::size_t i = 0; i<quad_points.size(); i++){
62
w[i] = quad_weights[i];
67
#endif // HAVE_STOKHOS_DAKOTA