Skip to content

Commit e9f3826

Browse files
author
yzeng
committed
Merge branch 'Relax-in-development' into development
2 parents d30f61b + e169399 commit e9f3826

File tree

22 files changed

+319
-34
lines changed

22 files changed

+319
-34
lines changed

CONTRIBUTING.md

Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
## Development Model
2+
3+
Development generally follows the following ideas:
4+
5+
* New features are merged into to the `development` branch using
6+
Pull Requests (PRs).
7+
8+
* Bug fixes, questions and contributions of new features are welcome!
9+
10+
* Bugs should be reported through GitHub Issues.
11+
* We suggest asking questions through GitHub Discussions.
12+
* All contributions should be done via pull requests.
13+
A pull request should be generated from your fork of
14+
IAMReX and target the `development` branch. See below for
15+
details on how this process works.
16+
17+
In general we squash commits upon merge to have a clean history.
18+
*Please ensure that your PR title and description are descriptive,
19+
since these will be used for a squashed commit message.*
20+
21+
Please note the following:
22+
If you choose to make contributions to the code
23+
then you hereby grant a non-exclusive, royalty-free perpetual license
24+
to install, use, modify, prepare derivative works,
25+
incorporate into other computer software,
26+
distribute, and sublicense such enhancements or derivative works
27+
thereof, in binary and source code form.
28+
29+
30+
## Git workflow
31+
32+
IAMReX uses [git](https://git-scm.com) for version control. If you
33+
are new to git, you can follow one of these tutorials:
34+
- [Learn git with bitbucket](https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud)
35+
- [git - the simple guide](http://rogerdudler.github.io/git-guide/)
36+
37+
### Make your own fork and create a branch on it
38+
39+
The basic workflow is:
40+
- Fork the main repo (or update it if you already created it).
41+
- Implement your changes and push them on a new branch `<branch_name>` on
42+
your fork.
43+
- Create a Pull Request from branch `<branch_name>` on your fork to branch
44+
`development` on the main IAMReX repository.
45+
46+
First, let us setup your local git repo. To make your own fork of the main
47+
repository, press the fork button on the [IAMReX Github page](https://github.com/ruohai0925/IAMReX).
48+
49+
50+
Then, clone IAMReX on your local computer. If you plan on doing a lot of IAMReX development,
51+
we recommend configuring your clone to use ssh access so you won't have to enter your Github
52+
password every time, which you can do using these commands:
53+
54+
```
55+
git clone https://github.com/ruohai0925/IAMReX.git
56+
cd IAMReX
57+
58+
# Add your own fork.
59+
# Here <Jane> is the name you give to your fork. It does not need to be your github name.
60+
# <myGithubUsername> is your GitHub name.
61+
git remote add <Jane> git@github.com:<myGithubUsername>/IAMReX.git
62+
git fetch <Jane>
63+
64+
# Don't push to the main repo. Instead pushes go to your fork.
65+
git remote set-url --push origin git@github.com:<myGithubUsername>/IAMReX.git
66+
```
67+
68+
For instructions on setting up SSH access to your Github account on a new
69+
machine, see
70+
[here.](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh)
71+
72+
If you instead prefer to use HTTPS authentication, configure your local clone as follows:
73+
74+
```
75+
git clone https://github.com/ruohai0925/IAMReX.git
76+
cd IAMReX
77+
78+
# Add your own fork.
79+
# Here <Jane> is the name you give to your fork. It does not need to be your github name.
80+
# <myGithubUsername> is your GitHub name.
81+
git remote add <Jane> https://github.com/<myGithubUsername>/IAMReX.git
82+
git fetch <Jane>
83+
84+
# Don't push to the main repo. Instead pushes go to your fork.
85+
git remote set-url --push origin https://github.com/<myGithubUsername>/IAMReX.git
86+
```
87+
88+
Now you are free to play with your fork (for additional information, you can visit the
89+
[Github fork help page](https://help.github.com/en/articles/fork-a-repo)).
90+
91+
> Note: you do not have to re-do the setup above every time.
92+
93+
Make sure you are on the `development` branch with
94+
```
95+
git checkout development
96+
git pull
97+
```
98+
in the IAMReX directory.
99+
100+
Create a branch `<branch_name>` (the branch name should reflect the piece
101+
of code you want to add, like `high_order_interpolation`) with
102+
```
103+
git checkout -b <branch_name>
104+
```
105+
and do the coding you want.
106+
Add the files you work on to the git staging area with
107+
```
108+
git add <file_I_created> <and_file_I_modified>
109+
```
110+
### Commit & push your changes
111+
112+
Periodically commit your changes with
113+
```
114+
git commit -m "This is a 50-char description to explain my work"
115+
```
116+
117+
The commit message (between quotation marks) is super important in order to
118+
follow the developments and identify bugs.
119+
120+
For the moment, commits are on your local repo only. You can push them to
121+
your fork with
122+
```
123+
git push -u <Jane> <branch_name>
124+
```
125+
126+
If you want to synchronize your branch with the `development` branch (this is useful
127+
when `development` is being modified while you are working on
128+
`<branch_name>`), you can use
129+
```
130+
# merge IAMReX main repo's development into current branch
131+
git pull origin development
132+
```
133+
and fix any conflicts that may occur.
134+
135+
Do not merge your branch for PR into your local `development` branch,
136+
because it will make your local `development` branch diverge from the
137+
matching branch in the main repository after your PR is merged.
138+
139+
### Submit a Pull Request
140+
141+
A Pull Request is the way to efficiently visualize the changes you made
142+
and to propose your new feature/improvement/fix to the IAMReX project.
143+
Right after you push changes, a banner should appear on the Github page of
144+
your fork, with your `<branch_name>`.
145+
- Click on the `compare & pull request` button to prepare your PR.
146+
- It is time to communicate your changes: write a title and a description for
147+
your PR. People who review your PR are happy to know
148+
* what feature/fix you propose, and why
149+
* how you made it (created a new class than inherits from...)
150+
* and anything relevant to your PR (performance tests, images, *etc.*)
151+
- Press `Create pull request`. Now you can navigate through your PR, which
152+
highlights the changes you made.
153+
154+
Please DO NOT write large Pull Requests, as they are very difficult and
155+
time-consuming to review. As much as possible, split them into small,
156+
targeted PRs.
157+
For example, if find typos in the documentation open a pull request that only fixes typos.
158+
If you want to fix a bug, make a small pull request that only fixes a bug.
159+
If you want to implement a large feature, write helper functionality first, test it and submit those as a first pull request.
160+
If you want to implement a feature and are not too sure how to split it,
161+
just open a discussion about your plans and ping other IAMReX developers on it to chime in.
162+
163+
Even before your work is ready to merge, it can be convenient to create a PR
164+
(so you can use Github tools to visualize your changes). In this case, please
165+
make a "draft" PR using the drop-down menu next to the "Create pull request" button.
166+
167+
Once your pull request is made, we will review and potentially merge it.
168+
We recommend always creating a new branch for each pull request, as per the above instructions.
169+
Once your pull request is merged, you can delete your local PR branch with
170+
```
171+
git branch -D <branch_name>
172+
```
173+
174+
and you can delete the remote one on your fork with
175+
```
176+
git push <Jane> --delete <branch_name>
177+
```
178+
179+
Generally speaking, you want to follow the following rules.
180+
181+
* Do not merge your branch for PR into your local `development` branch that tracks IAMReX
182+
`development` branch. Otherwise your local `development` branch will diverge from IAMReX
183+
`development` branch.
184+
185+
* Do not commit in your `development` branch that tracks IAMReX `development` branch.
186+
187+
* Always create a new branch based off the latest `development` branch for
188+
each pull request, unless you are going to use git to fix it later.
189+
190+
If you have accidentally committed in `development` branch, you can fix it as follows,
191+
```
192+
git checkout -b new_branch # save your changes in a branch
193+
git checkout development
194+
git fetch origin
195+
git reset --hard origin/development
196+
```
197+
After this, the local `development` should be in sync with IAMReX `development` and your recent
198+
commits have been saved in `new_branch` branch.
199+
200+
## IAMReX Coding Style Guide
201+
202+
### Code Guidelines
203+
204+
IAMReX developers should adhere to the following coding guidelines:
205+
* Indentations should use 4 spaces, not tabs.
206+
* Use curly braces for single statement blocks. For example:
207+
```cpp
208+
for (int n=0; n<10; ++n) {
209+
Print() << "Like this!";
210+
}
211+
```
212+
or
213+
```cpp
214+
for (int n=0; n<10; ++n) { Print() << "Like this!"; }
215+
```
216+
but not
217+
```cpp
218+
219+
for (int n=0; n<10; ++n) Print() << "Not like this.";
220+
```
221+
or
222+
```cpp
223+
for (int n=0; n<10; ++n)
224+
Print() << "Not like this.";
225+
```
226+
* When declaring and defining a function, add a space after the function name and before the
227+
parenthesis of the parameter list (but not when simply calling the function). For example:
228+
```cpp
229+
void CorrectFunctionDec (int input)
230+
```
231+
Not
232+
```cpp
233+
void IncorrectFunctionDec(int input)
234+
```
235+
This makes it easy to find where functions are defined with grep.
236+
* Member variables should be prefixed with `m_`. For example:
237+
```cpp
238+
amrex::Real m_variable;
239+
```
240+
These guidelines should be adhered to in new contributions to IAMReX, but
241+
please refrain from making stylistic changes to unrelated sections of code in your PRs.
242+
243+
### API Documentation Using Doxygen
244+
245+
The Doxygen documentation is designed for advanced user-developers. It aims
246+
to maximize the efficiency of a search-and-find style of locating information.
247+
Doxygen style comment blocks should proceed the namespace, class, function, etc.
248+
to be documented where appropriate. For example:
249+
```cpp
250+
/**
251+
* \brief A one line description.
252+
*
253+
* \param[in] variable A short description of the variable.
254+
* \param[inout] data The value of data is read and changed.
255+
*
256+
* A longer description can be included here.
257+
*/
258+
259+
void MyFunction (int variable, MultiFab& data){
260+
...
261+
```
262+
Additional information regarding Doxygen comment formatting can be found
263+
in the [Doxygen Manual](https://www.doxygen.nl/manual/).
264+
265+
### Describe
266+
267+
The current CONTRIBUTING.md file is modified based on the [CONTRIBUTING.md](https://github.com/AMReX-Codes/amrex/blob/development/CONTRIBUTING.md). in the amrex project.

Docs/IAMReX_documentation/source/Introduction_Chapter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Introduction
22
===================
33

4-
This IAMReX repo extends the capability of original `IAMR <https://amrex-fluids.github.io/IAMR/>`_ codes, aiming at simulating the multiphase incompressible flows and fluid structure interaction problems on both CPUs and GPUs with/without subcycling. The Navier-Stokes euqations are solved on an adaptive semi-staggered grid using the projection method. The gas-liquid interface is captured using the level set (LS) method. The fluid-solid interface is resolved using the multidirect forcing immersed boundary method (IBM). The particle-wall as well as the particle-particle collisions are also captured by the adaptive collision time model (ACTM).
4+
This IAMReX repo extends the capability of original `IAMR <https://amrex-fluids.github.io/IAMR/>`_ codes, aiming at simulating the multiphase incompressible flows and fluid structure interaction problems on both CPUs and GPUs with/without subcycling. The Navier-Stokes equations are solved on an adaptive semi-staggered grid using the projection method. The gas-liquid interface is captured using the level set (LS) method. The fluid-solid interface is resolved using the multidirect forcing immersed boundary method (IBM). The particle-wall as well as the particle-particle collisions are also captured by the adaptive collision time model (ACTM).
55

66

77
Features

Docs/IAMReX_documentation/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
IAMReX documentation
77
====================
88

9-
This IAMReX repo extends the capability of original `IAMR <https://amrex-fluids.github.io/IAMR/>`_ codes, aiming at simulating the multiphase incompressible flows and fluid structure interaction problems on both CPUs and GPUs with/without subcycling. The Navier-Stokes euqations are solved on an adaptive semi-staggered grid using the projection method. The gas-liquid interface is captured using the level set (LS) method. The fluid-solid interface is resolved using the multidirect forcing immersed boundary method (IBM). The particle-wall as well as the particle-particle collisions are also captured by the adaptive collision time model (ACTM).
9+
This IAMReX repo extends the capability of original `IAMR <https://amrex-fluids.github.io/IAMR/>`_ codes, aiming at simulating the multiphase incompressible flows and fluid structure interaction problems on both CPUs and GPUs with/without subcycling. The Navier-Stokes equations are solved on an adaptive semi-staggered grid using the projection method. The gas-liquid interface is captured using the level set (LS) method. The fluid-solid interface is resolved using the multidirect forcing immersed boundary method (IBM). The particle-wall as well as the particle-particle collisions are also captured by the adaptive collision time model (ACTM).
1010

1111
.. toctree::
1212
:maxdepth: 2

JOSS_paper/paper.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ affiliations:
6868
date: 17 January 2025
6969
bibliography: paper.bib
7070

71-
# # Optional fields if submitting to a AAS journal too, see this blog post:
71+
# # Optional fields if submitting to a ASS, AS journal too, see this blog post:
7272
# # https://blog.joss.theoj.org/2018/12/a-new-collaboration-with-aas-publishing
73-
# aas-doi: 10.3847/xxxxx <- update this with the DOI from AAS once you know it.
74-
# aas-journal: Astrophysical Journal <- The name of the AAS journal.
73+
# aas-doi: 10.3847/xxxxx <- update this with the DOI from ASS, AS once you know it.
74+
# aas-journal: Astrophysical Journal <- The name of the ASS, AS journal.
7575
---
7676

7777
# Summary

JOSS_paper/paper.pdf

-197 KB
Binary file not shown.

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
<img src="./README_figures/IAMReX.png" alt="tittle" width="300">
2+
<img src="./README_figures/IAMReX.png" alt="title" width="300">
33
<p align="center">
44
<a href="https://arxiv.org/abs/2408.14140">
55
<img src="https://img.shields.io/badge/arXiv-2408.14140-blue" alt="arxiv">
@@ -20,7 +20,7 @@
2020

2121
## Overview
2222

23-
This IAMReX repo extends the capability of original [IAMR](https://github.com/AMReX-Fluids/IAMR) codes, aiming at simulating the multiphase incompressible flows and fluid structure interaction problems on both CPUs and GPUs with/without subcycling. The Navier-Stokes euqations are solved on an adaptive semi-staggered grid using the projection method. The gas-liquid interface is captured using the level set (LS) method. The fluid-solid interface is resolved using the multidirect forcing immersed boundary method (IBM). The particle-wall as well as the particle-particle collisions are also captured by the adaptive collision time model (ACTM).
23+
This IAMReX repo extends the capability of original [IAMR](https://github.com/AMReX-Fluids/IAMR) codes, aiming at simulating the multiphase incompressible flows and fluid structure interaction problems on both CPUs and GPUs with/without subcycling. The Navier-Stokes equations are solved on an adaptive semi-staggered grid using the projection method. The gas-liquid interface is captured using the level set (LS) method. The fluid-solid interface is resolved using the multidirect forcing immersed boundary method (IBM). The particle-wall as well as the particle-particle collisions are also captured by the adaptive collision time model (ACTM).
2424

2525

2626

@@ -163,6 +163,24 @@ gfortran -o fixBed DomainFill.F90
163163
## State of the field
164164
We made great efforts to simulate more complex multiphase flows at higher resolution using IAMReX. One effort is to combine the AMR technique with the multidirect forcing immersed boundary method to resolve particles only on the finest-level grid. It significantly reduces the grid requirements for particle-resolved simulation compared with commonly used uniform grid solvers [Incompact3d](https://github.com/xcompact3d/Incompact3d), [CaNS](https://github.com/CaNS-World/CaNS), and [CP3d](https://github.com/GongZheng-Justin/CP3d). Additionally, we utilized a subcycling technique to alleviate the time step constraint on coarser levels. It minimizes the total time step needed by time advancement compared with the non-subcycling technique used in other AMR-related packages, such as [IBAMR](https://github.com/IBAMR/IBAMR.git), [basilisk](http://basilisk.fr/), and [incflo](https://github.com/AMReX-Fluids/incflo.git).
165165

166+
## Get Help
167+
168+
You can also view questions
169+
and ask your own on our [GitHub Discussions](https://github.com/ruohai0925/IAMReX/issues) page.
170+
To obtain additional help, simply post an issue.
171+
172+
## Contribute
173+
174+
We are always happy to have users contribute to the IAMReX source code. To
175+
contribute, issue a pull request against the development branch.
176+
Any level of changes are welcomed: documentation, bug fixes, new test problems,
177+
new solvers, etc. For more details on how to contribute to IAMReX, please see
178+
[CONTRIBUTING.md](CONTRIBUTING.md).
179+
180+
💡 If you're using IAMReX in your own GitHub projects, consider adding `IAMReX`
181+
as a [repository topic](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics)!
182+
This helps others discover related work and strengthens the IAMReX ecosystem.
183+
166184
## Citation
167185
168186
To cite IAMReX, please use

Source/DiffusedIB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ void Particles::Initialize()
12071207
ParticleProperties::_x.shrink_to_fit();
12081208
ParticleProperties::_y.shrink_to_fit();
12091209
ParticleProperties::_z.shrink_to_fit();
1210-
amrex::Print() << " intial Particle by file : " << particle_init_file
1210+
amrex::Print() << " initial Particle by file : " << particle_init_file
12111211
<< " particle's size : " << ParticleProperties::_x.size() << "\n";
12121212
}
12131213

Source/NavierStokesBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5483,7 +5483,7 @@ NavierStokesBase::reinitialization_sussman (Real dt,
54835483
if (verbose) amrex::Print() << "In the NavierStokesBase::reinitialization_sussman() " << std::endl;
54845484
if (verbose) amrex::Print() << "loop_iter " << loop_iter << std::endl;
54855485

5486-
// Step 1: get sgn, similiar to heaviside
5486+
// Step 1: get sgn, similar to heaviside
54875487
if (loop_iter==1) {
54885488
phi_to_sgn0(phi_original);
54895489
}

Source/ls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
rhs = [-dis, 0, -dis, 0, dis, 0, -dis, 0, -dis]
2424
print(rhs)
2525

26-
# Let us say wanna use the least square method to solver matrix * x = rhs, in whcih x is a 6 by 1 array.
26+
# Let us say wanna use the least square method to solver matrix * x = rhs, in which x is a 6 by 1 array.
2727

2828
# Solve using least squares
2929
x, residuals, rank, s = np.linalg.lstsq(matrix, rhs, rcond=None)

Test_IAMReX/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ python3 test_IAMReX.py
1313
# Here are the running results, which indicate that the case has been built and run successfully.
1414
Script Directory: xxx/IAMReX/Test_IAMReX
1515
Test Working Directory: xxx/IAMReX/Tutorials/RayleighTaylor_LS
16-
test_RayleighTaylor_LS succceed
16+
test_RayleighTaylor_LS succeed
1717
```
1818

1919
If you want to add a new test, here are only two thing you need to do.
@@ -30,7 +30,7 @@ If you want to add a new test, here are only two thing you need to do.
3030
stdout=None if print_output else subprocess.DEVNULL,
3131
stderr=None if print_output else subprocess.DEVNULL
3232
)
33-
print("test_RayleighTaylor succceed")
33+
print("test_RayleighTaylor succeed")
3434
```
3535
2. Add it to the main() .
3636
```python

0 commit comments

Comments
 (0)