diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..ad96d6b5b58dedcba78192ad75a9de3f37c7e33a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+build/
+.vscode/
+*.pyc
\ No newline at end of file
diff --git a/CMake/FindEIGEN.cmake b/CMake/FindEIGEN.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..80534b27c17bdcb7629cf01323251e719556e44b
--- /dev/null
+++ b/CMake/FindEIGEN.cmake
@@ -0,0 +1,48 @@
+# Check version (only for Eigen 3)
+macro(_eigen3_check_version)
+    file(READ "${EIGEN_INCLUDE_DIRS}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
+
+    string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
+    set(EIGEN_WORLD_VERSION "${CMAKE_MATCH_1}")
+    string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
+    set(EIGEN_MAJOR_VERSION "${CMAKE_MATCH_1}")
+    string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
+    set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}")
+
+    set(EIGEN_VERSION ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})
+
+    if(${EIGEN_VERSION} VERSION_LESS ${EIGEN_FIND_VERSION})
+        message(FATAL_ERROR "Eigen version ${EIGEN_VERSION} found in ${EIGEN_INCLUDE_DIRS}, but at least version ${EIGEN_FIND_VERSION} is required!")
+    endif()
+endmacro()
+
+# Set a dummy version if not provided
+if(NOT EIGEN_FIND_VERSION)
+    if(NOT EIGEN_FIND_VERSION_MAJOR)
+        set(EIGEN_FIND_VERSION_MAJOR 3)
+    endif()
+    if(NOT EIGEN_FIND_VERSION_MINOR)
+        set(EIGEN_FIND_VERSION_MINOR 3)
+    endif()
+    if(NOT EIGEN_FIND_VERSION_PATCH)
+        set(EIGEN_FIND_VERSION_PATCH 4)
+    endif()
+
+    set(EIGEN_FIND_VERSION "${EIGEN_FIND_VERSION_MAJOR}.${EIGEN_FIND_VERSION_MINOR}.${EIGEN_FIND_VERSION_PATCH}")
+endif()
+
+# Find the header and check the version
+find_path(EIGEN_INCLUDE_DIRS "Eigen/Dense" PATHS "/usr/include/eigen3")
+if (EIGEN_INCLUDE_DIRS)
+    _eigen3_check_version()
+else()
+    message(FATAL_ERROR "Eigen3 headers not found! Define the path in the INCLUDE environment variable.")
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set EIGEN_FOUND to TRUE
+# if all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(EIGEN
+                                  FOUND_VAR EIGEN_FOUND
+                                  REQUIRED_VARS EIGEN_INCLUDE_DIRS
+                                  VERSION_VAR EIGEN_VERSION)
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..075335ca3fbfd4cec0950e28b564f908fcb4edac
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,61 @@
+# ----------------------------------------------------------------------------
+CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
+PROJECT(hspm)
+# ----------------------------------------------------------------------------
+
+# -- I/O
+# Lib/Exe dir
+SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH
+                        "Single output directory for building all libraries.")
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH
+                        "Single output directory for building all executables.")
+MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
+
+# Build type
+IF(NOT CMAKE_BUILD_TYPE)
+    SET( CMAKE_BUILD_TYPE "Release" CACHE STRING 
+         "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+         FORCE)
+ENDIF(NOT CMAKE_BUILD_TYPE)
+
+# Additional modules and macros
+LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake")
+
+# -- C/C++
+# Set specific languages flags
+SET(CMAKE_CXX_STANDARD 11) # newer way to set C++11 (requires cmake>=3.1)
+SET(CMAKE_CXX_STANDARD_REQUIRED ON)
+IF((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Intel"))
+    IF(NOT APPLE)
+        SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-as-needed")
+    ENDIF()
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # add verbosity
+ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+    ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE)
+    ADD_DEFINITIONS(-D_USE_MATH_DEFINES) # otherwise M_PI is undefined
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")  # parallel build with MSVC
+    #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")  # add verbosity
+ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register")
+    #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything") # add verbosity
+ENDIF()
+
+# -- DEPENDENCIES
+# Python
+# use Python3_ROOT_DIR if wrong python found (e.g. anaconda)
+FIND_PACKAGE(Python3 COMPONENTS Interpreter Development)
+SET(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
+SET(PYTHON_LIBRARIES ${Python3_LIBRARIES})
+SET(PYTHON_INCLUDE_PATH ${Python3_INCLUDE_DIRS}) 
+SET(PYTHONLIBS_VERSION_STRING ${Python3_VERSION})     
+
+# SWIG
+FIND_PACKAGE(SWIG REQUIRED)
+IF(CMAKE_GENERATOR MATCHES "Visual Studio") # not MSVC because of nmake & jom
+    SET(CMAKE_SWIG_OUTDIR "${EXECUTABLE_OUTPUT_PATH}/$(Configuration)/")
+ELSE()
+    SET(CMAKE_SWIG_OUTDIR "${EXECUTABLE_OUTPUT_PATH}")
+ENDIF()
+
+# -- Sub directories
+ADD_SUBDIRECTORY( hspm )
diff --git a/README.md b/README.md
deleted file mode 100644
index 49f67230abc0e8248b25743bc3b7b4c9b1c8524b..0000000000000000000000000000000000000000
--- a/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-# HSPM
-
-
-
-## Getting started
-
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
-
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
-
-## Add your files
-
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-
-```
-cd existing_repo
-git remote add origin https://gitlab.uliege.be/Corentin.Thomee/hspm.git
-git branch -M main
-git push -uf origin main
-```
-
-## Integrate with your tools
-
-- [ ] [Set up project integrations](https://gitlab.uliege.be/Corentin.Thomee/hspm/-/settings/integrations)
-
-## Collaborate with your team
-
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
-
-## Test and Deploy
-
-Use the built-in continuous integration in GitLab.
-
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
-
-***
-
-# Editing this README
-
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
-
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
-
-## Name
-Choose a self-explaining name for your project.
-
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
-
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
-
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
-
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
-
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
-
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
-
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
-
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
-
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
-
-## License
-For open source projects, say how it is licensed.
-
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
diff --git a/hspm/CMakeLists.txt b/hspm/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5bc12ea16a42a4893516c7c4f77c77b5b76bde05
--- /dev/null
+++ b/hspm/CMakeLists.txt
@@ -0,0 +1,3 @@
+# Add source dir
+ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(_src)
\ No newline at end of file
diff --git a/hspm/_src/CMakeLists.txt b/hspm/_src/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..ae5387dc7ece66b04713221329a63443db8f136a
--- /dev/null
+++ b/hspm/_src/CMakeLists.txt
@@ -0,0 +1,13 @@
+INCLUDE(${SWIG_USE_FILE})
+
+FILE(GLOB SRCS *.h *.cpp *.inl *.swg)
+FILE(GLOB ISRCS *.i)
+
+SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES CPLUSPLUS ON)
+SET(CMAKE_SWIG_FLAGS "-interface" "_hspmw") # avoids "import _module_d" with MSVC/Debug
+SWIG_ADD_LIBRARY(hspmw LANGUAGE python SOURCES ${ISRCS} ${SRCS})
+SET_PROPERTY(TARGET hspmw PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON)
+
+TARGET_INCLUDE_DIRECTORIES(hspmw PRIVATE ${PROJECT_SOURCE_DIR}/hspm/_src
+                                         ${PYTHON_INCLUDE_PATH})
+TARGET_LINK_LIBRARIES(hspmw PRIVATE hspm ${PYTHON_LIBRARIES})
\ No newline at end of file
diff --git a/hspm/_src/hspmw.h b/hspm/_src/hspmw.h
new file mode 100644
index 0000000000000000000000000000000000000000..fdf3fde244a552d0f722d08d2412f7f90a82acdc
--- /dev/null
+++ b/hspm/_src/hspmw.h
@@ -0,0 +1 @@
+#include "hspm.h"
\ No newline at end of file
diff --git a/hspm/_src/hspmw.i b/hspm/_src/hspmw.i
new file mode 100644
index 0000000000000000000000000000000000000000..e26cbff4df58d92561fe1de743dcf2d5c03b39a5
--- /dev/null
+++ b/hspm/_src/hspmw.i
@@ -0,0 +1,8 @@
+%module hspmw
+%{
+
+#include "hspm.h"
+
+%}
+
+%include "hspm.h"
\ No newline at end of file
diff --git a/hspm/api/core.py b/hspm/api/core.py
new file mode 100644
index 0000000000000000000000000000000000000000..f17fcc3893acbe4141571bebc860f29b0e6f01a7
--- /dev/null
+++ b/hspm/api/core.py
@@ -0,0 +1,23 @@
+def initHSPM(cfg):
+	"""
+	Initializes the HSPM object with the given configuration
+	"""
+
+	import hspmw
+	import numpy as np
+
+	hspm = hspmw.HSPM()
+
+	hspm.chord = cfg['chord'] # Not optimal, but it will do for now
+	hspm.IT_SOLVER_TOLERANCE = cfg['it_solver_tolerance']
+	hspm.V_inf = 1 # Shouldn't have any impact on the solution (To verify)
+	hspm.AoA = np.deg2rad(cfg['aoa'])
+
+	if cfg['naca']:
+		hspm.generateNaca4DigitCoordinates(int(cfg['naca'][0]), int(cfg['naca'][1]), int(cfg['naca'][2:4]), int(cfg['N']))
+	else:
+		hspm.loadCoordinates(cfg['filename'])
+
+	hspm.initHSPM()
+
+	return hspm
\ No newline at end of file
diff --git a/hspm/src/CMakeLists.txt b/hspm/src/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0826a7ffd531257fb02da8e4a2472cb3ed4f693f
--- /dev/null
+++ b/hspm/src/CMakeLists.txt
@@ -0,0 +1,14 @@
+FILE(GLOB SRCS *.h *.cpp *.inl *.hpp)
+
+ADD_LIBRARY(hspm SHARED ${SRCS})
+
+# -- Eigen --
+FIND_PACKAGE(EIGEN 3.3.4 REQUIRED)
+TARGET_INCLUDE_DIRECTORIES(hspm PUBLIC ${EIGEN_INCLUDE_DIRS})
+TARGET_COMPILE_DEFINITIONS(hspm PUBLIC EIGEN_DONT_PARALLELIZE)
+
+TARGET_INCLUDE_DIRECTORIES(hspm PUBLIC ${PROJECT_SOURCE_DIR}/hspm/src)
+
+INSTALL(TARGETS hspm DESTINATION ${CMAKE_INSTALL_PREFIX})
+
+SOURCE_GROUP(base REGULAR_EXPRESSION ".*\\.(cpp|inl|hpp|h)")
diff --git a/hspm/src/geometry.cpp b/hspm/src/geometry.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2c54f3eb76cf3e26cd6df585cb99e897ab39588f
--- /dev/null
+++ b/hspm/src/geometry.cpp
@@ -0,0 +1,115 @@
+#include "geometry.h"
+
+void HSPM::generateNaca4DigitCoordinates(double camber, double camberPos, double thickness, size_t _N) 
+{
+	/*
+	Generates the coordinates of a NACA 4 digits airfoil
+    Parameters:
+    -----------
+    camber: double
+        Max camber of the airfoil [%]. First digit
+    camberPos: double
+        Position of the max camber of the airfoil [10%]. Second digit
+    thickness: double
+        Thickness of the airfoil [%]. Third/fourth digits
+	*/
+
+	N = _N;
+	x = Eigen::VectorXd(N+1);
+	y = Eigen::VectorXd(N+1);
+
+	Eigen::VectorXd angleDistribution = Eigen::VectorXd::LinSpaced(N+1, 0, 2*M_PI);
+
+	Eigen::VectorXd x_distr = Eigen::VectorXd::Zero(N+1);
+	for (size_t i=0; i<=N; i++) {
+		double angle = angleDistribution(i);
+		if (angle < M_PI/2) {
+			x_distr(i) = chord/2 * (1 - angle * 2 / M_PI + 1);
+		} else if (angle > 3*M_PI/2) {
+			x_distr(i) = chord/2 * ((angle - 3*M_PI/2) * 2 / M_PI + 1);
+		} else {
+			x_distr(i) = chord/2 * (cos(angle)+1);
+		}
+	}
+
+	for (size_t i=0; i<=N; i++) {
+		double T = 10 * thickness/100 * chord * (.2969*sqrt(x_distr(i)/chord) - .126*x_distr(i)/chord 
+			- .3537*pow(x_distr(i)/chord, 2) + .2843*pow(x_distr(i)/chord, 3) - .1015*pow(x_distr(i)/chord, 4));
+
+		double YBar;
+		double dYdX;
+		if (x_distr(i) / chord < camberPos/10) {
+			YBar = camber/100*x_distr(i)/pow(camberPos/10,2) * (2*camberPos/10 - x_distr(i)/chord);
+			dYdX = 2 * camber/100 / pow(camberPos/10,2) * (chord*camberPos/10 - x_distr(i));
+		} else {
+			YBar = camber/100*(chord-x_distr(i))/pow(1-camberPos/10, 2) * (1+x_distr(i)/chord-2*camberPos/10);
+			dYdX = 2 * camber/100 * (chord*camberPos/10 - x_distr(i)) / (chord * pow(1-camberPos/10, 2));
+		}
+
+		double X;
+		double Y;
+		if (i >= N/2) {
+			// Lower side
+			X = x_distr(i) + T/2 * sin(atan(dYdX));
+			Y = YBar - T/2 * cos(atan(dYdX));
+		} else {
+			// Upper side
+			X = x_distr(i) - T/2 * sin(atan(dYdX)); // Could compute the atan only once to speed up, not really useful
+													// since this function is only called to create the airfoil
+			Y = YBar + T/2 * cos(atan(dYdX));
+		}
+
+		x(i) = X;
+		y(i) = Y;
+	}
+}
+
+
+void HSPM::loadCoordinates(char* fileName) {
+    /*
+    Loads the coordinates from a file in CSV format.
+
+    Parameters
+    ----------
+    fileName : char*
+        The name of the file to load the coordinates from.
+    */
+
+	vector<double> matrixEntries;
+
+	ifstream matrixDataFile(fileName);
+	string matrixRowString;
+	string matrixEntry;
+	int matrixRowNumber = 0;
+
+	while (getline(matrixDataFile, matrixRowString)) {
+	    stringstream matrixRowStringStream(matrixRowString);
+
+	    while (getline(matrixRowStringStream, matrixEntry, ' ')) {
+	        matrixEntries.push_back(stod(matrixEntry));
+	    }
+	    matrixRowNumber++;
+	}
+
+	Eigen::MatrixXd coordinates = Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>>(matrixEntries.data(),
+            matrixRowNumber, matrixEntries.size() / matrixRowNumber).transpose();
+	N = coordinates.cols() - 1;
+	x = coordinates.row(0);
+	y = coordinates.row(1);
+}
+
+void HSPM::saveCoordinates(char* fileName) {
+    /*
+    Saves the coordinates to a file in CSV format.
+
+    Parameters
+    ----------
+    fileName : char*
+        The name of the file to save the coordinates to.
+    */
+   
+	Eigen::MatrixXd coordinates(N+1, 2);
+	coordinates.col(0) = x;
+	coordinates.col(1) = y;
+	saveMatrix(fileName, coordinates);
+}
\ No newline at end of file
diff --git a/hspm/src/geometry.h b/hspm/src/geometry.h
new file mode 100644
index 0000000000000000000000000000000000000000..f6f58e8fb5df87a50c407d9d9355bc5a55b59087
--- /dev/null
+++ b/hspm/src/geometry.h
@@ -0,0 +1,7 @@
+#ifndef GEOMETRY_H
+#define GEOMETRY_H
+
+#include "hspm.h"
+#include <vector>
+
+#endif
\ No newline at end of file
diff --git a/hspm/src/hspm.cpp b/hspm/src/hspm.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f37c052ec0fcc17ce59f188adabb20befd6b24f7
--- /dev/null
+++ b/hspm/src/hspm.cpp
@@ -0,0 +1,16 @@
+#include "hspm.h"
+
+void HSPM::initHSPM()
+{
+    /*
+    Initializes all the required Vectors/Matrices for the HSPM solver.
+    */
+    
+    this->computeConstantInfluenceCoeffs();
+    this->blVel = Eigen::VectorXd::Zero(N);
+    this->U = Eigen::VectorXd::Zero(N);
+    this->V = Eigen::VectorXd::Zero(N);
+    this->dStar = Eigen::VectorXd::Zero(N);
+    V_x = V_inf * cos(AoA);
+    V_y = V_inf * sin(AoA);
+}
\ No newline at end of file
diff --git a/hspm/src/hspm.h b/hspm/src/hspm.h
new file mode 100644
index 0000000000000000000000000000000000000000..d17501395c01238da11c54f96e9aeffccec5ae6c
--- /dev/null
+++ b/hspm/src/hspm.h
@@ -0,0 +1,69 @@
+#ifndef HSPM_H
+#define HSPM_H
+
+#include <Eigen/Dense>
+#include <utils.h>
+#include <vector>
+
+using namespace std;
+
+class HSPM {
+public:
+    void generateNaca4DigitCoordinates(double camber, double camberPos, double thickness, size_t _N);
+    void loadCoordinates(char* fileName);
+    void saveCoordinates(char* fileName);
+    void initHSPM();
+    void computeConstantInfluenceCoeffs();
+    Eigen::MatrixXd getSpeedAtPoint(double x_p, double y_p);
+    void imposeBlowingVelocity(size_t i, double _blVel);
+    void setdStar(size_t i, double _dStar);
+    void init();
+    void solve();
+    double solveOffBodyKutta();
+    void computeInviscidVelocity();
+    void computePressureDistribution();
+    void saveCp(char* fileName);
+
+    size_t N;
+    double chord;
+    Eigen::VectorXd x;
+    Eigen::VectorXd y;
+    Eigen::VectorXd x_m;
+    Eigen::VectorXd y_m;
+    Eigen::VectorXd blVel;
+    Eigen::VectorXd U;
+    Eigen::VectorXd V;
+    Eigen::VectorXd dStar;
+    Eigen::VectorXd theta;
+    Eigen::MatrixXd r;
+    Eigen::MatrixXd beta;
+    Eigen::VectorXd lengths;
+    double l;
+    Eigen::MatrixXd A_n;
+    Eigen::MatrixXd A_t;
+    Eigen::MatrixXd B_n;
+    Eigen::MatrixXd B_t;
+
+    double V_inf;
+    double V_x;
+    double V_y;
+    double AoA;
+
+    Eigen::VectorXd b;
+    Eigen::VectorXd c;
+
+    double IT_SOLVER_TOLERANCE;
+    double tau;
+    Eigen::VectorXd s1;
+    Eigen::VectorXd s2;
+    Eigen::VectorXd q;
+    Eigen::MatrixXd Cp;
+    Eigen::VectorXd Vt;
+    double cd;
+    double cl;
+
+private:
+    
+};
+
+#endif
\ No newline at end of file
diff --git a/hspm/src/influenceCoeffs.cpp b/hspm/src/influenceCoeffs.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9b263e2c7a96b6bcca90bf801b03a5871746d6e6
--- /dev/null
+++ b/hspm/src/influenceCoeffs.cpp
@@ -0,0 +1,123 @@
+#include "influenceCoeffs.h"
+
+void HSPM::computeConstantInfluenceCoeffs()
+{
+	/*
+	Calculates the constant influence coefficients
+	*/
+
+    x_m = Eigen::VectorXd(N);
+	y_m = Eigen::VectorXd(N);
+	theta = Eigen::VectorXd(N);
+	r = Eigen::MatrixXd(N,N+1);
+	beta = Eigen::MatrixXd(N,N);
+
+	lengths = Eigen::VectorXd(N);
+
+	for (size_t i=0; i<N; i++) {
+		x_m(i) = (x(i) + x(i+1)) / 2.0;
+		y_m(i) = (y(i) + y(i+1)) / 2.0;
+
+		theta(i) = atan2(y(i) - y(i+1), x(i) - x(i+1));
+
+		lengths(i) = sqrt(pow(x((i+1)%N) - x(i), 2) + pow(y((i+1)%N) - y(i), 2));
+
+		for (size_t j=0; j<N; j++) {
+			beta(i, j) = atan2(y_m(i) - y(j), x_m(i) - x(j)) - atan2(y_m(i) - y(j+1), x_m(i) - x(j+1));
+			if (beta(i, j) > M_PI) {
+				beta(i, j) -= 2*M_PI;
+			} else if (beta(i, j) < -M_PI) {
+				beta(i, j) += 2*M_PI;
+			}
+		}
+
+		for (size_t j=0; j<N+1; j++) {
+			r(i, j) = sqrt(pow(x_m(i) - x(j), 2) + pow(y_m(i) - y(j), 2));
+		}
+	}
+
+	l = lengths.sum();
+
+	A_n = Eigen::MatrixXd(N,N);
+	A_t = Eigen::MatrixXd(N,N);
+
+	B_n = Eigen::MatrixXd(N,N);
+	B_t = Eigen::MatrixXd(N,N);
+
+    double sine, cosine, logarithm;
+	for (size_t i=0; i<N; i++) {
+		for (size_t j=0; j<N; j++) {
+			if (i == j) {
+				A_n(i,j) = 0.5;
+				A_t(i,j) = 0;
+			} else {
+				sine = sin(theta(i) - theta(j));
+				cosine = cos(theta(i) - theta(j));
+				logarithm = log(r(i,j) / r(i,j+1));
+				A_n(i,j) = 1.0/(2*M_PI) * ( sine * logarithm + cosine * beta(i,j) );
+				A_t(i,j) = 1.0/(2*M_PI) * ( sine * beta(i,j) - cosine * logarithm );
+			}
+            
+			B_n(i, j) = -A_t(i, j);
+			B_t(i, j) = A_n(i, j);
+		}
+	}
+}
+
+
+
+Eigen::MatrixXd HSPM::getSpeedAtPoint(double x_p, double y_p) 
+{
+    /*
+    Returns the speed at a given point (x_p, y_p)
+    Assumes tau is still unkown at this stage
+    The speed is u = a*tau + b, v = c*tau + d
+    -------
+    Args:
+    x_p: double
+        x coordinate of the point
+    y_p: double
+        y coordinate of the point
+
+    Returns:
+    Eigen::MatrixXd
+        2x2 matrix containing the components (a, b) of speed in x and y directions
+    */
+    
+    Eigen::MatrixXd speeds = Eigen::MatrixXd::Zero(2,2);
+
+    // Freestream
+    speeds(0,1) = V_x;
+    speeds(1,1) = V_y;
+
+    // Influence of the panels: A and B
+    for (size_t j=0; j<N; j++) {
+        double sine = sin(-theta(j));
+        double cosine = cos(-theta(j));
+        double r_p_jp1 = sqrt( pow(x_p - x(j+1), 2) + pow(y_p - y(j+1), 2) );
+        double r_p_j = sqrt( pow(x_p - x(j), 2) + pow(y_p - y(j), 2) );
+        double logarithm = log(r_p_j / r_p_jp1);
+        double beta_p_jp1 = atan2(y_p - y(j), x_p - x(j)) - atan2(y_p - y(j+1), x_p - x(j+1));
+        if (beta_p_jp1 > M_PI) {
+            beta_p_jp1 -= 2*M_PI;
+        } else if (beta_p_jp1 < -M_PI) {
+            beta_p_jp1 += 2*M_PI;
+        }
+
+        double _A_x = 1.0/(2*M_PI) * ( sine * beta_p_jp1 - cosine * logarithm );
+        double _A_y = 1.0/(2*M_PI) * ( sine * logarithm + cosine * beta_p_jp1 );
+
+        double _B_x = _A_y;
+        double _B_y = -_A_x;
+
+        // tau contribution
+        speeds(0,0) += _A_x * s1(j) + _B_x;
+        speeds(1,0) += _A_y * s1(j) + _B_y;
+
+        // constant contribution
+        speeds(0,1) += _A_x * s2(j);
+        speeds(1,1) += _A_y * s2(j);
+    }
+
+    return speeds;
+}
\ No newline at end of file
diff --git a/hspm/src/influenceCoeffs.h b/hspm/src/influenceCoeffs.h
new file mode 100644
index 0000000000000000000000000000000000000000..92e5da97c4f3128c997e3c7e5be38ea96c73536b
--- /dev/null
+++ b/hspm/src/influenceCoeffs.h
@@ -0,0 +1,6 @@
+#ifndef INFLUENCE_COEFFS_H
+#define INFLUENCE_COEFFS_H
+
+#include "hspm.h"
+
+#endif
\ No newline at end of file
diff --git a/hspm/src/interface.cpp b/hspm/src/interface.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1907ef1064219df284b0c46dc2a58bc96a4efb08
--- /dev/null
+++ b/hspm/src/interface.cpp
@@ -0,0 +1,31 @@
+#include "interface.h"
+
+void HSPM::imposeBlowingVelocity(size_t i, double _blVel) 
+{
+    /*
+    Imposes the blowing velocity to a panel.
+
+    Parameters
+    ----------
+    i : size_t
+        The index of the panel to impose the blowing velocity to.
+    blVel : double
+        The blowing velocity to impose. [m/s]
+    */
+    this->blVel[i] = _blVel;
+}
+
+void HSPM::setdStar(size_t i, double _dStar)
+{
+    /*
+    Sets the dStar value for a panel.
+
+    Parameters
+    ----------
+    i : size_t
+        The index of the panel to set the dStar value to.
+    _dStar : double
+        The dStar value to set. [m]
+    */
+    this->dStar[i] = _dStar;
+}
\ No newline at end of file
diff --git a/hspm/src/interface.h b/hspm/src/interface.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3d67842503d3226e16d9d83d673dc6a2d0adcc6
--- /dev/null
+++ b/hspm/src/interface.h
@@ -0,0 +1,6 @@
+#ifndef INTERFACE_H
+#define INTERFACE_H
+
+#include "hspm.h"
+
+#endif
\ No newline at end of file
diff --git a/hspm/src/solver.cpp b/hspm/src/solver.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..afb83ad551966e0cbbb8d47a2da63066ed2c356e
--- /dev/null
+++ b/hspm/src/solver.cpp
@@ -0,0 +1,143 @@
+#include "solver.h"
+
+void HSPM::init() 
+{
+    /*
+    Initializes the solver.
+    */
+    b = Eigen::VectorXd::Zero(N);
+    c = Eigen::VectorXd::Zero(N);
+}
+
+void HSPM::solve()
+{
+    /*
+    Solves for the steady-state solution.
+    */
+
+    this->init();
+
+    // Build the system
+    for (size_t i=0; i<N; i++) {
+        for (size_t j=0; j<N; j++) {
+            b(i) -= B_n(i,j);
+        }
+        c(i) -=  V_inf * sin(AoA - theta(i));
+    }
+
+    c += blVel;
+
+    // Solve using Eigen's BiCGSTAB solver
+    Eigen::BiCGSTAB<Eigen::MatrixXd> solver1;
+    solver1.setTolerance(IT_SOLVER_TOLERANCE);
+    s1 = solver1.compute(A_n).solve(b);
+
+    Eigen::BiCGSTAB<Eigen::MatrixXd> solver2;
+    solver2.setTolerance(IT_SOLVER_TOLERANCE);
+    s2 = solver2.compute(A_n).solve(c);
+
+    // Check if the solver converged
+    if (solver2.info() != Eigen::Success || solver1.info() != Eigen::Success) {
+        std::cout << "Iterative solver failed !" << std::endl;
+        exit(-1);
+    }
+
+    // q = s1*tau + s2
+    // We need Kutta for tau
+    tau = this->solveOffBodyKutta();
+    
+    q = s1*tau + s2;
+
+    this->computeInviscidVelocity(); 
+    this->computePressureDistribution();
+}
+
+double HSPM::solveOffBodyKutta() {
+    double xc_0 = x_m(0) - (dStar(0)+1e-10) * sin(theta(0));
+    double yc_0 = y_m(0) + (dStar(0)+1e-10) * cos(theta(0));
+    double xc_N1 = x_m(N-1) - (dStar(N-1)+1e-10) * sin(theta(N-1));
+    double yc_N1 = y_m(N-1) + (dStar(N-1)+1e-10) * cos(theta(N-1));
+
+    /*
+    The magnitude of the velocity at the control points is equal
+    We can express any velocity u = a*tau + b
+    We have [mag(u,v)]_0^2 - [mag(u,v)]_N1^2 = 0
+    or
+    [(a*tau + b)^2 + (c*tau + d)^2] - [(e*tau + f)^2 + (g*tau + h)^2] = 0
+    developed, this becomes:
+    (a^2+c^2-e^2-g^2)*tau^2 + 2*(a*b+c*d-e*f-g*h)*tau + (b^2+d^2-f^2-h^2) = 0
+    This can be solved for tau with the quadratic formula
+    We just have to compute the coefficients a, b, c, d, e, f, g, h and pick the right solution
+    */
+
+    // Left side of the equation
+    Eigen::MatrixXd UV_0 = this->getSpeedAtPoint(xc_0, yc_0);
+    Eigen::MatrixXd UV_N1 = this->getSpeedAtPoint(xc_N1, yc_N1);
+
+    double _a = UV_0(0,0);
+    double _b = UV_0(0,1);
+    double _c = UV_0(1,0);
+    double _d = UV_0(1,1);
+    double _e = UV_N1(0,0);
+    double _f = UV_N1(0,1);
+    double _g = UV_N1(1,0);
+    double _h = UV_N1(1,1);
+
+    // Gather all of the terms
+    double _tau2_terms = pow(_a,2) + pow(_c,2) - pow(_e,2) - pow(_g,2);
+    double _tau_terms = 2*(_a*_b + _c*_d - _e*_f - _g*_h);
+    double _const_terms = pow(_b,2) + pow(_d,2) - pow(_f,2) - pow(_h,2);
+
+    // Solve the quadratic equation
+    double tau_ = (-_tau_terms - sqrt(pow(_tau_terms,2) - 4*_tau2_terms*_const_terms)) / (2*_tau2_terms);
+
+    return tau_;
+}
+
+
+void HSPM::computeInviscidVelocity()
+{
+    /*
+    Computes the inviscid velocity at the viscous boundary
+    */
+
+   for (size_t i=0; i<N; i++) {
+        double x_visc = x_m(i) - (dStar(i)+1e-10) * sin(theta(i));
+        double y_visc = y_m(i) + (dStar(i)+1e-10) * cos(theta(i));
+
+        Eigen::MatrixXd UV = this->getSpeedAtPoint(x_visc, y_visc);
+
+        U(i) = UV(0,0) * tau + UV(0,1);
+        V(i) = UV(1,0) * tau + UV(1,1);
+    }
+}
+
+void HSPM::computePressureDistribution() {
+    /*
+    Computes the pressure distribution on the airfoil
+    */
+
+    Eigen::VectorXd V_t(N);
+    Cp = Eigen::MatrixXd(N, 2);
+
+    // Compute the tangential speeds 
+    for (size_t i=0; i<N; i++) {
+        V_t(i) = V_inf * cos(AoA - theta(i));
+        for (size_t j=0; j<N; j++) {
+            V_t(i) += A_t(i, j) * q(j);
+            V_t(i) += B_t(i, j) * tau;
+        }
+
+        // Compute the pressure coefficients
+        Cp(i, 0) = x_m(i);
+        Cp(i, 1) = 1 - pow(V_t(i) / V_inf, 2);
+    }
+
+    cl = 0;
+    cd = 0;
+    // Compute cd, cl
+    for (size_t i=0; i<N; i++) {
+        cl -= Cp(i, 1) * cos(theta(i) - AoA) * lengths(i);
+        cd += Cp(i, 1) * sin(theta(i) - AoA) * lengths(i);
+    }
+}
\ No newline at end of file
diff --git a/hspm/src/solver.h b/hspm/src/solver.h
new file mode 100644
index 0000000000000000000000000000000000000000..bed33136fbbbaea3dfcfec84d45c39de8886591f
--- /dev/null
+++ b/hspm/src/solver.h
@@ -0,0 +1,8 @@
+#ifndef SOLVER_H
+#define SOLVER_H
+
+#include "hspm.h"
+#include <iostream>
+#include <Eigen/IterativeLinearSolvers>
+
+#endif
\ No newline at end of file
diff --git a/hspm/src/utils.cpp b/hspm/src/utils.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8f2b45d2f04fd50c256588487a732f81ad0a4b12
--- /dev/null
+++ b/hspm/src/utils.cpp
@@ -0,0 +1,36 @@
+#include "utils.h"
+#include "hspm.h"
+
+void saveMatrix(char* fileName, Eigen::MatrixXd matrix) {
+    /*
+    Saves the matrix to a file in CSV format.
+
+    Parameters
+    ----------
+    fileName : char*
+        The name of the file to save the matrix to.
+    matrix : Eigen::MatrixXd
+        The matrix to save.
+    */
+	const static Eigen::IOFormat CSVFormat(Eigen::FullPrecision, Eigen::DontAlignCols, " ", "\n");
+ 
+    std::ofstream file(fileName);
+    if (file.is_open())
+    {
+        file << matrix.format(CSVFormat);
+        file.close();
+    }
+}
+
+void HSPM::saveCp(char* fileName) {
+    /*
+    Saves the pressure coefficient to a file in CSV format.
+
+    Parameters
+    ----------
+    fileName : char*
+        The name of the file to save the pressure coefficient to.
+    */
+   
+    saveMatrix(fileName, Cp);
+}
\ No newline at end of file
diff --git a/hspm/src/utils.h b/hspm/src/utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..5a939b5638500663051482799a1860d691073dce
--- /dev/null
+++ b/hspm/src/utils.h
@@ -0,0 +1,9 @@
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <Eigen/Dense>
+#include <fstream>
+
+void saveMatrix(char* fileName, Eigen::MatrixXd matrix);
+
+#endif
\ No newline at end of file
diff --git a/python/airfoil.dat b/python/airfoil.dat
new file mode 100644
index 0000000000000000000000000000000000000000..4fcff23cc94e3e119444039feb124aa229af272e
--- /dev/null
+++ b/python/airfoil.dat
@@ -0,0 +1,101 @@
+1 1.66533453693773e-17
+0.999013364214136 -0.000140835441469506
+0.996057350657239 -0.000561762174624333
+0.991143625364344 -0.00125808467901582
+0.984291580564316 -0.00222211850309532
+0.975528258147577 -0.00344339291590901
+0.964888242944126 -0.0049089163617143
+0.95241352623301 -0.0066034880139773
+0.938153340021932 -0.00851003605407132
+0.922163962751008 -0.0106099620050805
+0.904508497187474 -0.0128834706327159
+0.885256621387895 -0.0153098665821892
+0.864484313710706 -0.0178678019484713
+0.842273552964344 -0.0205354631781272
+0.818711994874345 -0.0232906907908307
+0.793892626146236 -0.0261110310394699
+0.767913397489498 -0.0289737244086614
+0.740876837050858 -0.0318556413749577
+0.712889645782536 -0.0347331807208502
+0.684062276342339 -0.0375821495487363
+0.654508497187474 -0.0403776466819014
+0.624344943582427 -0.0430939721514063
+0.593690657292862 -0.0457045848329603
+0.562666616782152 -0.048182128006622
+0.531395259764657 -0.0504985387651411
+0.5 -0.0526252520005716
+0.468604740235343 -0.0545335034546376
+0.437333383217848 -0.056194729404379
+0.406309342707138 -0.0575810534030492
+0.375655056417573 -0.0586658435667832
+0.345491502812526 -0.0594243176484838
+0.315937723657661 -0.0598341679994961
+0.287110354217464 -0.0598761748565317
+0.259123162949142 -0.0595347744929392
+0.232086602510502 -0.0587985488245103
+0.206107373853763 -0.0576606051295196
+0.181288005125655 -0.0561188185772977
+0.157726447035656 -0.054175916084712
+0.135515686289294 -0.0518393873480343
+0.114743378612105 -0.0491212173440891
+0.0954915028125263 -0.0460374436990048
+0.0778360372489925 -0.0426075515760506
+0.0618466599780682 -0.0388537276075468
+0.0475864737669902 -0.0348000023735976
+0.0351117570558743 -0.0304713175395326
+0.0244717418524232 -0.0258925586035047
+0.0157084194356845 -0.0210875969711737
+0.00885637463565564 -0.0160783855767767
+0.00394264934276106 -0.0108841504478057
+0.000986635785864221 -0.00552071653494481
+0 0
+0.000986635785864221 0.00552071653494481
+0.00394264934276106 0.0108841504478057
+0.00885637463565569 0.0160783855767768
+0.0157084194356845 0.0210875969711737
+0.0244717418524232 0.0258925586035047
+0.0351117570558744 0.0304713175395326
+0.0475864737669903 0.0348000023735976
+0.0618466599780683 0.0388537276075468
+0.0778360372489925 0.0426075515760506
+0.0954915028125264 0.0460374436990048
+0.114743378612105 0.0491212173440891
+0.135515686289294 0.0518393873480343
+0.157726447035656 0.054175916084712
+0.181288005125655 0.0561188185772977
+0.206107373853763 0.0576606051295196
+0.232086602510502 0.0587985488245103
+0.259123162949142 0.0595347744929392
+0.287110354217464 0.0598761748565317
+0.315937723657661 0.0598341679994961
+0.345491502812526 0.0594243176484838
+0.375655056417573 0.0586658435667832
+0.406309342707138 0.0575810534030492
+0.437333383217848 0.056194729404379
+0.468604740235343 0.0545335034546376
+0.5 0.0526252520005716
+0.531395259764657 0.0504985387651411
+0.562666616782152 0.048182128006622
+0.593690657292863 0.0457045848329603
+0.624344943582427 0.0430939721514063
+0.654508497187474 0.0403776466819014
+0.684062276342339 0.0375821495487363
+0.712889645782536 0.0347331807208502
+0.740876837050858 0.0318556413749577
+0.767913397489498 0.0289737244086614
+0.793892626146237 0.0261110310394698
+0.818711994874345 0.0232906907908307
+0.842273552964344 0.0205354631781272
+0.864484313710706 0.0178678019484713
+0.885256621387895 0.0153098665821892
+0.904508497187474 0.0128834706327159
+0.922163962751008 0.0106099620050805
+0.938153340021932 0.00851003605407132
+0.95241352623301 0.0066034880139773
+0.964888242944126 0.0049089163617143
+0.975528258147577 0.00344339291590901
+0.984291580564316 0.00222211850309532
+0.991143625364344 0.00125808467901582
+0.996057350657239 0.000561762174624333
+0.999013364214136 0.000140835441469506
+1 -1.66533453693773e-17
\ No newline at end of file
diff --git a/python/main.py b/python/main.py
new file mode 100644
index 0000000000000000000000000000000000000000..44e3b17f5ab13b8555ef420a51771d68b57cfca8
--- /dev/null
+++ b/python/main.py
@@ -0,0 +1,24 @@
+from utils import *
+
+N = 1000
+
+config = {
+	'chord': 1,
+	'it_solver_tolerance': 1e-6,
+	'aoa': 2,
+	'naca': "0012",
+	'N': N,
+	'filename': "airfoil.dat"
+}
+
+if __name__ == "__main__":
+	solver = initHSPM(config)
+
+	"""for i in range(N):
+					solver.imposeBlowingVelocity(i, 1)
+					solver.setdStar(i, 0.1)"""
+
+	solver.solve()
+
+	cl = solver.cl
+	print(cl)
\ No newline at end of file
diff --git a/python/utils.py b/python/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..68a84a4f954b56de66b2e09a7b9a4168dfb23585
--- /dev/null
+++ b/python/utils.py
@@ -0,0 +1,16 @@
+import sys
+import os
+# Get the parent directory of the current script
+current_dir = os.path.dirname(os.path.realpath(__file__))
+parent_dir = os.path.abspath(os.path.join(current_dir, os.pardir))
+bin_dir = os.path.join(parent_dir, "build/bin")
+sys.path.append(bin_dir)
+api_dir = os.path.join(parent_dir, "hspm/api")
+sys.path.append(api_dir)
+import hspmw
+
+import time
+import numpy as np
+import matplotlib.pyplot as plt
+
+from core import *
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..5ff864680d248729193a1e152f00d553b618e9bf
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,12 @@
+# Hess and Smith Panel Method
+
+## Build
+```bash
+mkdir build
+cd build
+cmake ..
+make -j $(nproc)
+```
+
+## Usage 
+Typical usage in `./python/main.py`.
\ No newline at end of file