const unsigned int n_cells =
compute_point_locations(points, cells, qpoints, maps);
- hp::MappingCollection<dim> mapping_collection(mapping);
- const hp::FECollection<dim> &fe_collection = dh->get_fe_collection();
- hp::QCollection<dim> quadrature_collection;
+
// Create quadrature collection
+ hp::QCollection<dim> quadrature_collection;
for (unsigned int i = 0; i < n_cells; ++i)
{
// Number of quadrature points on this cell
quadrature_collection.push_back(Quadrature<dim>(qpoints[i], ww));
}
- // Get a function value object
- hp::FEValues<dim> fe_v(mapping_collection,
- fe_collection,
+
+ // Now gather all the information we need
+ hp::MappingCollection<dim> mapping_collection(mapping);
+ hp::FEValues<dim> fe_v(mapping_collection,
+ dh->get_fe_collection(),
quadrature_collection,
update_values);
- // Now gather all the information we need
for (unsigned int i = 0; i < n_cells; ++i)
{
AssertThrow(!cells[i]->is_artificial(),
VectorTools::ExcPointNotAvailableHere());
+
fe_v.reinit(cells[i], i, 0);
const unsigned int nq = qpoints[i].size();
+
std::vector<Vector<typename VectorType::value_type>> vvalues(
nq, Vector<typename VectorType::value_type>(this->n_components));
fe_v.get_present_fe_values().get_function_values(data_vector, vvalues);
+
for (unsigned int q = 0; q < nq; ++q)
values[maps[i][q]] = vvalues[q];
}
{
Assert(points.size() == values.size(),
ExcDimensionMismatch(points.size(), values.size()));
+
+ // Simply forward everything to the vector_value_list()
+ // function. This requires a temporary object, but everything we
+ // do here is so expensive that that really doesn't make any
+ // difference any more.
std::vector<Vector<typename VectorType::value_type>> vvalues(
points.size(),
Vector<typename VectorType::value_type>(this->n_components));
+
vector_value_list(points, vvalues);
+
for (unsigned int q = 0; q < points.size(); ++q)
values[q] = vvalues[q](component);
}
const unsigned int n_cells =
compute_point_locations(points, cells, qpoints, maps);
- hp::MappingCollection<dim> mapping_collection(mapping);
- const hp::FECollection<dim> &fe_collection = dh->get_fe_collection();
- hp::QCollection<dim> quadrature_collection;
+
// Create quadrature collection
+ hp::QCollection<dim> quadrature_collection;
for (unsigned int i = 0; i < n_cells; ++i)
{
// Number of quadrature points on this cell
quadrature_collection.push_back(Quadrature<dim>(qpoints[i], ww));
}
- // Get a function value object
- hp::FEValues<dim> fe_v(mapping_collection,
- fe_collection,
+
+ // Now gather all the information we need
+ hp::MappingCollection<dim> mapping_collection(mapping);
+ hp::FEValues<dim> fe_v(mapping_collection,
+ dh->get_fe_collection(),
quadrature_collection,
update_gradients);
- // Now gather all the information we need
for (unsigned int i = 0; i < n_cells; ++i)
{
AssertThrow(!cells[i]->is_artificial(),
VectorTools::ExcPointNotAvailableHere());
+
fe_v.reinit(cells[i], i, 0);
+
const unsigned int nq = qpoints[i].size();
std::vector<
std::vector<Tensor<1, dim, typename VectorType::value_type>>>
this->n_components));
fe_v.get_present_fe_values().get_function_gradients(data_vector,
vgrads);
+
for (unsigned int q = 0; q < nq; ++q)
{
const unsigned int s = vgrads[q].size();
}
}
+
+
template <int dim, typename DoFHandlerType, typename VectorType>
void
FEFieldFunction<dim, DoFHandlerType, VectorType>::gradient_list(
{
Assert(points.size() == values.size(),
ExcDimensionMismatch(points.size(), values.size()));
+
+ // Simply forward everything to the vector_gradient_list()
+ // function. This requires a temporary object, but everything we
+ // do here is so expensive that that really doesn't make any
+ // difference any more.
std::vector<std::vector<Tensor<1, dim, typename VectorType::value_type>>>
vvalues(points.size(),
std::vector<Tensor<1, dim, typename VectorType::value_type>>(
this->n_components));
+
vector_gradient_list(points, vvalues);
+
for (unsigned int q = 0; q < points.size(); ++q)
values[q] = vvalues[q][component];
}
+
template <int dim, typename DoFHandlerType, typename VectorType>
void
FEFieldFunction<dim, DoFHandlerType, VectorType>::vector_laplacian_list(
const unsigned int n_cells =
compute_point_locations(points, cells, qpoints, maps);
- hp::MappingCollection<dim> mapping_collection(mapping);
- const hp::FECollection<dim> &fe_collection = dh->get_fe_collection();
- hp::QCollection<dim> quadrature_collection;
+
// Create quadrature collection
+ hp::QCollection<dim> quadrature_collection;
for (unsigned int i = 0; i < n_cells; ++i)
{
// Number of quadrature points on this cell
quadrature_collection.push_back(Quadrature<dim>(qpoints[i], ww));
}
- // Get a function value object
- hp::FEValues<dim> fe_v(mapping_collection,
- fe_collection,
+
+ // Now gather all the information we need
+ hp::MappingCollection<dim> mapping_collection(mapping);
+ hp::FEValues<dim> fe_v(mapping_collection,
+ dh->get_fe_collection(),
quadrature_collection,
update_hessians);
// Now gather all the information we need
{
AssertThrow(!cells[i]->is_artificial(),
VectorTools::ExcPointNotAvailableHere());
+
fe_v.reinit(cells[i], i, 0);
+
const unsigned int nq = qpoints[i].size();
std::vector<Vector<typename VectorType::value_type>> vvalues(
nq, Vector<typename VectorType::value_type>(this->n_components));
fe_v.get_present_fe_values().get_function_laplacians(data_vector,
vvalues);
+
for (unsigned int q = 0; q < nq; ++q)
values[maps[i][q]] = vvalues[q];
}
}
+
+
template <int dim, typename DoFHandlerType, typename VectorType>
void
FEFieldFunction<dim, DoFHandlerType, VectorType>::laplacian_list(
{
Assert(points.size() == values.size(),
ExcDimensionMismatch(points.size(), values.size()));
+
+ // Simply forward everything to the vector_gradient_list()
+ // function. This requires a temporary object, but everything we
+ // do here is so expensive that that really doesn't make any
+ // difference any more.
std::vector<Vector<typename VectorType::value_type>> vvalues(
points.size(),
Vector<typename VectorType::value_type>(this->n_components));
+
vector_laplacian_list(points, vvalues);
+
for (unsigned int q = 0; q < points.size(); ++q)
values[q] = vvalues[q](component);
}