51template<
class Scalar,
class UserVector>
54 std::vector<EIntrepidBurkardt> rule1D,
55 std::vector<EIntrepidGrowth> growth1D,
59 TEUCHOS_TEST_FOR_EXCEPTION((dimension!=(
int)rule1D.size()||
60 dimension!=(
int)growth1D.size()),std::out_of_range,
61 ">>> ERROR (AdaptiveSparseGridInterface): Dimension mismatch for inputs.");
70template<
class Scalar,
class UserVector>
78 output.Update(-1.0,output);
87template<
class Scalar,
class UserVector>
89 std::vector<int> index) {
90 int dimension = (int)index.size();
92 for (
int i=0; i<dimension; i++) {
100template<
class Scalar,
class UserVector>
107 std::vector<Scalar> point(
dimension_,(Scalar)0.0);
109 Teuchos::RCP<UserVector> f = output.Create(); output.Update(-1.0,output);
111 typename std::map<std::vector<Scalar>,
int>::iterator it;
112 for (it=cubRule.
begin(); it!=cubRule.
end(); it++) {
114 point.assign((it->first).begin(),(it->first).end());
120 output.Update(weight,*f);
124template<
class Scalar,
class UserVector>
126 std::vector<EIntrepidBurkardt> & rule1D) {
132template<
class Scalar,
class UserVector>
134 std::vector<EIntrepidGrowth> & growth1D) {
140template<
class Scalar,
class UserVector>
145template<
class Scalar,
class UserVector>
150template<
class Scalar,
class UserVector>
160#if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
162#warning "The Intrepid package is deprecated"
static const double INTREPID_TOL
General purpose tolerance in, e.g., internal Newton's method to invert ref to phys maps.
Scalar getInitialDiff()
Return initial error indicator.
int getDimension()
Return dimension of integration domain.
int dimension_
The dimension of the integration domain.
virtual void eval_integrand(UserVector &output, std::vector< Scalar > &input)=0
Evaluate the integrand function.
virtual Scalar error_indicator(UserVector &input)=0
User defined error indicator function.
virtual bool max_level(std::vector< int > index)
User defined test for maximum level of cubature.
bool isNormalized_
Whether or not to normalize the weights.
int maxLevel_
The maximum allowable level of quadrature.
AdaptiveSparseGridInterface(int dimension, std::vector< EIntrepidBurkardt > rule1D, std::vector< EIntrepidGrowth > growth1D, int maxLevel, bool isNormalized)
Constructor starts with index [1,...,1].
std::vector< EIntrepidGrowth > growth1D_
The user defined 1D growth rules.
void init(UserVector &output)
Compute initial quantities for sparse grid adaptation.
void getGrowth(std::vector< EIntrepidGrowth > &growth1D)
Return user defined 1D growth rules.
std::vector< EIntrepidBurkardt > rule1D_
The user defined 1D cubature rules.
bool isNormalized()
Return whether or not cubature weights are normalized.
Scalar initialDiff_
The initial contribution to the integral.
void getRule(std::vector< EIntrepidBurkardt > &rule1D)
Return user defined 1D quadrature rules.
virtual void eval_cubature(UserVector &output, CubatureTensorSorted< Scalar > &cubRule)
Evaluate the cubature rule.
Utilizes 1D cubature (integration) rules contained in the library sandia_rules (John Burkardt,...
std::map< std::vector< Scalar >, int >::iterator end()
Initiate iterator at the end of data.
std::map< std::vector< Scalar >, int >::iterator begin()
Initiate iterator at the beginning of data.
Scalar getWeight(int node)
Get a specific weight described by the integer location.