Jump to content

Feasibility of Integrating a C++ Library into Mod for Numerical Calculations


minerva

Recommended Posts

Hi everyone,

I am developing a realistic fusion reactor mod, based on MIT's SPARC reactor, using Monte Carlo Simulations to simulate the neutrons within the reactor to increase the realism of the mod and then use Green's function to simply model the heat transfer from the molten salt to the pipes, steam, turbines, magnets, etc. I was also planning on including radiation damage and methods to manufacture different materials with the ability to withstand high numbers of atom displacements. For those interested, pm me and I can nerd out more about the mod.

 

My plan was to write the numerical code in C++ (I have it written in Fortran already) and transfer it over to Java using JNI (probably with HawtJNI), but I wanted to ask the more experienced modders around here how they were able to integrate numerically intense mods (i.e things like ReactorCraft, Gregtech, AE2, EnderIO, etc). I am worried that if I try to create realistically scaled fusion reactors in Minecraft using Java for the numerical calculations that java could not handle it (Or rather my implementation of Java :)    ). I read that this forum is not a Java Class, but I was hoping to gain some insight as to how other modders here tackled numerically heavy problems in Java, or if they just wrapped C++ code into Java like I was planning to do. 

 

My programming background is in Fortran77/95, C++, and a little bit of Java (took 6.005 online at MIT's Opencourseware but I would say I am a beginner still :D)  Looking to forward to hear from you smart people!

 

Thanks everyone!

M

Link to comment
Share on other sites

Java is very fast, and the JNI has a lot of overhead. You also sacrifice Java's main benefit - being able to run on any system. I would try to find a port of the libraries to Java, or porting them yourself before you commit to using the JNI.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.