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
make_flux_sparsity_pattern() revision #14868
Conversation
…ed checks; It's better to move it after the main logic the face loop; Moreover, face_has_flux_coupling may be impossible to run o if, for example, the neighbor is not active element;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this makes a lot of sense to me: Why check the users' predicate if we do not consider this face anyways?
Can you please add a simple test that calls this function with a predicate function that prints cell indices of the cell and its neighbor to deallog
?
(I am hoping somebody else can review the series of PRs Vladimir will open as we were working together)
…er which outputs to deallog. This should happen exactly once for every face.
* --------------------------------------------------------------------- | ||
*/ | ||
|
||
// @sect3{Include files} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace this comment with a short description of what this test does.
|
||
|
||
|
||
// @sect3{The main() function} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove these comments
dof_handler.distribute_dofs(finite_element); | ||
|
||
// Compute the sparsity pattern specifying a face filter | ||
DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you also want to print the pattern?
Triangulation<dim> triangulation; | ||
make_two_elements(triangulation); | ||
|
||
deallog << "dealii::Sparsity" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove this line?
const unsigned int face_index) | ||
{ | ||
bool on_OY = (std::abs(cell->face(face_index)->center()(0)) < 0.01); | ||
deallog.get_file_stream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deallog.get_file_stream() | |
deallog |
deallog.get_file_stream() | ||
<< "This sentence should appear once when the corresponding face is visited only once" | ||
<< std::endl; | ||
deallog.get_file_stream() << cell->index() << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deallog.get_file_stream() << cell->index() << std::endl; | |
deallog << "cell index:" << cell->index() << std::endl; |
|
||
// @sect3{Include files} | ||
|
||
#include <deal.II/base/convergence_table.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you go through and remove some of the unnecessary headers?
Timo, |
…ription is added; headers are trimmed;
170e100
to
44fa21d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, nice work!
face_has_flux_coupling may be a predicate made of multiple, complicated checks; It's better to move it after the main logic the face loop; Moreover, face_has_flux_coupling may be impossible to run if, for example, the neighbor is not an active element;