New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test extract constant modes 04 #13513
Conversation
You also need to add an output file that contains the expected output. Otherwise your test won't be picked up by the testsuite. See also here. |
@gfcas? |
I know this is still open, but I don't have time for it currently, unfortunately. I would still like to contribute. |
@peterrum maybe you can postpone the milestone to a later verison. The test case I considered would introduce a possible failing test and at the moment I can not garantuee to be finisched for the release. Sorry! |
Now I had some time to learn the testsuite and got this test ready even before the 9.4 release. However, the test should currently fail as this case is not yet implemented. Instead of DoFTools::extract_constant_modes(dof_handler, component_mask, constant_modes); I used the following piece of code to generate the output as it should be: {
const IndexSet index_set =
DoFTools::extract_dofs(dof_handler, component_mask);
AssertDimension(constant_modes[component].size(),
dof_handler.n_locally_owned_dofs());
for (unsigned int i = 0; i < dof_handler.n_locally_owned_dofs(); ++i)
{
if (index_set.is_element(i))
{
constant_modes[component][i] = true;
}
else
{
constant_modes[component][i] = false;
}
}
} |
Now there is also a parallel test ready. @marcfehling @peterrum what's your opinion? |
Sorry, I noticed still an error in the manual extraction. The supposed output is now updated and for completeness the manual code snippet is: // Define set of constant modes
std::vector<std::vector<bool>> constant_modes(
fe_collection.n_components(),
std::vector<bool>(dof_handler.n_locally_owned_dofs(), false));
// Extract constant modes manually
for (unsigned int component = 0; component < fe_collection.n_components();
++component)
{
AssertDimension(constant_modes[component].size(),
dof_handler.n_locally_owned_dofs());
const FEValuesExtractors::Scalar component_extractor(component);
const ComponentMask component_mask(
fe_collection.component_mask(component_extractor));
const IndexSet component_index_set =
DoFTools::extract_dofs(dof_handler, component_mask);
for (unsigned int i = 0;
i < dof_handler.locally_owned_dofs().n_elements();
++i)
{
if (component_index_set.is_element(
dof_handler.locally_owned_dofs().nth_index_in_set(i)))
{
constant_modes[component][i] = true;
}
else
{
constant_modes[component][i] = false;
}
}
} |
The tests of course fail at the moment, as this feature is not yet implemented. |
Unfortunately I have currently no time to work on this. I close this and think again on this problem. |
This PR provides as first step towards the solution of #12854 a currently failing test for the function
extract_constant_modes
. Thanks to @sebproell the problem with either FE_Q or FE_Nothing was solved in #13313, however, in my multiphysics problem I have a vector-valued problem, where I use a FESystem similar to step-46 (Q_1 x Z , Z x Q_1). This testcase throws the following assert message: