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

[Solver] Semi-implicit Navier-Stokes solver #681

Closed
wants to merge 96 commits into from

Conversation

bodhinandach
Copy link
Contributor

Describe the PR
A draft PR to ease to check the solver structure.

@codecov
Copy link

codecov bot commented Jul 29, 2020

Codecov Report

Merging #681 into develop will decrease coverage by 3.71%.
The diff coverage is 3.52%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #681      +/-   ##
===========================================
- Coverage    96.66%   92.95%   -3.71%     
===========================================
  Files          123      134      +11     
  Lines        25375    26420    +1045     
===========================================
+ Hits         24527    24557      +30     
- Misses         848     1863    +1015     
Impacted Files Coverage Δ
include/cell.h 74.29% <0.00%> (-25.71%) ⬇️
include/cell.tcc 76.18% <0.00%> (-11.29%) ⬇️
include/io/io_mesh.h 100.00% <ø> (ø)
include/io/io_mesh_ascii.h 100.00% <ø> (ø)
include/io/io_mesh_ascii.tcc 69.34% <0.00%> (-5.46%) ⬇️
include/linear_solvers/assembler_base.h 0.00% <0.00%> (ø)
...lvers/assembler_eigen_semi_implicit_navierstokes.h 0.00% <0.00%> (ø)
...ers/assembler_eigen_semi_implicit_navierstokes.tcc 0.00% <0.00%> (ø)
include/linear_solvers/cg_eigen.h 0.00% <0.00%> (ø)
include/linear_solvers/cg_eigen.tcc 0.00% <0.00%> (ø)
... and 32 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b20da5...76a7e0b. Read the comment docs.

@bodhinandach bodhinandach linked an issue Jul 30, 2020 that may be closed by this pull request
@ezrayst ezrayst self-requested a review August 2, 2020 07:18
Copy link
Contributor

@kks32 kks32 left a comment

Choose a reason for hiding this comment

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

Remove exception handling in core computational functions, if those block enter invalid regions, the code should crash.

[Partial review]


//! Return free surface bool
//! \retval free_surface_ indicating free surface cell
bool free_surface() { return free_surface_; };
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you make all unaltered functions as const and add inline when appropriate?

template <unsigned Tdim>
bool mpm::Cell<Tdim>::map_cell_volume_to_nodes(unsigned phase) {
bool status = true;
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to use exception handling here, instead, use assert. A failure here will give incorrect results, so this should fail.

indices.resize(nodes_.size());
indices.setZero();
unsigned node_idx = 0;
for (auto node_itr = nodes_.cbegin(); node_itr != nodes_.cend();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this be the same for both standard linear and GIMP elements?

const Eigen::MatrixXd& grad_shapefn, double pvolume,
double multiplier) noexcept {

std::lock_guard<std::mutex> guard(cell_mutex_);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use mutex lock and unlock

bool mpm::Cell<Tdim>::initialise_element_matrix() {
bool status = true;
if (this->status()) {
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need an exception block

@kks32 kks32 mentioned this pull request Aug 14, 2020
@stale
Copy link

stale bot commented Oct 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 11, 2020
@stale stale bot closed this Oct 18, 2020
@bodhinandach bodhinandach reopened this Oct 18, 2020
@stale stale bot removed the wontfix label Oct 18, 2020
@bodhinandach bodhinandach deleted the solver/navier-stokes branch December 3, 2020 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Semi-Implicit Navier-Stokes solver for incompressible flow
2 participants