Skip to content

Commit

Permalink
Multithreaded works
Browse files Browse the repository at this point in the history
  • Loading branch information
cbritopacheco committed Nov 13, 2023
1 parent afe32d3 commit 9808aca
Show file tree
Hide file tree
Showing 8 changed files with 1,290 additions and 31 deletions.
10 changes: 5 additions & 5 deletions examples/PDEs/Poisson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <Rodin/Solver.h>
#include <Rodin/Geometry.h>
#include <Rodin/Variational.h>
#include <chrono>

using namespace Rodin;
using namespace Rodin::Geometry;
Expand Down Expand Up @@ -35,12 +36,11 @@ int main(int, char**)
poisson = Integral(Grad(u), Grad(v))
- Integral(f, v)
+ DirichletBC(u, g);
poisson.assemble();

for (auto it = mesh.getBoundary(); it; ++it)
{
mesh.setAttribute({ it->getDimension(), it->getIndex() }, 2);
}
auto t0 = std::chrono::high_resolution_clock::now();
poisson.assemble();
auto t1 = std::chrono::high_resolution_clock::now();
std::cout << std::chrono::duration_cast<std::chrono::nanoseconds>(t1 - t0).count() << std::endl;

// Solve the problem
Solver::SparseLU solver;
Expand Down
819 changes: 819 additions & 0 deletions src/Rodin/Assembly/BS_thread_pool.hpp

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/Rodin/Assembly/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(RodinAssembly_HEADERS
set(RodinAssembly_SRCS
AssemblyBase.cpp
Serial.cpp
Multithreaded.h)
Multithreaded.cpp)

add_library(RodinAssembly
${RodinAssembly_SRCS} ${RodinAssembly_HEADERS})
Expand All @@ -24,6 +24,7 @@ target_include_directories(RodinAssembly

target_link_libraries(RodinAssembly
PUBLIC
Threads::Threads
Rodin::Utility
Rodin::FormLanguage
Rodin::Variational)
Loading

0 comments on commit 9808aca

Please sign in to comment.