I am running my code in Debug using the latest 9.3 release. 
I have attached a minimal code and what it does it that it prints the 
constraints.

   - If BCs are applied for both parts of the system ,my output for the 
   constraint is:


   1.     0 = 0
   2.     1 = 0
   3.     2 = 0
   4.     3 = 0
   5.     4 = 1.00000
   6.     5 = 0
   7.     6 = 1.00000
   8.     7 = 0


   - If BCs are applied for the first part of the system, my output for the 
   constraint is:


   1.     0 = 0
   2.     2 = 0
   3.     4 = 1.00000
   4.     6 = 1.00000


   - If BCs are applied for he first partof the system my output for the 
   constraint is:


   1.     1 = 0
   2.     3 = 0
   3.     5 = 0
   4.     7 = 0




On Monday, May 3, 2021 at 8:22:58 PM UTC-4 Wolfgang Bangerth wrote:

> On 5/3/21 7:43 AM, Abbas Ballout wrote:
> > *The right hand side of the second equation isn't being updated when I 
> apply 
> > BCs even though the system matrix is.
> > *
> > 1) Hints on what I might be missing in my code?
> > 2) Any suggested workarounds in case that there is an actual bug?
>
> That's too far downstream. You have a suspicion that a function isn't 
> working 
> as expected (which is totally plausible), so let's check that right after 
> that 
> function is called. Dealing with the right hand side happens much later in 
> your program, and many other things could have gone wrong in the meantime. 
> I 
> would just print the constraints right after they were computed and check 
> that 
> first.
>
> Best
> W>
>
> -- 
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/14582a5f-b419-481b-8129-dee84f4601d2n%40googlegroups.com.
#include <deal.II/base/function.h>

#include <deal.II/dofs/dof_handler.h>

#include <deal.II/fe/fe_nedelec.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/mapping_q.h>

#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>

#include <deal.II/lac/affine_constraints.h>

#include <deal.II/numerics/vector_tools.h>

//You will want to set this 
#include "/home/abbas/deal.ii-candi/dealii/dealii/tests/tests.h"

using namespace dealii; 

  class BC_class: public Function<3>
  {
  public:
    BC_class(): Function<3>(3)  
    {}

    void vector_value_list(const std::vector<Point<3>> &points,
                      std::vector<Vector<double>> &  values) const override;
  };

  void BC_class::vector_value_list(const std::vector<Point<3>> &points,
                      std::vector<Vector<double>> &  values) const 
 {
    for (unsigned int i = 0; i < points.size(); ++i)
      {
        values[i][0] = 1.0;
        values[i][1] = 0.0;
        values[i][2] = 0.0;
      }
  }
  

int main()
{ Triangulation<3> triangulation ; 
  
  GridGenerator::hyper_cube(triangulation); 
  triangulation.begin_active()->face(4)->set_boundary_id(1);  //set the 4th boundary id to 1 to apply dirichlet BC

  DoFHandler<3>      dof_handler(triangulation);
  FESystem<3>    fe(FE_Nedelec<3>(0),2);  
  dof_handler.distribute_dofs(fe);


  AffineConstraints<double> constraints;
  constraints.clear();
  BC_class new_BC; 

  //Apply BC on the first part of the system
      VectorTools::project_boundary_values_curl_conforming_l2(
        dof_handler,
        0,  //the first 3 compenents
        new_BC,
        1,  //face ID1
        constraints,
        StaticMappingQ1<3>::mapping);
//Apply BC on the second part of the system
      VectorTools::project_boundary_values_curl_conforming_l2(
        dof_handler,
        3,      //the second 3 components 
        new_BC,
        1,   //face ID1
        constraints,
        StaticMappingQ1<3>::mapping);

     constraints.close();

    initlog();
    constraints.print(deallog.get_file_stream());
  
}

Reply via email to