Dear deal.ii team,
I am trying to remap dof indices of certain cells before assembly using the
following (sketch code):
...
const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
// Iterate over cells and remap dofs on marked cells
for (auto& cell : dof_handler.active_cell_iterators()) {
std::vector<types::global_dof_index>
local_dof_indices(dofs_per_cell);
if ( /* cell marked for remapping */ ){
fe_values.reinit(cell);
cell->get_dof_indices(local_dof_indices);
for (auto &local_dof_index: local_dof_indices)
local_dof_index = custom_remap_function(local_dof_index);
cell->set_dof_indices(local_dof_index);
}
}
Function *custom_remap_function *implements the user defined mapping.
Compiling produces the following error:
error: passing ‘const dealii::DoFCellAccessor<2, 2, false>’ as ‘this’
argument discards qualifiers [-fpermissive]
128 | cell->set_dof_indices(local_dof_indices);
Could you perhaps comment on the outlined strategy and propose a solution -
if reasonable. Hopefully I am just missing some trivialities or misusing
C++.
At the moment, I implemented the re-mapping during assembly which works
fine, but for various reasons would like to perform it before. The
motivation for doing this is to (virtually) rotate/move a part of the
domain.
~ Gordan Segon
P.S. I am using deal.ii for the past 2 years and would like to thank you
all for making the library open source and for providing all the learning
materials freely available!
--
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/71f92bbe-e4ce-4a64-932a-fad2f1197f53n%40googlegroups.com.