Skip to content

Commit

Permalink
build / test with msys/mingw
Browse files Browse the repository at this point in the history
  • Loading branch information
rboman committed Mar 8, 2024
1 parent 1d98fc2 commit a695f1d
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 18 deletions.
6 changes: 6 additions & 0 deletions classes/sph0/louis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@ Load `.vtu` files in [Paraview](http://www.paraview.org/).
Run C++ code in debug using 10 threads
```
cmake . -B build -DCMAKE_BUILD_TYPE=Debug && ninja -C build && run.py --cpp -k 10 tests\waterdrop.py
```

## MSYS2

```
pacman -S mingw64/mingw-w64-x86_64-eigen3
```
4 changes: 2 additions & 2 deletions classes/sph0/louis/src_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ ENDIF()

# find Eigen
# FIND_PACKAGE(Eigen3 3.4 REQUIRED NO_MODULE)

# set(CMAKE_FIND_DEBUG_MODE TRUE)
FIND_PATH(EIGEN_INCLUDE_DIRS "Eigen/Dense"
PATHS "${PROJECT_SOURCE_DIR}/lib/eigen" "/usr/include/eigen3")
PATHS "${PROJECT_SOURCE_DIR}/lib/eigen" "/usr/include/eigen3" "c:/msys64/mingw64/include/eigen3")
MESSAGE(STATUS "EIGEN_INCLUDE_DIRS=" ${EIGEN_INCLUDE_DIRS})
IF(NOT EIGEN_INCLUDE_DIRS)
MESSAGE(FATAL_ERROR "Eigen include dir not found!")
Expand Down
14 changes: 14 additions & 0 deletions classes/sph0/louis/src_cpp/DisplayHook.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef SPH_DISPLAYHOOK_H
#define SPH_DISPLAYHOOK_H

#include "sph.h"

class DisplayHook
{
public:
DisplayHook();
virtual void display() = 0;
};

#endif //SPH_DISPLAYHOOK_H

2 changes: 1 addition & 1 deletion classes/sph0/louis/src_cpp/FixedParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class FixedParticle : public Particle
public:
FixedParticle(Model &m);

virtual void update_vars();
virtual void update_vars() override;
};

#endif // SPH_FIXEDPARTICLE_H
6 changes: 3 additions & 3 deletions classes/sph0/louis/src_cpp/Kernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ class CubicSplineKernel : public Kernel
{
public:
CubicSplineKernel();
virtual double dW(double r, double h) const;
virtual double dW(double r, double h) const override;
};

class QuadraticKernel : public Kernel
{
public:
QuadraticKernel();
virtual double dW(double r, double h) const;
virtual double dW(double r, double h) const override;
};

class QuinticSplineKernel : public Kernel
{
public:
QuinticSplineKernel();
virtual double dW(double r, double h) const;
virtual double dW(double r, double h) const override;
};

#endif // SPH_KERNELS_H
2 changes: 1 addition & 1 deletion classes/sph0/louis/src_cpp/MobileParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MobileParticle : public FixedParticle
public:
MobileParticle(Model &m);

virtual void update_vars();
virtual void update_vars() override;

private:
double compute_viscosity(Particle *neigh,
Expand Down
3 changes: 2 additions & 1 deletion classes/sph0/louis/src_cpp/sph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ print_timers()
for (auto &t : timers)
std::cout << std::setw(20) << t.first << " = "
<< std::setw(10) << std::fixed << std::setprecision(2) << t.second << "s"
<< std::setw(10) << t.second.elapsed() / timers["TOTAL"].elapsed() * 100 << "%\n";
<< std::setw(10) << t.second.elapsed() / timers["TOTAL"].elapsed() * 100 << "%"
<< std::endl;
std::cout.flags(f); // restore flags
}
7 changes: 5 additions & 2 deletions classes/sph0/louis/tests/small.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@
model.run()

# convert to VTK
import sph.gui as gui
gui.ToParaview(verb=False).convertall()
try:
import sph.gui as gui
gui.ToParaview(verb=False).convertall()
except Exception as e:
print("\n**ERROR while converting to VTK:", e)
8 changes: 6 additions & 2 deletions classes/sph0/louis/tests/waterdrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,9 @@
model.run()

# convert to VTK
import sph.gui as gui
gui.ToParaview(verb=False).convertall()
try:
import sph.gui as gui
gui.ToParaview(verb=False).convertall()
except Exception as e:
print("\n**ERROR while converting to VTK:", e)

7 changes: 5 additions & 2 deletions classes/sph0/louis/tests/waterdrop2.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,8 @@
model.run()

# convert to VTK
import sph.gui as gui
gui.ToParaview(verb=False).convertall()
try:
import sph.gui as gui
gui.ToParaview(verb=False).convertall()
except Exception as e:
print("\n**ERROR while converting to VTK:", e)
7 changes: 5 additions & 2 deletions classes/sph0/louis/tests/waterdrop3.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,8 @@
model.run()

# convert to VTK
import sph.gui as gui
gui.ToParaview(verb=False).convertall()
try:
import sph.gui as gui
gui.ToParaview(verb=False).convertall()
except Exception as e:
print("\n**ERROR while converting to VTK:", e)
7 changes: 5 additions & 2 deletions classes/sph0/louis/tests/waterdrop4.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,8 @@
model.run()

# convert to VTK
import sph.gui as gui
gui.ToParaview(verb=False).convertall()
try:
import sph.gui as gui
gui.ToParaview(verb=False).convertall()
except Exception as e:
print("\n**ERROR while converting to VTK:", e)
File renamed without changes.

0 comments on commit a695f1d

Please sign in to comment.