-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interface to linear solvers #30
Comments
@yuecheng-yu and I want to implement the PETSc interface that @CZHU20 developed for @ktbolt, do you already have anything that we should build on top? |
Sure. No problem.
On Aug 19, 2023, at 05:37, Martin R. Pfaller ***@***.***> wrote:
@yuecheng-yu<https://github.com/yuecheng-yu> and I want to implement the PETSc interface that @CZHU20<https://github.com/CZHU20> developed for svFSI in svFSIplus because we need a direct linear solver.
@ktbolt<https://github.com/ktbolt>, do you already have anything that we should build on top?
@CZHU20<https://github.com/CZHU20>, can we use your C code in svFSIplus?
—
Reply to this email directly, view it on GitHub<#30 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKOVCMHO2P2VYN6SLKZE35LXV7OCFANCNFSM6AAAAAAWTGMMYE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@mrp089 I have not spent any time thinking about this. But off the top of my head what we need is an interface to linear solvers implemented something like this
We will first need to understand what data structures are needed to interface to Trilinos and PETSc, then prototype the interface. |
@mrp089 @yuecheng-yu I've seen no discussions about the design of the interface. Possible designs, implementation strategies, prototypes, etc. should be discussed before any code is implemented. |
As stated above, #143 is a literal translation of the @ktbolt, please feel free to participate in our discussions in the lab at any time. |
@yuecheng-yu I would like to implement the interface I outlined above. I can meet with you at any time if you would like to discuss possible designs and implementation. |
@mrp089 I don't think anything more is going to be done with this so go ahead and do a PR for the PETSc interface, good to have this in when we release. |
No activity here so closing. |
@mrp089 I will create a linear solver interface to the svFSILS, Trilinos and PETSc linear solvers. Shall I use your petsc_interface_30 branch for PETSc? |
Awesome!! Yes, that's still the most up-to-date version. There is also an example in there that uses a direct solver. |
I have built PETSc libs from source on a Mac. After figuring out how to enable building with PETSc and some problems with setting I was then able to run tests/cases/fsi/pipe_3d, results seemed ok. |
Looking at the My plan is to
|
I've incorporated the PETSc interface into a branch of the latest svFSIplus code, compiled and tested, works. |
I've created a The A PETSc interface is created like so
All of the PETSc-dependent code has been moved to |
The PETSc interface I've cleaned up all of this so now the code looks like it is actually part of svFSIplus. |
I've added All Trilinos solve code has been moved into I have not yet implemented using Trilinos for assembly and preconditioning, can be used with FSILS solve it seems, need to understand how these guys work together. |
I needed to reorganized the code a bit to get things to work in parallel, fsils works and trilinos works, still some things to do for petsc. You can now replace
with
|
It just hit me that the It would be good to have PETSc work the same way. |
I've modified the PETSc interface to support using PETSc on a per equation basis. I've also added error checking for all of the restrictions for preconditioning and assembly. |
@MatteoSalvador @mrp089 I am going to remove support for the
will no longer be valid, a
I would also like to make the |
I've added error checking and changed the I will now replace the remaining |
I've replace the remaining And I added a check for the I've also added support for a couple of PETSc preconditioners (jacobi and rcs). |
I've made all of the changes I think we need for now, all code for each of the linear algebra interfaces is mostly encapsulated in classes. There is still a bit of assembly code spread around for the The |
@MatteoSalvador @mrp089 I was thinking to update all of the Shall I do that or should I create another Issue and branch for the file changes? |
Thanks @ktbolt! I think you can update the tests within the same PR/issue, as this is strongly connected to the linear algebra modifications |
@ktbolt, yes, please update the tests so they work with your code changes (otherwise we can't merge it). How will we test the PETSc and Trilinos interfaces on GitHub runners? I see two options:
|
We do need to monitor memory and execute time, make sure those don't change significantly with code modifications. |
In my experience, building PETSc or Trilinos took a long time. But if you have a minimal configuration that builds quickly everything that we need for svFSI and nothing more, that would be great! In this case, maybe add the build instructions as separate bash configure scripts that are then called in GitHub's limit is six hours. We can set our own time limit with |
I didn't think PETSc took so long to build but maybe (probably) I was not building it in all of its glory. I built Trilinos according to the svFSI instructions. The primary problem I had there was getting |
…Vascular#30) - created dockerfiles to build Docker containers with pre-compiled Trilinos and PETSc libraries in Ubuntu-20.04 and Ubuntu-22.04 (addresses issue SimVascular#211) - added test cases for fluid and fsi problems to test Trilinos and PETSc linear solvers and preconditioners - updated the workflow file test_ubuntu.yml to include PETSc and Trilinos tests for continuous integration (CI)
…imVascular#211) - Trilinos and PETSc interfaces added by @ktbolt - created dockerfiles to build Docker containers with pre-compiled Trilinos and PETSc libraries in Ubuntu-20.04 and Ubuntu-22.04 - added test cases for fluid and fsi problems to test Trilinos and PETSc linear solvers and preconditioners - updated the workflow file test_ubuntu.yml to include PETSc and Trilinos tests for continuous integration (CI)
- Trilinos and PETSc interfaces added by @ktbolt - created dockerfiles to build Docker containers with pre-compiled Trilinos and PETSc libraries in Ubuntu-20.04 and Ubuntu-22.04 - added test cases for fluid and fsi problems to test Trilinos and PETSc linear solvers and preconditioners - updated the workflow file test_ubuntu.yml to include PETSc and Trilinos tests for continuous integration (CI)
Merged into main. |
svFSIplus currently supports an interface to the Trilinos linear solver. The interface for matrix assembly looks like this
and is included in the assembly code for all equations (e.g.,
construct_fluid()
for the fluid equation), about 20 files.A better design would be to replace all of these
#ifdef
blocks with a call to a linear solver interface, for examplewhere
linear_solver
is an object created for a specific linear solver (e.g., Trilinos, FSILS, PETSc).The text was updated successfully, but these errors were encountered: