Skip to content

Commit

Permalink
c++ translation of Louis' code
Browse files Browse the repository at this point in the history
  • Loading branch information
rboman committed Nov 10, 2023
1 parent 76efd10 commit 15bd4ae
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classes/sph0/louis++/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
PROJECT(LOUIS CXX)

FILE(GLOB SRCS *.h *.cpp)

ADD_EXECUTABLE(louis ${SRCS})
15 changes: 15 additions & 0 deletions classes/sph0/louis++/ParticleManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "ParticleManager.h"

ParticleManager::ParticleManager()
{
}

void
ParticleManager::initialisation()
{
}

void
ParticleManager::solver()
{
}
13 changes: 13 additions & 0 deletions classes/sph0/louis++/ParticleManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef PARTICLEMANAGER_H
#define PARTICLEMANAGER_H

class ParticleManager
{
public:
ParticleManager();

void initialisation();
void solver();
};

#endif // PARTICLEMANAGER_H
28 changes: 28 additions & 0 deletions classes/sph0/louis++/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// !> SPH simulation
// @n This program is used to solve the Navier-Stokes equations
// using the SPH method. A number of files must be given:
// paths.txt, *.prm, *.fp and *.mp.
// @warning The domain must be cubic!
// @brief Main program to launch a SPH simulation
// @author Louis Goffin
// @date 2013-05-26
// @version 1.0.0

#include "ParticleManager.h"
#include <iostream>
#include <chrono>

int
main()
{
std::cout << "============= SPH_simulation (L.Goffin)\n";

auto t1 = std::chrono::high_resolution_clock::now();

ParticleManager manager;
manager.initialisation();
manager.solver();

auto t2 = std::chrono::high_resolution_clock::now();
std::cout << "Elapsed real time = " << std::chrono::duration_cast<std::chrono::duration<double>>(t2 - t1).count() << '\n';
}

0 comments on commit 15bd4ae

Please sign in to comment.