Bhanu,
[...]
> VectorTools::interpolate_boundary_values(move_dof_handler, 106,
> move_boundary_values_function, move_boundary_values);
> MatrixTools::apply_boundary_values(move_boundary_values,
> move_system_matrix, move_solution, move_system_rhs);
>
> instead of 'constraints'.
> Now, I have to add the current time step dirichlet values to the 'previous
> cumulative dirichlet values at this boundary' in my
> 'move_boundary_values_function' object of type 'template <int dim> class
> MoveBoundaryValues106 : public Function<dim>'. How can I accomplish this in
> my member function
>
> template <int dim>
> void MoveBoundaryValues106<dim>::vector_value(const Point<dim> &p,
> Vector<double> &values) const
> {
> // std::vector<Tensor<1,dim>>
> previouscumulative(n_boundary_dofs_of_type_106);
> const double time = this->get_time();
> previuouscumulative += get_function_values();
>
> values[0] = previouscumulative[];
> values[1] = previouscumulative[];
> values[2] = previouscumulative[];
> values[3] = previouscumulative[];
> }
>
So you have a time-dependent Function class that only returns an update
instead of the new value?
In this case, I would still call
VectorTools::interpolate_boundary_values(move_dof_handler, 106,
move_boundary_values_function, move_boundary_values_update);
and add to the previous vector
for (auto& it=move_boundary_values.begin(); it!=move_boundary_values.end();
++it)
it->second += move_boundary_values_update[it->first];
Since move_boundary_values are also just the boundary values for your
previous solution, you could also compute move_boundary_values on the fly
by extracting the boundary DoFs using DoFTools::extract_boundary_dofs
<https://www.dealii.org/8.5.1/doxygen/deal.II/namespaceDoFTools.html#ad3067f335a97de429176178689222f3a>
and accessing the respective values in the solution vector, i.e.
for (const IndexSet::ElementIterator& it=boundary_dofs.begin();
it!=boundary_dofs.end(); ++it)
move_boundary_values[*it] = solution(*it) +
move_boundary_values_update[*it];
This is also the approach you would need to use if you want to refine your
mesh between time steps.
All of this would of course be much simpler if your Function class would
simply return the actual values and not just an update.
Best,
Daniel
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.