Skip to content
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

Level set: composition (II) #26

Merged
merged 17 commits into from
Dec 30, 2020

Conversation

peterrum
Copy link
Collaborator

Follow up PR to #14.

@peterrum peterrum marked this pull request as draft December 15, 2020 05:52
Comment on lines +57 to +63
template <int dim>
void
compute_cell_diameters(const MatrixFree<dim, double> & matrix_free,
const unsigned int dof_index,
AlignedVector<VectorizedArray<double>> &cell_diameters,
double & cell_diameter_min,
double & cell_diameter_max)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mschreter FYI :)

@peterrum
Copy link
Collaborator Author

@mschreter Note that I have rebased to incorporate your changes.

Comment on lines +181 to +183
template void
initialize_projection_matrix<1, double, VectorizedArray<double>>(
const MatrixFree<1, double, VectorizedArray<double>> &matrix_free,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx!

@@ -346,5 +364,6 @@ LevelSetOKZSolverReinitialization<dim>::reinitialize(const double dt,
this->time_stepping.next();
}

template class LevelSetOKZSolverReinitialization<1>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

@peterrum peterrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -76,7 +75,6 @@ class LevelSetOKZSolverComputeCurvature
{
public:
LevelSetOKZSolverComputeCurvature(
LevelSetOKZSolverComputeNormal<dim> & normal_operator,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The curvature operator does not need the normal operator anymore.

Comment on lines 465 to 474
TimerOutput::Scope timer(*this->timer, "LS compute curvature.");
curvatur_operator->compute_curvature(diffuse_large_values);
// This function computes the curvature from the normal field. Could also
// compute the curvature directly from C, but that is less accurate. TODO:
// include that variant by a parameter
{
TimerOutput::Scope timer(*this->timer, "LS compute normal.");
this->compute_normal(false);
}
{
TimerOutput::Scope timer(*this->timer, "LS compute curvature.");
curvatur_operator->compute_curvature(diffuse_large_values);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... instead we need to call the normal operator ourselves.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will follow the same strategy in meltpool.

Copy link
Collaborator Author

@peterrum peterrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mschreter I have tried also to eliminate the normal operator from the reinitialization operator. It is significantly more complicated...

@@ -68,7 +68,6 @@ class LevelSetOKZSolverReinitialization
using BlockVectorType = LinearAlgebra::distributed::BlockVector<double>;

LevelSetOKZSolverReinitialization(
LevelSetOKZSolverComputeNormal<dim> & normal_operator,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to pass the normal operator to the constructor.

reinitialize(const double dt,
const unsigned int stab_steps,
const unsigned int diff_steps = 0,
const std::function<void(bool)> &compute_normal = [](const bool) {});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead a lambda with the effect.

@peterrum peterrum marked this pull request as ready for review December 26, 2020 19:49
@peterrum
Copy link
Collaborator Author

@kronbichler This PR should be good to be merged. We have adjusted the interface so that they can be better be used from external. Furthermore, we have enabled that parts of the code can be compiled for 1D.

@kronbichler kronbichler merged commit 91a11f8 into kronbichler:master Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants