~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/stokhos/src/Stokhos_SparseGridQuadrature.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// $Id$ 
 
2
// $Source$ 
 
3
// @HEADER
 
4
// ***********************************************************************
 
5
// 
 
6
//                           Stokhos Package
 
7
//                 Copyright (2009) Sandia Corporation
 
8
// 
 
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.
 
11
// 
 
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.
 
16
//  
 
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.
 
21
//  
 
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
 
25
// USA
 
26
// Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
 
27
// 
 
28
// ***********************************************************************
 
29
// @HEADER
 
30
 
 
31
#include "Stokhos_SparseGridQuadrature.hpp"
 
32
 
 
33
#ifdef HAVE_STOKHOS_DAKOTA
 
34
 
 
35
void 
 
36
Stokhos::getMyPoints( int order, int np, double p[], double x[] ){
 
37
 
 
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];
 
46
  }
 
47
  
 
48
}
 
49
 
 
50
 
 
51
void 
 
52
Stokhos::getMyWeights( int order, int np, double p[], double w[] ){
 
53
 
 
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);
 
60
 
 
61
  for(std::size_t i = 0; i<quad_points.size(); i++){
 
62
    w[i] = quad_weights[i];
 
63
  }
 
64
 
 
65
}
 
66
 
 
67
#endif // HAVE_STOKHOS_DAKOTA