On Sun, Mar 27, 2011 at 11:42 AM, Wolfgang Bangerth
<[email protected]>wrote:

>
> > I'm trying to implement a specular BC, i.e. the boundary condition for
> the
> > direction analyzed (output direction) is the result of the reflection at
> > the boundary of another direction (input direction) that has been already
> > solved in previous steps.
> >
> > I store the solution for every direction as:
> >
> >    BlockVector<double> angular_solution
>
> Do I understand correctly that each block of this block vector corresponds
> to
> a single angle? If so, do you build a global matrix for the whole coupled
> problem?
>
> Each block of this block vector correspond to a single angle yes, but
having tried solving the problem for a global matrix I realized that it was
prohibitively heavy for the memory of the computer, as my matrix was
n_angles*(dof_handler.n_dofs())^2 size, so I went to solve each angle at a
time.

I solve each angle independently, looping over the angles until convergence.
The solution is stored as a BlockVector<double> for the solution processing
to be easier after every angle calculation.

>
> > Can I define
> >
> >    Function<dim> input_solution (Vector<double> solution)
> >
> > to put in
> >
> >
> >
> VectorTools::interpolate_boundary_values(dof_handler,'1',input_solution<dim
> > > (angular_solution.block(i)),boundary_values)
> >
> > If so, how do I define it?
>
> No, there is not currently any way to do this. In particular, since by the
> time you solve for block i you need the solution of block j, but that isn't
> available yet.
>
> I believe the simplest way to deal with this is to realize that at each
> boundary point, you can write your boundary condition in the form
>    u_j(x) = u_{opposite(j)}(x)
> where j indicates the angle and, if I understand corrrectly, corresponds to
> the blocks of your solution. In terms of degrees of freedom, this means
> that
> you can write it as
>  U_k = U_m
> for some pair of global DoF indices k,m; if angles don't exactly match,
> then
> the right hand side is not just a single DoF but a linear combination of
> other
> DoFs. In either case, this is exactly the case the ConstraintMatrix class
> handles. You may want to look through step-45 which deals with setting up
> such
> a constraint object for the case of periodic boundary conditions.
>
> Best
>  W.
>
> -------------------------------------------------------------------------
> Wolfgang Bangerth                email:            [email protected]
>                                 www: http://www.math.tamu.edu/~bangerth/
>

You see that in every step I have the solution for the other angles, in the
first loop all the solution is zero, but going further with the loop it gets
convergence. That's why I wanted to try to use interpolate_boundary_values
with a Function<dim> that is able to accept the solution vector and
dof_handler as arguments.

I'll read step-45 more carefully, but even when every system is independent
I will not be able to pass the solution and dof_handler to the boundary
function as an argument?

Thank you VERY much!
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to