Dear all

I have two  ConstraintMatrix objects A and B. I wish to remove from A dof 
constrained in A that are already constrained in B. 

My strategy is as follows:
        loop over all dof dd
                check if the dof dd is constrained in A:        
A.is_constrained(dd)
                check if the dof dd is constrained in B:        
B.is_constrained(dd)
                if the current dof dd is constrained in A but not in B then I 
add the current dof to an IndexSet called filter
        end_loop

Now I wish to use the method add_selected_constraints to create a reduced 
version of the ConstraintMatrix A that excludes the dof constrained in A that 
are also constrained in B. Naively, I thought the following would work:
         ConstraintMatrix C(A);
        A.clear ();
        A.add_selected_constraints(C, filter);

The problem is that filter is not a list of dof. Rather, based on the 
documentation and source, it appears to be the line number or some internal 
storage index. The documentation states:
        "Constrained dofs are transformed to local index space of the filter"

How does one create a filter then as there appears to be no way to obtain the 
line index from the dof?

Here is an example where I assumed (wrongly) the filter was a list of dof:

The ConstraintMatrix A I wish to copy from is:
0 = 0
1 = 0
2 = 0
3 = 0
5 = 0
6 = 0
7 = 0

The IndexSet named filter is:
        {[0,3], [5,7]}

Note,  4 is unconstrained in A and is not in the filter either

So if I call the method add_selected_constraints from an empty ConstraintMatrix 
C I would expect to get the ConstraintMatrix A again. 
        ConstraintMatrix C;
        C.add_selected_constraints(A,filter);

But I get this for C:
0 = 0
1 = 0
2 = 0
3 = 0
4 = 0
5 = 0
6 = 0
7 = 0

So, now 4 appears constrained in C! This must be wrong as 4 is not in the 
filter and the documentations states:
        "elements not present in the IndexSet are ignored"


What am I missing? 

Any help is, as usual most appreciated.

Kind regards
Andrew

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

Reply via email to