Hello
I think I understood how to pass solution to meshworker by looking at
step-39
For RKDG, I will be doing time iterations. The right hand side is calculated
in every time step but the MeshWorker does not change. So I put the
MeshWorker in a separate class RHSIntegrator.
But I end up getting an error from integration_loop and seems like it is not
able to change the right_hand_side
$ ./step-12
DEAL::Cycle 0
DEAL::Number of active cells: 1024
Allocating memory ...
DEAL::Number of degrees of freedom: 4096
Constructing mass matrix ...
Quadrature using 2 points
Solving by RK ...
Setting up mesh worker ...
--------------------------------------------------------
An error occurred in line <341> of file
</Users/praveen/Applications/deal.II/7.0.0/include/deal.II/base/named_data.h>
in function
DATA& dealii::NamedData<DATA>::operator()(unsigned int) [with DATA =
dealii::SmartPointer<dealii::Vector<double>,
dealii::MeshWorker::Assembler::ResidualSimple<dealii::Vector<double> > >]
The violated condition was:
!is_constant
The name and call sequence of the exception was:
ExcConstantObject()
Additional Information:
(none)
I have not been able to find the mistake and hope somebody can help. The
code is here
http://code.google.com/p/cfdlab/source/browse/trunk/deal.ii/step-12-RKDG/step-12.cc?spec=svn201&r=201
Thanks
praveen
On Sun, Jan 30, 2011 at 4:00 PM, Praveen C <[email protected]> wrote:
> Hello
>
> I am trying to modify step-12 to do explicit time-stepping RKDG.
>
> I only have to compute rhs vector using MeshWorker. So for example I modify
> integrate_cell_term as follows
>
> // Compute cell integral
>
> template <int dim>
>
> void Step12<dim>::integrate_cell_term (DoFInfo& dinfo, CellInfo& info)
>
> {
>
> const FEValuesBase<dim>& fe_v = info.fe_values();
>
> Vector<double>& local_vector = dinfo.vector(0).block(0);
>
> const std::vector<double> &JxW = fe_v.get_JxW_values ();
>
> std::vector<unsigned int>& local_dof_indices = dinfo.indices;
>
>
>
> for (unsigned int point=0; point<fe_v.n_quadrature_points; ++point)
>
> {
>
> Point<dim> beta;
>
> beta(0) = -fe_v.quadrature_point(point)(1);
>
> beta(1) = fe_v.quadrature_point(point)(0);
>
> beta /= beta.norm();
>
>
>
> for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
>
> for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
>
> local_vector(i) += beta * fe_v.shape_grad(i,point) *
>
> solution(local_dof_indices[j]) *
>
> fe_v.shape_value(j,point) *
>
> JxW[point];
>
> }
>
> }
>
>
> However since this function is static, it cannot access the class member
> variable "solution". In step-12, it is recommended to use boost:bind but I
> could not find any use of this in the examples. Where can I learn about this
> topic, preferably with some dealii examples ?
>
> Thanks
> praveen
>
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii