I'd like to simulate four coupled PDEs (with variables A, B, C and D) using
deal.II. At each step in time I'm interested in the maximum and minimum
value of each variable. Therefore, I have to loop over my solution, and
gather the maximum and minimum value of each variable by using
vector_t local_solution;
present_solution.update_ghost_values();
local_solution = present_solution;
IndexSet locally_owned_elements = local_solution.locally_owned_elements();
locally_owned_elements.compress();
for(auto index: present_solution.locally_owned_elements()) {
if(A_value_mask.is_element(locally_owned_elements.index_within_set(index)))
{
max_A_value = std::max(max_A_value,
static_cast<double>(local_solution(index)));
min_A_value = std::min(min_A_value,
static_cast<double>(local_solution(index)));
}
}
To create A_value_mask, I use
const FEValuesExtractors::Scalar surface_A(0);
const ComponentMask surface_A_mask = fe.component_mask(surface_A);
IndexSet A_value_mask = DoFTools::extract_dofs(dof_handler, surface_A_mask);
For 2.4 million elements and four variables (i.e. four calls), this second
part (more specifically the call extract_dofs()) takes ~120 sec., which
takes up ~30% of the total run time. I have to use such a construct three
times in my code, resulting in 360 sec. spend in extracting dofs, and ~40
sec. in the other parts of the program. Is that by design, or is there
something wrong in my code?
Thanks!
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/80a29cd6-d2e8-447d-a0a9-89b2e0fc4b32n%40googlegroups.com.