Skip to content

Matlab to cpp translations. Hyperbolic1D, Parabolic2D, and Helmholtz2D_wifi - #330

Merged
valeriabarra merged 19 commits into
csrc-sdsu:mainfrom
CaywoodR:matlab_to_python
May 18, 2026
Merged

Matlab to cpp translations. Hyperbolic1D, Parabolic2D, and Helmholtz2D_wifi#330
valeriabarra merged 19 commits into
csrc-sdsu:mainfrom
CaywoodR:matlab_to_python

Conversation

@CaywoodR

@CaywoodR CaywoodR commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Example
  • Documentation

Description

Translating from matlab to cpp for hyperbolic1D, parabolic2D, and helmholtz2D_wifi. hyperbolic1D and parabolic2D are ready for review. I am still working on the last one.

Related Issues & Documents

QA Instructions, Screenshots, Recordings

_From .../mole/build

cmake ..
make
cd /examples/cpp ./executable
in this case it is parabolic2D or hyperbolic1D._

Added/updated tests?

_We encourage you to test all code included with MOLE, including examples.

  • Yes
  • No, and this is why: I am translating these examples from matlab to cpp. The test I thought was appropriate was comparing to the output of the matlab codes to it's cpp counterpart. If this is a poor way of objectively testing I can adopt a different method for this task.
  • I need help with writing tests

Read Contributing Guide and Code of Conduct

[optional] Are there any post deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

@valeriabarra

Copy link
Copy Markdown
Collaborator

Hi @CaywoodR thank you for your contribution!

Please modify the name of the PR to reflect that it is not python and to be a bit more specific. Thank you!

@CaywoodR CaywoodR changed the title Matlab to python Matlab to cpp translations. Hyperbolic1D and Parabolic2D draft Apr 15, 2026
@jbrzensk jbrzensk added C++ Issues related to the MOLE C++ API student project labels Apr 16, 2026
@valeriabarra

Copy link
Copy Markdown
Collaborator

Hi @CaywoodR , thank you for your contribution. Please update this branch with the main (you can use git merge or git rebase <- recommended, but then it requires a force-push). Please let me know if you need any assistance with that. Thank you

@CaywoodR

CaywoodR commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

@valeriabarra Would I only use rebase on the local branch of the mole fork?

@valeriabarra

Copy link
Copy Markdown
Collaborator

@valeriabarra Would I only use rebase on the local branch of the mole fork?

Yes, but first you need to make sure your upstream and origin are set up correctly (check git remote -v to see where you're pointing to). Then you update the main branch by doing git fetch (and confirm that the latest commit you see in git log is what appears to be merged last in the public repo) and then you rebase the main branch onto yours.

@CaywoodR

Copy link
Copy Markdown
Contributor Author

On my current path /home/caywood/Math693B/mole/build/examples/cpp, I input git remote -v. It output

origin git@github.com:CaywoodR/mole.git (fetch)
origin git@github.com:CaywoodR/mole.git (push)

So, git fetch will update the main branch on my fork?

@valeriabarra

Copy link
Copy Markdown
Collaborator

Do
git remote add upstream <ORIGINAL_PUBLIC_REPO_URL>

@CaywoodR

CaywoodR commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

I input

git remote add upstream https://github.com/csrc-sdsu/mole.git

I did not see anything happen, but I input it again to get:

error: remote upstream already exists.

So, the upstream remote is now there.

@valeriabarra

valeriabarra commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

I input

git remote add upstream https://github.com/csrc-sdsu/mole.git

I did not see anything happen, but I input it again to get:

error: remote upstream already exists.

So, the upstream remote is now there.

You can verify by running

git remote -v

(the -v stands for verbose).

If you have more questions on how to update your branch, it's probably easier if you could stop by office hours and I can assist. Thank you

@CaywoodR

Copy link
Copy Markdown
Contributor Author

run

git remote -v

the output is:

origin git@github.com:CaywoodR/mole.git (fetch)
origin git@github.com:CaywoodR/mole.git (push)
upstream https://github.com/csrc-sdsu/mole.git (fetch)
upstream https://github.com/csrc-sdsu/mole.git (push)

Sounds good. Thanks for the assistance!

@CaywoodR
CaywoodR marked this pull request as ready for review May 5, 2026 03:03
Comment thread doc/sphinx/source/examples/Hyperbolic/1D/Hyperbolic1D.md Outdated
@valeriabarra

Copy link
Copy Markdown
Collaborator

Hi @CaywoodR , you need to update this branch with main again. Then, please also reduce the number of commits to a minimum number of significant commits that reflect your work (even just one if you'd like). You can use the interactive rebase, with git rebase -i for that and then force-push.

Then, I am not sure if @jbrzensk has any other comments. It looks good for me. Thank you

@valeriabarra

Copy link
Copy Markdown
Collaborator

Can you please also edit the title of the PR to reflect that this is not a draft anymore?

@CaywoodR CaywoodR changed the title Matlab to cpp translations. Hyperbolic1D and Parabolic2D draft Matlab to cpp translations. Hyperbolic1D, Parabolic2D, and Helmholtz2D_wifi May 12, 2026
@CaywoodR

Copy link
Copy Markdown
Contributor Author

Hi @valeriabarra, when I use

git rebase -i

I see this. I do not see any commits.

noop

@CaywoodR
CaywoodR force-pushed the matlab_to_python branch from 8ee4b9e to 796803f Compare May 13, 2026 04:34
@CaywoodR

CaywoodR commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Hi @CaywoodR , you need to update this branch with main again. Then, please also reduce the number of commits to a minimum number of significant commits that reflect your work (even just one if you'd like). You can use the interactive rebase, with git rebase -i for that and then force-push.

Then, I am not sure if @jbrzensk has any other comments. It looks good for me. Thank you

Hi @valeriabarra, I tried rebasing, but I am having issues once I go to force-push. I included images of the following sequences I see after saving the file and then prompting the force.

asdasd dasdaada

Comment thread doc/sphinx/source/examples/Sturm-Liouville/Helmholtz.md Outdated
Co-authored-by: Valeria Barra <39932030+valeriabarra@users.noreply.github.com>
Signed-off-by: Jared Brzenski PhD <jbrzensk@gmail.com>
@valeriabarra
valeriabarra merged commit f239229 into csrc-sdsu:main May 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ Issues related to the MOLE C++ API student project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Matlab to C++ Example Contribution

3 participants