41 #include "DTK_IntrepidIntegrationRule.hpp" 43 #include <Shards_CellTopology.hpp> 45 #include <Intrepid_FieldContainer.hpp> 52 const shards::CellTopology &topology,
const int order,
53 Teuchos::Array<Teuchos::Array<double>> &reference_points,
54 Teuchos::Array<double> &weights )
const 58 std::pair<unsigned, int> cub_key( topology.getKey(), order );
59 Teuchos::RCP<Intrepid::Cubature<double>> cub_rule;
60 if ( d_cub_rules.count( cub_key ) )
62 cub_rule = d_cub_rules.find( cub_key )->second;
66 cub_rule = d_intrepid_factory.create( topology, order );
67 d_cub_rules.emplace( cub_key, cub_rule );
71 int num_points = cub_rule->getNumPoints();
72 int cub_dim = cub_rule->getDimension();
73 Intrepid::FieldContainer<double> cub_points( num_points, cub_dim );
74 Intrepid::FieldContainer<double> cub_weights( num_points );
75 cub_rule->getCubature( cub_points, cub_weights );
78 reference_points.resize( num_points );
79 weights.resize( num_points );
80 for (
int p = 0; p < num_points; ++p )
82 weights[p] = cub_weights( p );
83 reference_points[p].resize( cub_dim );
84 for (
int d = 0; d < cub_dim; ++d )
86 reference_points[p][d] = cub_points( p, d );
void getIntegrationRule(const shards::CellTopology &topology, const int order, Teuchos::Array< Teuchos::Array< double >> &reference_points, Teuchos::Array< double > &weights) const
Given an topology and an integration order, get its integration rule.