Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
633339f
Runge-Kutta time-stepping
JSchoeberl Dec 5, 2023
151ff70
Gauss and Radau integration rules
JSchoeberl Dec 5, 2023
263691d
update RK branch
JSchoeberl Nov 7, 2025
617b24a
nanoblas inverse
JSchoeberl Nov 7, 2025
e15854b
Merge branch 'main' into RungeKutta
JSchoeberl Nov 7, 2025
17fc9b0
Runge-Kutta TimeStepper
JSchoeberl Nov 19, 2025
8b6aea5
Working Python module asc_ode + fixed nanoblas linking
Mian1930 Nov 21, 2025
827c139
included massspring into Newmark branch
JSchoeberl Nov 23, 2025
246905e
update py-binding
JSchoeberl Nov 23, 2025
4da68b3
cleaning up py-bindings
JSchoeberl Nov 23, 2025
3f8a6f5
cleanup notebook
JSchoeberl Nov 23, 2025
03462f0
Exercise 17
Mian1930 Nov 24, 2025
1277df0
Add the missing folder
Mian1930 Nov 24, 2025
18d7b0e
little polish
JSchoeberl Nov 27, 2025
6a33c4b
remove include ngs
JSchoeberl Nov 27, 2025
17cb2d3
add pypath
JSchoeberl Nov 27, 2025
5a73c3e
Add explicit RK implementation + RK demo and plotting scripts for cha…
Mian1930 Nov 29, 2025
68b66b2
Add explicit RK implementation + RK demo and plotting scripts for cha…
Mian1930 Nov 29, 2025
7b5f7c8
Final local edits before merging submission-18-19
Mian1930 Nov 29, 2025
3bd4df8
Merge submission-18-19: completed Exercises 17, 18, 19
Mian1930 Nov 29, 2025
46abbf6
Add README and finalize test_ode + updated steppers
Mian1930 Nov 30, 2025
bb9836c
Merge branch 'main' into RungeKutta
JSchoeberl Dec 3, 2025
62f18e0
doStep
JSchoeberl Dec 3, 2025
6842d9f
Merge branch 'RungeKutta' into Newmark
JSchoeberl Dec 3, 2025
2ca6041
Resolve merge: accept upstream/Newmark versions for test_ode and nonl…
Mian1930 Dec 5, 2025
443e6b2
Merge upstream/Newmark: resolved conflicts and added bindings.cpp stub
Mian1930 Dec 5, 2025
46b9d12
Incorporate upstream Newmark
Mian1930 Dec 5, 2025
afb130d
Exercise 20 complete — constrained mass–spring system with exact Jaco…
Mian1930 Dec 8, 2025
ffd85c7
Resolve merge conflicts: keep local versions (overwrite remote)
Mian1930 Dec 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .ipynb_checkpoints/CMakeLists-checkpoint.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.20)
project(ASC_ode LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories(src nanoblas/src)
add_subdirectory(nanoblas)

add_executable(test_ode demos/test_ode.cpp)
target_link_libraries(test_ode PUBLIC nanoblas)

add_executable(demo_autodiff demos/demo_autodiff.cpp)
target_link_libraries(demo_autodiff PUBLIC nanoblas)

# Python bindings
find_package(pybind11 REQUIRED CONFIG)

# 🔥 FIX: Also link pybind11 for the C++ executables
target_link_libraries(test_ode PRIVATE pybind11::pybind11)
target_link_libraries(demo_autodiff PRIVATE pybind11::pybind11)

pybind11_add_module(asc_ode
src/bindings.cpp
)

target_link_libraries(asc_ode PRIVATE nanoblas)

set_target_properties(asc_ode PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
Binary file added .ipynb_checkpoints/legendre_Ps-checkpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .ipynb_checkpoints/legendre_dPs-checkpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 22 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
cmake_minimum_required(VERSION 3.20)
project(ASC_ode)

set (CMAKE_CXX_STANDARD 20)
project(ASC_ode LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories(src nanoblas/src)
add_subdirectory(nanoblas)

add_executable(test_ode demos/test_ode.cpp)
target_link_libraries(test_ode PUBLIC nanoblas)

add_executable(demo_autodiff demos/demo_autodiff.cpp)
target_link_libraries(demo_autodiff PUBLIC nanoblas)

add_subdirectory (src)
add_subdirectory (nanoblas)
# Python bindings
find_package(pybind11 REQUIRED CONFIG)

# 🔥 FIX: Also link pybind11 for the C++ executables
target_link_libraries(test_ode PRIVATE pybind11::pybind11)
target_link_libraries(demo_autodiff PRIVATE pybind11::pybind11)

add_executable (test_ode demos/test_ode.cpp)
target_link_libraries (test_ode PUBLIC nanoblas)
pybind11_add_module(asc_ode
src/bindings.cpp
)

add_executable (demo_autodiff demos/demo_autodiff.cpp)
target_link_libraries (demo_autodiff PUBLIC nanoblas)
target_link_libraries(asc_ode PRIVATE nanoblas)

set_target_properties(asc_ode PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
23 changes: 23 additions & 0 deletions CrankNicolson.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once
#include "timestepper.hpp"
#include "function_algebra.hpp"
#include "newton.hpp"
class CrankNicolson : public TimeStepper {
std::shared_ptr<NonlinearFunction> eq;
std::shared_ptr<Parameter> tau;
std::shared_ptr<ConstantFunction> yold, fold;
Vector<> ftmp;
public:
CrankNicolson(std::shared_ptr<NonlinearFunction> rhs)
: TimeStepper(rhs), tau(std::make_shared<Parameter>(0.0)), ftmp(rhs->dimF()) {
yold = std::make_shared<ConstantFunction>(rhs->dimX());
fold = std::make_shared<ConstantFunction>(rhs->dimF());
auto id = std::make_shared<IdentityFunction>(rhs->dimX());
eq = id - yold - 0.5*tau*(fold + rhs);
}
void doStep(double tau, VectorView<double> y) override {
m_rhs->evaluate(y, ftmp); fold->set(ftmp);
yold->set(y); tau->set(tau);
NewtonSolver(eq, y);
}
};
19 changes: 19 additions & 0 deletions ImplicitEuler.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once
#include "timestepper.hpp"
#include "function_algebra.hpp"
#include "newton.hpp"
class ImplicitEuler : public TimeStepper {
std::shared_ptr<NonlinearFunction> eq;
std::shared_ptr<Parameter> tau;
std::shared_ptr<ConstantFunction> yold;
public:
ImplicitEuler(std::shared_ptr<NonlinearFunction> rhs)
: TimeStepper(rhs), tau(std::make_shared<Parameter>(0.0)) {
yold = std::make_shared<ConstantFunction>(rhs->dimX());
auto id = std::make_shared<IdentityFunction>(rhs->dimX());
eq = id - yold - tau * rhs;
}
void doStep(double tau, VectorView<double> y) override {
yold->set(y); tau->set(tau); NewtonSolver(eq, y);
}
};
14 changes: 14 additions & 0 deletions ImprovedEuler.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once
#include "timestepper.hpp"
class ImprovedEuler : public TimeStepper {
Vector<> k1, k2, tmp;
public:
ImprovedEuler(std::shared_ptr<NonlinearFunction> rhs)
: TimeStepper(rhs), k1(rhs->dimF()), k2(rhs->dimF()), tmp(rhs->dimF()) {}
void doStep(double tau, VectorView<double> y) override {
m_rhs->evaluate(y, k1);
tmp = y + tau * k1;
m_rhs->evaluate(tmp, k2);
y += tau * (0.5 * k1 + 0.5 * k2);
}
};
Loading