private:
/**
- * A reference to the FEValuesBase object we operate on.
+ * A pointer to the FEValuesBase object we operate on.
*/
- const FEValuesBase<dim,spacedim> &fe_values;
+ const SmartPointer<const FEValuesBase<dim,spacedim> > fe_values;
/**
* The single scalar component this view represents of the FEValuesBase
private:
/**
- * A reference to the FEValuesBase object we operate on.
+ * A pointer to the FEValuesBase object we operate on.
*/
- const FEValuesBase<dim,spacedim> &fe_values;
+ const SmartPointer<const FEValuesBase<dim,spacedim> > fe_values;
/**
* The first component of the vector this view represents of the
private:
/**
- * A reference to the FEValuesBase object we operate on.
+ * A pointer to the FEValuesBase object we operate on.
*/
- const FEValuesBase<dim, spacedim> &fe_values;
+ const SmartPointer<const FEValuesBase<dim, spacedim> > fe_values;
/**
* The first component of the vector this view represents of the
private:
/**
- * A reference to the FEValuesBase object we operate on.
+ * A pointer to the FEValuesBase object we operate on.
*/
- const FEValuesBase<dim, spacedim> &fe_values;
+ const SmartPointer<const FEValuesBase<dim, spacedim> > fe_values;
/**
* The first component of the vector this view represents of the
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_values,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_values,
typename FVB::ExcAccessToUninitializedField("update_values"));
// an adaptation of the FEValuesBase::shape_value_component function
// except that here we know the component as fixed and we have
// pre-computed and cached a bunch of information. See the comments there.
if (shape_function_data[shape_function].is_nonzero_shape_function_component)
- return fe_values.finite_element_output.shape_values(shape_function_data[shape_function]
- .row_index,
- q_point);
+ return fe_values->finite_element_output.shape_values(shape_function_data[shape_function]
+ .row_index,
+ q_point);
else
return 0;
}
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_gradients,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
// an adaptation of the
// pre-computed and cached a bunch of
// information. See the comments there.
if (shape_function_data[shape_function].is_nonzero_shape_function_component)
- return fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function]
- .row_index][q_point];
+ return fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function]
+ .row_index][q_point];
else
return gradient_type();
}
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_hessians,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_hessians,
typename FVB::ExcAccessToUninitializedField("update_hessians"));
// an adaptation of the
// pre-computed and cached a bunch of
// information. See the comments there.
if (shape_function_data[shape_function].is_nonzero_shape_function_component)
- return fe_values.finite_element_output.shape_hessians[shape_function_data[shape_function].row_index][q_point];
+ return fe_values->finite_element_output.shape_hessians[shape_function_data[shape_function].row_index][q_point];
else
return hessian_type();
}
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_3rd_derivatives,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_3rd_derivatives,
typename FVB::ExcAccessToUninitializedField("update_3rd_derivatives"));
// an adaptation of the
// pre-computed and cached a bunch of
// information. See the comments there.
if (shape_function_data[shape_function].is_nonzero_shape_function_component)
- return fe_values.finite_element_output.shape_3rd_derivatives[shape_function_data[shape_function].row_index][q_point];
+ return fe_values->finite_element_output.shape_3rd_derivatives[shape_function_data[shape_function].row_index][q_point];
else
return third_derivative_type();
}
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_values,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_values,
typename FVB::ExcAccessToUninitializedField("update_values"));
// same as for the scalar case except
{
value_type return_value;
return_value[shape_function_data[shape_function].single_nonzero_component_index]
- = fe_values.finite_element_output.shape_values(snc,q_point);
+ = fe_values->finite_element_output.shape_values(snc,q_point);
return return_value;
}
else
for (unsigned int d=0; d<dim; ++d)
if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
return_value[d]
- = fe_values.finite_element_output.shape_values(shape_function_data[shape_function].row_index[d],q_point);
+ = fe_values->finite_element_output.shape_values(shape_function_data[shape_function].row_index[d],q_point);
return return_value;
}
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_gradients,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
// same as for the scalar case except
{
gradient_type return_value;
return_value[shape_function_data[shape_function].single_nonzero_component_index]
- = fe_values.finite_element_output.shape_gradients[snc][q_point];
+ = fe_values->finite_element_output.shape_gradients[snc][q_point];
return return_value;
}
else
for (unsigned int d=0; d<dim; ++d)
if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
return_value[d]
- = fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point];
+ = fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point];
return return_value;
}
// this function works like in
// the case above
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_gradients,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
// same as for the scalar case except
return divergence_type();
else if (snc != -1)
return
- fe_values.finite_element_output.shape_gradients[snc][q_point][shape_function_data[shape_function].single_nonzero_component_index];
+ fe_values->finite_element_output.shape_gradients[snc][q_point][shape_function_data[shape_function].single_nonzero_component_index];
else
{
divergence_type return_value = 0;
for (unsigned int d=0; d<dim; ++d)
if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
return_value
- += fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point][d];
+ += fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point][d];
return return_value;
}
// this function works like in the case above
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_gradients,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
// same as for the scalar case except that we have one more index
const int snc = shape_function_data[shape_function].single_nonzero_component;
// can only be zero
// or one in 2d
if (shape_function_data[shape_function].single_nonzero_component_index == 0)
- return_value[0] = -1.0 * fe_values.finite_element_output.shape_gradients[snc][q_point][1];
+ return_value[0] = -1.0 * fe_values->finite_element_output.shape_gradients[snc][q_point][1];
else
- return_value[0] = fe_values.finite_element_output.shape_gradients[snc][q_point][0];
+ return_value[0] = fe_values->finite_element_output.shape_gradients[snc][q_point][0];
return return_value;
}
if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
return_value[0]
- -= fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][1];
+ -= fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][1];
if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
return_value[0]
- += fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][0];
+ += fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][0];
return return_value;
}
case 0:
{
return_value[0] = 0;
- return_value[1] = fe_values.finite_element_output.shape_gradients[snc][q_point][2];
- return_value[2] = -1.0 * fe_values.finite_element_output.shape_gradients[snc][q_point][1];
+ return_value[1] = fe_values->finite_element_output.shape_gradients[snc][q_point][2];
+ return_value[2] = -1.0 * fe_values->finite_element_output.shape_gradients[snc][q_point][1];
return return_value;
}
case 1:
{
- return_value[0] = -1.0 * fe_values.finite_element_output.shape_gradients[snc][q_point][2];
+ return_value[0] = -1.0 * fe_values->finite_element_output.shape_gradients[snc][q_point][2];
return_value[1] = 0;
- return_value[2] = fe_values.finite_element_output.shape_gradients[snc][q_point][0];
+ return_value[2] = fe_values->finite_element_output.shape_gradients[snc][q_point][0];
return return_value;
}
default:
{
- return_value[0] = fe_values.finite_element_output.shape_gradients[snc][q_point][1];
- return_value[1] = -1.0 * fe_values.finite_element_output.shape_gradients[snc][q_point][0];
+ return_value[0] = fe_values->finite_element_output.shape_gradients[snc][q_point][1];
+ return_value[1] = -1.0 * fe_values->finite_element_output.shape_gradients[snc][q_point][0];
return_value[2] = 0;
return return_value;
}
if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
{
return_value[1]
- += fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][2];
+ += fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][2];
return_value[2]
- -= fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][1];
+ -= fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][1];
}
if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
{
return_value[0]
- -= fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][2];
+ -= fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][2];
return_value[2]
- += fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][0];
+ += fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][0];
}
if (shape_function_data[shape_function].is_nonzero_shape_function_component[2])
{
return_value[0]
- += fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[2]][q_point][1];
+ += fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[2]][q_point][1];
return_value[1]
- -= fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[2]][q_point][0];
+ -= fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[2]][q_point][0];
}
return return_value;
// this function works like in
// the case above
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_hessians,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_hessians,
typename FVB::ExcAccessToUninitializedField("update_hessians"));
// same as for the scalar case except
{
hessian_type return_value;
return_value[shape_function_data[shape_function].single_nonzero_component_index]
- = fe_values.finite_element_output.shape_hessians[snc][q_point];
+ = fe_values->finite_element_output.shape_hessians[snc][q_point];
return return_value;
}
else
for (unsigned int d=0; d<dim; ++d)
if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
return_value[d]
- = fe_values.finite_element_output.shape_hessians[shape_function_data[shape_function].row_index[d]][q_point];
+ = fe_values->finite_element_output.shape_hessians[shape_function_data[shape_function].row_index[d]][q_point];
return return_value;
}
// this function works like in
// the case above
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_3rd_derivatives,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_3rd_derivatives,
typename FVB::ExcAccessToUninitializedField("update_3rd_derivatives"));
// same as for the scalar case except
{
third_derivative_type return_value;
return_value[shape_function_data[shape_function].single_nonzero_component_index]
- = fe_values.finite_element_output.shape_3rd_derivatives[snc][q_point];
+ = fe_values->finite_element_output.shape_3rd_derivatives[snc][q_point];
return return_value;
}
else
for (unsigned int d=0; d<dim; ++d)
if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
return_value[d]
- = fe_values.finite_element_output.shape_3rd_derivatives[shape_function_data[shape_function].row_index[d]][q_point];
+ = fe_values->finite_element_output.shape_3rd_derivatives[shape_function_data[shape_function].row_index[d]][q_point];
return return_value;
}
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_gradients,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
// same as for the scalar case except
return symmetric_gradient_type();
else if (snc != -1)
return symmetrize_single_row (shape_function_data[shape_function].single_nonzero_component_index,
- fe_values.finite_element_output.shape_gradients[snc][q_point]);
+ fe_values->finite_element_output.shape_gradients[snc][q_point]);
else
{
gradient_type return_value;
for (unsigned int d=0; d<dim; ++d)
if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
return_value[d]
- = fe_values.finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point];
+ = fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point];
return symmetrize(return_value);
}
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_values,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_values,
typename FVB::ExcAccessToUninitializedField("update_values"));
// similar to the vector case where we
const unsigned int comp =
shape_function_data[shape_function].single_nonzero_component_index;
return_value[value_type::unrolled_to_component_indices(comp)]
- = fe_values.finite_element_output.shape_values(snc,q_point);
+ = fe_values->finite_element_output.shape_values(snc,q_point);
return return_value;
}
else
for (unsigned int d = 0; d < value_type::n_independent_components; ++d)
if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
return_value[value_type::unrolled_to_component_indices(d)]
- = fe_values.finite_element_output.shape_values(shape_function_data[shape_function].row_index[d],q_point);
+ = fe_values->finite_element_output.shape_values(shape_function_data[shape_function].row_index[d],q_point);
return return_value;
}
}
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_gradients,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
const int snc = shape_function_data[shape_function].single_nonzero_component;
// b_jj := \dfrac{\partial phi_{ii,jj}}{\partial x_jj}.
// again, all other entries of 'b' are
// zero
- const dealii::Tensor<1, spacedim> phi_grad = fe_values.finite_element_output.shape_gradients[snc][q_point];
+ const dealii::Tensor<1, spacedim> phi_grad = fe_values->finite_element_output.shape_gradients[snc][q_point];
divergence_type return_value;
return_value[ii] = phi_grad[jj];
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_values,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_values,
typename FVB::ExcAccessToUninitializedField("update_values"));
// similar to the vector case where we
const unsigned int comp =
shape_function_data[shape_function].single_nonzero_component_index;
const TableIndices<2> indices = dealii::Tensor<2,spacedim>::unrolled_to_component_indices(comp);
- return_value[indices] = fe_values.finite_element_output.shape_values(snc,q_point);
+ return_value[indices] = fe_values->finite_element_output.shape_values(snc,q_point);
return return_value;
}
else
{
const TableIndices<2> indices = dealii::Tensor<2,spacedim>::unrolled_to_component_indices(d);
return_value[indices]
- = fe_values.finite_element_output.shape_values(shape_function_data[shape_function].row_index[d],q_point);
+ = fe_values->finite_element_output.shape_values(shape_function_data[shape_function].row_index[d],q_point);
}
return return_value;
}
const unsigned int q_point) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (shape_function < fe_values.fe->dofs_per_cell,
- ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
- Assert (fe_values.update_flags & update_gradients,
+ Assert (shape_function < fe_values->fe->dofs_per_cell,
+ ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
const int snc = shape_function_data[shape_function].single_nonzero_component;
const unsigned int ii = indices[0];
const unsigned int jj = indices[1];
- const dealii::Tensor<1, spacedim> phi_grad = fe_values.finite_element_output.shape_gradients[snc][q_point];
+ const dealii::Tensor<1, spacedim> phi_grad = fe_values->finite_element_output.shape_gradients[snc][q_point];
divergence_type return_value;
return_value[jj] = phi_grad[ii];
Scalar<dim,spacedim>::Scalar (const FEValuesBase<dim,spacedim> &fe_values,
const unsigned int component)
:
- fe_values (fe_values),
+ fe_values (&fe_values),
component (component),
- shape_function_data (fe_values.fe->dofs_per_cell)
+ shape_function_data (this->fe_values->fe->dofs_per_cell)
{
- Assert (component < fe_values.fe->n_components(),
- ExcIndexRange(component, 0, fe_values.fe->n_components()));
+ const FiniteElement<dim, spacedim> &fe = *this->fe_values->fe;
+ Assert (component < fe.n_components(),
+ ExcIndexRange(component, 0, fe.n_components()));
//TODO: we'd like to use the fields with the same name as these
// variables from FEValuesBase, but they aren't initialized yet
// at the time we get here, so re-create it all
const std::vector<unsigned int> shape_function_to_row_table
- = make_shape_function_to_row_table (*fe_values.fe);
+ = make_shape_function_to_row_table (fe);
- for (unsigned int i=0; i<fe_values.fe->dofs_per_cell; ++i)
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
{
- const bool is_primitive = (fe_values.fe->is_primitive() ||
- fe_values.fe->is_primitive(i));
+ const bool is_primitive = fe.is_primitive() || fe.is_primitive(i);
if (is_primitive == true)
shape_function_data[i].is_nonzero_shape_function_component
= (component ==
- fe_values.fe->system_to_component_index(i).first);
+ fe.system_to_component_index(i).first);
else
shape_function_data[i].is_nonzero_shape_function_component
- = (fe_values.fe->get_nonzero_components(i)[component]
+ = (fe.get_nonzero_components(i)[component]
== true);
if (shape_function_data[i].is_nonzero_shape_function_component == true)
shape_function_data[i].row_index
- = shape_function_to_row_table[i*fe_values.fe->n_components()+component];
+ = shape_function_to_row_table[i*fe.n_components()+component];
else
shape_function_data[i].row_index = numbers::invalid_unsigned_int;
}
template <int dim, int spacedim>
Scalar<dim,spacedim>::Scalar ()
:
- fe_values (*static_cast<dealii::FEValuesBase<dim,spacedim>*>(0)),
+ fe_values (NULL),
component (numbers::invalid_unsigned_int)
{}
Vector<dim,spacedim>::Vector (const FEValuesBase<dim,spacedim> &fe_values,
const unsigned int first_vector_component)
:
- fe_values (fe_values),
+ fe_values (&fe_values),
first_vector_component (first_vector_component),
- shape_function_data (fe_values.fe->dofs_per_cell)
+ shape_function_data (this->fe_values->fe->dofs_per_cell)
{
- Assert (first_vector_component+spacedim-1 < fe_values.fe->n_components(),
+ const FiniteElement<dim, spacedim> &fe = *this->fe_values->fe;
+ Assert (first_vector_component+spacedim-1 < fe.n_components(),
ExcIndexRange(first_vector_component+spacedim-1, 0,
- fe_values.fe->n_components()));
+ fe.n_components()));
//TODO: we'd like to use the fields with the same name as these
// variables from FEValuesBase, but they aren't initialized yet
// at the time we get here, so re-create it all
const std::vector<unsigned int> shape_function_to_row_table
- = make_shape_function_to_row_table (*fe_values.fe);
+ = make_shape_function_to_row_table (fe);
for (unsigned int d=0; d<spacedim; ++d)
{
const unsigned int component = first_vector_component + d;
- for (unsigned int i=0; i<fe_values.fe->dofs_per_cell; ++i)
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
{
- const bool is_primitive = (fe_values.fe->is_primitive() ||
- fe_values.fe->is_primitive(i));
+ const bool is_primitive = fe.is_primitive() || fe.is_primitive(i);
if (is_primitive == true)
shape_function_data[i].is_nonzero_shape_function_component[d]
= (component ==
- fe_values.fe->system_to_component_index(i).first);
+ fe.system_to_component_index(i).first);
else
shape_function_data[i].is_nonzero_shape_function_component[d]
- = (fe_values.fe->get_nonzero_components(i)[component]
+ = (fe.get_nonzero_components(i)[component]
== true);
if (shape_function_data[i].is_nonzero_shape_function_component[d]
== true)
shape_function_data[i].row_index[d]
- = shape_function_to_row_table[i*fe_values.fe->n_components()+component];
+ = shape_function_to_row_table[i*fe.n_components()+component];
else
shape_function_data[i].row_index[d]
= numbers::invalid_unsigned_int;
}
}
- for (unsigned int i=0; i<fe_values.fe->dofs_per_cell; ++i)
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
{
unsigned int n_nonzero_components = 0;
for (unsigned int d=0; d<spacedim; ++d)
template <int dim, int spacedim>
Vector<dim,spacedim>::Vector ()
:
- fe_values (*static_cast<dealii::FEValuesBase<dim,spacedim>*>(0)),
+ fe_values (NULL),
first_vector_component (numbers::invalid_unsigned_int)
{}
SymmetricTensor(const FEValuesBase<dim, spacedim> &fe_values,
const unsigned int first_tensor_component)
:
- fe_values(fe_values),
+ fe_values(&fe_values),
first_tensor_component(first_tensor_component),
- shape_function_data(fe_values.fe->dofs_per_cell)
+ shape_function_data(this->fe_values->fe->dofs_per_cell)
{
+ const FiniteElement<dim, spacedim> &fe = *this->fe_values->fe;
Assert(first_tensor_component + (dim*dim+dim)/2 - 1
<
- fe_values.fe->n_components(),
+ fe.n_components(),
ExcIndexRange(first_tensor_component +
dealii::SymmetricTensor<2,dim>::n_independent_components - 1,
0,
- fe_values.fe->n_components()));
+ fe.n_components()));
//TODO: we'd like to use the fields with the same name as these
// variables from FEValuesBase, but they aren't initialized yet
// at the time we get here, so re-create it all
const std::vector<unsigned int> shape_function_to_row_table
- = make_shape_function_to_row_table (*fe_values.fe);
+ = make_shape_function_to_row_table (fe);
for (unsigned int d = 0; d < dealii::SymmetricTensor<2,dim>::n_independent_components; ++d)
{
const unsigned int component = first_tensor_component + d;
- for (unsigned int i = 0; i < fe_values.fe->dofs_per_cell; ++i)
+ for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
{
- const bool is_primitive = (fe_values.fe->is_primitive() ||
- fe_values.fe->is_primitive(i));
+ const bool is_primitive = fe.is_primitive() || fe.is_primitive(i);
if (is_primitive == true)
shape_function_data[i].is_nonzero_shape_function_component[d]
= (component ==
- fe_values.fe->system_to_component_index(i).first);
+ fe.system_to_component_index(i).first);
else
shape_function_data[i].is_nonzero_shape_function_component[d]
- = (fe_values.fe->get_nonzero_components(i)[component]
+ = (fe.get_nonzero_components(i)[component]
== true);
if (shape_function_data[i].is_nonzero_shape_function_component[d]
== true)
shape_function_data[i].row_index[d]
- = shape_function_to_row_table[i*fe_values.fe->n_components()+component];
+ = shape_function_to_row_table[i*fe.n_components()+component];
else
shape_function_data[i].row_index[d]
= numbers::invalid_unsigned_int;
}
}
- for (unsigned int i = 0; i < fe_values.fe->dofs_per_cell; ++i)
+ for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
{
unsigned int n_nonzero_components = 0;
for (unsigned int d = 0; d < dealii::SymmetricTensor<2,dim>::n_independent_components; ++d)
template <int dim, int spacedim>
SymmetricTensor<2, dim, spacedim>::SymmetricTensor()
:
- fe_values(*static_cast<dealii::FEValuesBase<dim, spacedim>*> (0)),
+ fe_values(NULL),
first_tensor_component(numbers::invalid_unsigned_int)
{}
Tensor(const FEValuesBase<dim, spacedim> &fe_values,
const unsigned int first_tensor_component)
:
- fe_values(fe_values),
+ fe_values(&fe_values),
first_tensor_component(first_tensor_component),
- shape_function_data(fe_values.fe->dofs_per_cell)
+ shape_function_data(this->fe_values->fe->dofs_per_cell)
{
+ const FiniteElement<dim, spacedim> &fe = *this->fe_values->fe;
Assert(first_tensor_component + dim*dim - 1
<
- fe_values.fe->n_components(),
+ fe.n_components(),
ExcIndexRange(first_tensor_component +
dim*dim - 1,
0,
- fe_values.fe->n_components()));
+ fe.n_components()));
//TODO: we'd like to use the fields with the same name as these
// variables from FEValuesBase, but they aren't initialized yet
// at the time we get here, so re-create it all
const std::vector<unsigned int> shape_function_to_row_table
- = make_shape_function_to_row_table (*fe_values.fe);
+ = make_shape_function_to_row_table (fe);
for (unsigned int d = 0; d < dim*dim; ++d)
{
const unsigned int component = first_tensor_component + d;
- for (unsigned int i = 0; i < fe_values.fe->dofs_per_cell; ++i)
+ for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
{
- const bool is_primitive = (fe_values.fe->is_primitive() ||
- fe_values.fe->is_primitive(i));
+ const bool is_primitive = fe.is_primitive() || fe.is_primitive(i);
if (is_primitive == true)
shape_function_data[i].is_nonzero_shape_function_component[d]
= (component ==
- fe_values.fe->system_to_component_index(i).first);
+ fe.system_to_component_index(i).first);
else
shape_function_data[i].is_nonzero_shape_function_component[d]
- = (fe_values.fe->get_nonzero_components(i)[component]
+ = (fe.get_nonzero_components(i)[component]
== true);
if (shape_function_data[i].is_nonzero_shape_function_component[d]
== true)
shape_function_data[i].row_index[d]
- = shape_function_to_row_table[i*fe_values.fe->n_components()+component];
+ = shape_function_to_row_table[i*fe.n_components()+component];
else
shape_function_data[i].row_index[d]
= numbers::invalid_unsigned_int;
}
}
- for (unsigned int i = 0; i < fe_values.fe->dofs_per_cell; ++i)
+ for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
{
unsigned int n_nonzero_components = 0;
for (unsigned int d = 0; d < dim*dim; ++d)
template <int dim, int spacedim>
Tensor<2, dim, spacedim>::Tensor()
:
- fe_values(*static_cast<dealii::FEValuesBase<dim, spacedim>*> (0)),
+ fe_values(NULL),
first_tensor_component(numbers::invalid_unsigned_int)
{}
std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &values) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_values,
+ Assert (fe_values->update_flags & update_values,
typename FVB::ExcAccessToUninitializedField("update_values"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell and call internal worker function
- dealii::Vector<typename InputVector::value_type> dof_values(fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values(fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_values<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_values, shape_function_data, values);
+ (dof_values, fe_values->finite_element_output.shape_values, shape_function_data, values);
}
std::vector<typename ProductType<gradient_type,typename InputVector::value_type>::type> &gradients) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_gradients,
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_derivatives<1,dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, gradients);
+ (dof_values, fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
}
std::vector<typename ProductType<hessian_type,typename InputVector::value_type>::type> &hessians) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_hessians,
+ Assert (fe_values->update_flags & update_hessians,
typename FVB::ExcAccessToUninitializedField("update_hessians"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_derivatives<2,dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_hessians, shape_function_data, hessians);
+ (dof_values, fe_values->finite_element_output.shape_hessians, shape_function_data, hessians);
}
std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &laplacians) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_hessians,
+ Assert (fe_values->update_flags & update_hessians,
typename FVB::ExcAccessToUninitializedField("update_hessians"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_laplacians<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_hessians, shape_function_data, laplacians);
+ (dof_values, fe_values->finite_element_output.shape_hessians, shape_function_data, laplacians);
}
std::vector<typename ProductType<third_derivative_type,typename InputVector::value_type>::type> &third_derivatives) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_3rd_derivatives,
+ Assert (fe_values->update_flags & update_3rd_derivatives,
typename FVB::ExcAccessToUninitializedField("update_3rd_derivatives"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_derivatives<3,dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
+ (dof_values, fe_values->finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
}
std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &values) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_values,
+ Assert (fe_values->update_flags & update_values,
typename FVB::ExcAccessToUninitializedField("update_values"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_values<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_values, shape_function_data, values);
+ (dof_values, fe_values->finite_element_output.shape_values, shape_function_data, values);
}
std::vector<typename ProductType<gradient_type,typename InputVector::value_type>::type> &gradients) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_gradients,
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_derivatives<1,dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, gradients);
+ (dof_values, fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
}
std::vector<typename ProductType<symmetric_gradient_type,typename InputVector::value_type>::type> &symmetric_gradients) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_gradients,
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_symmetric_gradients<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data,
+ (dof_values, fe_values->finite_element_output.shape_gradients, shape_function_data,
symmetric_gradients);
}
std::vector<typename ProductType<divergence_type,typename InputVector::value_type>::type> &divergences) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_gradients,
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs
// on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_divergences<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, divergences);
+ (dof_values, fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
}
template <int dim, int spacedim>
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_gradients,
+ Assert (fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
- Assert (fe_values.present_cell.get () != 0,
+ Assert (fe_values->present_cell.get () != 0,
ExcMessage ("FEValues object is not reinited to any cell"));
AssertDimension (fe_function.size (),
- fe_values.present_cell->n_dofs_for_dof_handler ());
+ fe_values->present_cell->n_dofs_for_dof_handler ());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values (fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values (fe_function, dof_values);
internal::do_function_curls<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, curls);
+ (dof_values, fe_values->finite_element_output.shape_gradients, shape_function_data, curls);
}
std::vector<typename ProductType<hessian_type,typename InputVector::value_type>::type> &hessians) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_hessians,
+ Assert (fe_values->update_flags & update_hessians,
typename FVB::ExcAccessToUninitializedField("update_hessians"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_derivatives<2,dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_hessians, shape_function_data, hessians);
+ (dof_values, fe_values->finite_element_output.shape_hessians, shape_function_data, hessians);
}
std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &laplacians) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_hessians,
+ Assert (fe_values->update_flags & update_hessians,
typename FVB::ExcAccessToUninitializedField("update_hessians"));
- Assert (laplacians.size() == fe_values.n_quadrature_points,
- ExcDimensionMismatch(laplacians.size(), fe_values.n_quadrature_points));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (laplacians.size() == fe_values->n_quadrature_points,
+ ExcDimensionMismatch(laplacians.size(), fe_values->n_quadrature_points));
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
- Assert (fe_function.size() == fe_values.present_cell->n_dofs_for_dof_handler(),
+ Assert (fe_function.size() == fe_values->present_cell->n_dofs_for_dof_handler(),
ExcDimensionMismatch(fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler()));
+ fe_values->present_cell->n_dofs_for_dof_handler()));
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_laplacians<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_hessians, shape_function_data, laplacians);
+ (dof_values, fe_values->finite_element_output.shape_hessians, shape_function_data, laplacians);
}
std::vector<typename ProductType<third_derivative_type,typename InputVector::value_type>::type> &third_derivatives) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (fe_values.update_flags & update_3rd_derivatives,
+ Assert (fe_values->update_flags & update_3rd_derivatives,
typename FVB::ExcAccessToUninitializedField("update_3rd_derivatives"));
- Assert (fe_values.present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != 0,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values (fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_derivatives<3,dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
+ (dof_values, fe_values->finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
}
std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &values) const
{
typedef FEValuesBase<dim, spacedim> FVB;
- Assert(fe_values.update_flags & update_values,
+ Assert(fe_values->update_flags & update_values,
typename FVB::ExcAccessToUninitializedField("update_values"));
- Assert(fe_values.present_cell.get() != 0,
+ Assert(fe_values->present_cell.get() != 0,
ExcMessage("FEValues object is not reinit'ed to any cell"));
AssertDimension(fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values(fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_values<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_values, shape_function_data, values);
+ (dof_values, fe_values->finite_element_output.shape_values, shape_function_data, values);
}
std::vector<typename ProductType<divergence_type,typename InputVector::value_type>::type> &divergences) const
{
typedef FEValuesBase<dim, spacedim> FVB;
- Assert(fe_values.update_flags & update_gradients,
+ Assert(fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
- Assert(fe_values.present_cell.get() != 0,
+ Assert(fe_values->present_cell.get() != 0,
ExcMessage("FEValues object is not reinit'ed to any cell"));
AssertDimension(fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs
// on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values(fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_divergences<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, divergences);
+ (dof_values, fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
}
template <int dim, int spacedim>
std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &values) const
{
typedef FEValuesBase<dim, spacedim> FVB;
- Assert(fe_values.update_flags & update_values,
+ Assert(fe_values->update_flags & update_values,
typename FVB::ExcAccessToUninitializedField("update_values"));
- Assert(fe_values.present_cell.get() != 0,
+ Assert(fe_values->present_cell.get() != 0,
ExcMessage("FEValues object is not reinit'ed to any cell"));
AssertDimension(fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values(fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_values<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_values, shape_function_data, values);
+ (dof_values, fe_values->finite_element_output.shape_values, shape_function_data, values);
}
std::vector<typename ProductType<divergence_type,typename InputVector::value_type>::type> &divergences) const
{
typedef FEValuesBase<dim, spacedim> FVB;
- Assert(fe_values.update_flags & update_gradients,
+ Assert(fe_values->update_flags & update_gradients,
typename FVB::ExcAccessToUninitializedField("update_gradients"));
- Assert(fe_values.present_cell.get() != 0,
+ Assert(fe_values->present_cell.get() != 0,
ExcMessage("FEValues object is not reinit'ed to any cell"));
AssertDimension(fe_function.size(),
- fe_values.present_cell->n_dofs_for_dof_handler());
+ fe_values->present_cell->n_dofs_for_dof_handler());
// get function values of dofs
// on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(fe_values.dofs_per_cell);
- fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+ dealii::Vector<typename InputVector::value_type> dof_values(fe_values->dofs_per_cell);
+ fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_divergences<dim,spacedim>
- (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, divergences);
+ (dof_values, fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
}
}
{
const FiniteElement<dim,spacedim> &fe = fe_values.get_fe();
- // create the views objects. allocate a
- // bunch of default-constructed ones
- // then destroy them again and do
- // in-place construction of those we
- // actually want to use (copying stuff
- // is wasteful and we can't do that
- // anyway because the class has
- // reference members)
+ // create the views objects: Allocate a bunch of default-constructed ones
+ // then destroy them again and do in-place construction of those we
+ // actually want to use.
const unsigned int n_scalars = fe.n_components();
scalars.resize (n_scalars);
for (unsigned int component=0; component<n_scalars; ++component)