On 5/4/21 6:15 PM, Abbas Ballout wrote:
> 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
Abbas,
excellent little test case -- thanks for shrinking things to a size that makes
it easy for me to understand what is happening! I'm going to add a variation
of your testcase to the test suite!
The problem is that you have 6 finite element components, but your boundary
value function only provides 3 components. The function
VectorTools::project_boundary_values_curl_conforming_l2 was missing a check
for this to tell you about this requirement.
In any case, you can make things work by using this instead:
```
class BC_class : public Function<3>
{
public:
BC_class()
: Function<3>(6)
{}
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;
values[i][3] = 1.0;
values[i][4] = 0.0;
values[i][5] = 0.0;
}
}
```
Best
W.