Hi Jean,

Thanks for your reply. 

If I understand correctly, I dont think that will work. The reason is 
because of the Dirichlet boundary conditions, the value of the rhs at those 
nodes is unknown until you solve for the system.




On Wednesday, August 1, 2018 at 10:08:12 AM UTC-4, Jean-Paul Pelteret wrote:
>
> Hi Rajat,
>
> Could you perhaps assemble a second RHS vector with an empty constraint 
> matrix, and then extract the entries in this vector that are constrained by 
> the primary constraint matrix? i.e. something like
>
> PETScVector unconstrained_rhs_vector;
> ConstraintMatrix empty_constraints;
> empty_constraints.close();
>
> // Assembly
> empty_constraints.distribute_local_to_global(local_rhs_vector, 
> local_dof_indices, unconstrained_rhs_vector);
>
> …..
> // Extraction
>
> for (unsigned int d=0; d<dof_handler.n_dofs(); ++d)
>   if (locally_owned_dofs.is_element(d) && constraints.is_constrained(d) 
> && !hanging_node_constraints.is_constrained(d))
>     const double value = unconstrained_rhs_vector(d);
>
> Best,
> Jean-Paul
>
> On 01 Aug 2018, at 05:33, RAJAT ARORA <[email protected] <javascript:>> 
> wrote:
>
> Hi,
>
> I am using deal.ii linked with MPI and Petsc in my PhD work. 
>
> I have a problem to which I have a temporary solution but I think it can 
> be done in a better way.
>
> The problem is as follows: Lets say we are solving an equation with some 
> Dirichlet boundary conditions (DBC).
> As I assemble the system (using constraints.distribute_local_to_global), 
> the matrix  and rhs are modified to give zero values for the solution at 
> the dofs where DBC are specified.
>
> So, I call constraints.distribute to correctly set the known values.
>
> However, now how do I get the value of the rhs at the nodes where DBC were 
> specified?
>
> The way I do this is to simultaneously assemble another stiffness matrix 
> without any knowledge of Dirichlet constraints. I then multiply the 
> obtained solution with this stiffness matrix
> to the full known rhs.
>
> Is this optimal way of doing this or can this be done in a better way 
> (without assembly the matrix twice)? 
>
> The other way I can think of doing the same thing but on a local element 
> level. If I donot need it everywhere then this may be cheaper.
>
> Thanks.
>
> -- 
> 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] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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.

Reply via email to