James,

>  1. Using Dirichlet boundary conditions using
>     VectorTools::interpolate_boundary_values. This causes Deal.II to
>     abort with an exception complaining that the fixed DOFs are not on
>     a boundary surface - which is obviously true, but is that
>     necessary?

I'm not exactly sure what functions you are calling here, but 
VectorTools::interpolate_boundary_values really only walks over boundary 
faces, so if you want to constrain interior ones this isn't your function.


>  2. For each fixed degree of freedom i with value V_i, set the ith row
>     of the Laplace matrix to T_{ij} = \delta_{ij} and rhs_i = V_i.

This will also lead to wrong solutions because you neglect that these degrees 
of freedom also couple to their neighbors.


>  3. My third idea was to use two meshes. I.e., I would build the full
>     mesh, doing all my refinement, but before solving Poisson's
>     equation, cut out the fixed regions and apply Dirichlet boundary
>     conditions to the surfaces of the "holes". After solving, embed
>     the solution back into the full mesh.

This could work, but it would appear to me to be too complicated.

Andrew has already shown a solution that should work. Alternatively, instead 
of using a std::map<uint,double> and then MatrixTools::apply_boundary_values, 
you could also use a ConstraintMatrix, add non-zero constraints for your 
constrained degrees of freedom to it, and use ConstraintMatrix::condense on 
your matrix (or condense the matrix while copying the local contributions 
into the global matrix, to make things simpler).

Best
 W.

-------------------------------------------------------------------------
Wolfgang Bangerth                email:            [email protected]
                                 www: http://www.math.tamu.edu/~bangerth/

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to