SimVascular / SimVascular/svMultiPhysics

Add Eigen as an optional backend for Vector and Array classes

Open
#307 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement future development
Dominant language
C++
Stars
45
Forks
60
Avg merge
5d 23h
Merged PRs (30d)
11

Description

Use Case

For the Vector.h and Array.h files we currently implement custom Vector and Array objects. Eigen is a high-level C++ library of template headers for linear algebra, matrix and vector operations, geometrical transformations, numerical solvers and related algorithms. Often Eigen or another such robust linear algebra library is used within large scientific computation or industry projects for clean, clear, and optimized data abstractions. Ultimately, leveraging Eigen can allow for many routines in svMultiPhysics to be expressed algebraically while accelerating computation with library vectorization.

Problem

Custom Vector.h and Array.h classes offer straightforward but non-optimized mathematical operations and lack of advanced linear algebra functionalities. These implementations typically require manual management of memory and computations, leading to increased code complexity and a higher risk of bugs and numerical inaccuracies. Additionally these custom classes may struggle with scalability and efficiency, making it difficult to handle large datasets or perform complex operations efficiently. This may result in code redundancies, performance inefficiencies, and limited extensibility of the current code base.

Solution
  • Add flexible configuration flag USE_EIGEN to CMAKE to allow for Vector.h and Array.h to be built using Eigen::Map objects.
  • Add Eigen linear algebra algorithms to mat_fun.h/mat_fun.cpp files
Alternatives considered

Eigen seems the most convenient to add as a backend; however other libraries such as Boost might be considered with this same interfacing scheme.

Additional context

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Vector.h, Array.h, mat_fun.h, mat_fun.cpp, and the CMake configuration to understand the existing interfaces and build options. Done means a USE_EIGEN option can select Eigen::Map-based Vector and Array implementations, with Eigen linear algebra algorithms added to the matrix-function files.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
hpc
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.