|
[Sponsors] |
July 3, 2021, 18:58 |
Java vs C++ for CFD mesh processing
|
#1 |
New Member
Truong Dang
Join Date: Oct 2016
Location: Vietnam
Posts: 21
Rep Power: 9 |
Recently I re-implement my C++ code in Java and realize that the Java execution is faster than the C++ one ! The code takes a gmsh .msh file and convert it to .dat Tecplot file and .vtk file (Paraview).
With JDK 8 my Java code took ~2.6 seconds, whereas the C++ version took: ~5 seconds (MinGW g++ 10.2 with -O3 optimization flag). ~2.8 seconds (MinGW g++ 4.9.2 with -O3 optimization flag). Key point could be the performance of C++ vector and Java List interface. Have you ever faced similar situation? Edited: Looks like this is a bug of MinGW g++ 10.2. My C++ implementation is just slightly slower than Java although it's heavily object oriented. Ps: I have posted my code to GitHub so that you can have better judgement. C++: https://github.com/truongd8593/GmshToVtkAndTecplotCpp11 Java: https://github.com/truongd8593/MisaCFDJava Last edited by ssh123; July 10, 2021 at 03:31. |
|
Tags |
c++, java, mesh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] SnappyHexMesh/splitMeshRegion : region1 in zone "-1" | GuiMagyar | OpenFOAM Meshing & Mesh Conversion | 3 | August 4, 2023 12:38 |
foam-extend-4.1 release | hjasak | OpenFOAM Announcements from Other Sources | 19 | July 16, 2021 05:02 |
GeometricField -> mesh() Function | Tobi | OpenFOAM Programming & Development | 10 | November 19, 2020 11:33 |
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry | pizzaspinate | OpenFOAM Meshing & Mesh Conversion | 1 | February 25, 2015 07:05 |
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation | tommymoose | ANSYS Meshing & Geometry | 48 | April 15, 2013 04:24 |