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

Finite difference example #635

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

streeve
Copy link
Member

@streeve streeve commented Jun 1, 2023

Add new example. Use a new directory to differentiate between the tutorial for individual components

TODO: add a link in the wiki somewhere (proxy app page?)

@streeve streeve requested a review from kwitaechong June 1, 2023 16:47
@streeve streeve self-assigned this Jun 1, 2023
@streeve
Copy link
Member Author

streeve commented Jun 1, 2023

@colemanjs FYI

k - planes[b][2], 0 );
} );
}

Copy link
Collaborator

@kwitaechong kwitaechong Jun 1, 2023

Choose a reason for hiding this comment

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

It might be a good idea to add comment about the problem. I think this is about unsteady heat equation problem in 3d.

The governing equstion : $$\rho c_p dT/dt = k \nabla^2{T} + q$$
Neumann boundary condition (describing heat flux ) : $$k \nabla{T} \cdot n = f$$

Copy link

@colemanjs colemanjs Jun 8, 2023

Choose a reason for hiding this comment

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

@kwitaechong, you are correct. This boundary conditions is just an adiabatic one. I will correct the description.

Also, it is worth pointing out that I think the left-hand and right-hand sides are swapped...

Copy link
Member Author

Choose a reason for hiding this comment

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

@colemanjs can you add a more detailed comment below?

example/methods/finite_difference/finite_difference.cpp Outdated Show resolved Hide resolved
****************************************************************************/

#include <array>
#include <math.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#include <math.h>
#include <cmath>

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 183 to 201
MPI_Init( &argc, &argv );
{
Kokkos::ScopeGuard scope_guard( argc, argv );

finiteDifference();
}
MPI_Finalize();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
MPI_Init( &argc, &argv );
{
Kokkos::ScopeGuard scope_guard( argc, argv );
finiteDifference();
}
MPI_Finalize();
MPI_Init( &argc, &argv );
Kokkos::initialize( argc, argv );
finiteDifference();
Kokkos::finalize();
MPI_Finalize();

is more readable IMO

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

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.

4 participants