On 06/23/2016 02:46 AM, Praveen C wrote:

    void add_dirichlet_constraints (const
std::map<types::global_dof_index,double> &values,
                                    ConstraintMatrix
     &constraints)
    {
       for (const auto &pair : values)
       {
          constraints.add_line (pair.first);
          constraints.set_inhomogeneity (pair.first, pair.second);
       }
    }


Yes, this would work. I would add an assertion that pair.first is not already constrained. You'll also have to avoid using the C++11-style for loop. Other than that, this looks good!

Best
 W.

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

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