Skip to content
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 Trilinos for linear solver #69

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

xDarkLemon
Copy link
Contributor

No description provided.

@xDarkLemon xDarkLemon changed the title Add Trilinos Add Trilinos for linear solver Feb 14, 2024
Copy link
Member

@teseoch teseoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you try to add to the ci (UNIX only) trilinos installed with apt?

@@ -153,6 +155,16 @@
],
"doc": "Settings for the AMGCL solver."
},
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think you need any of these, there are no options for trilinos

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to add the options from trilinos

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Eigen::MatrixXd test_vertices;
Eigen::MatrixXd init_vertices;
std::vector<int> test_boundary_nodes;
Eigen::MatrixXd remove_boundary_vertices(const Eigen::MatrixXd &vertices, const std::vector<int> &boundary_nodes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -25,6 +34,11 @@ namespace spdlog

namespace polysolve::linear
{
#ifdef POLYSOLVE_LARGE_INDEX
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

{
if (params.contains("Trilinos"))
{
if (params["Trilinos"].contains("block_size"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add these options to the spec

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now the block size is a method

extern Eigen::MatrixXd init_vertices;
extern Eigen::MatrixXd test_vertices;
extern std::vector<int> test_boundary_nodes;
Eigen::MatrixXd remove_boundary_vertices(const Eigen::MatrixXd &vertices, const std::vector<int> &boundary_nodes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be inside trilinos, not here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

CMakeLists.txt Show resolved Hide resolved
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.63%. Comparing base (d65d1b1) to head (03fc84f).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
+ Coverage   87.27%   87.63%   +0.35%     
==========================================
  Files          48       46       -2     
  Lines        2028     1916     -112     
==========================================
- Hits         1770     1679      -91     
+ Misses        258      237      -21     
Flag Coverage Δ
polysolve 87.63% <ø> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@teseoch teseoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need unit test, with and without block size and null space

@@ -77,9 +77,11 @@ option(POLYSOLVE_WITH_SUPERLU "Enable SuperLU library"
option(POLYSOLVE_WITH_MKL "Enable MKL library" ${POLYSOLVE_NOT_ON_APPLE_SILICON})
option(POLYSOLVE_WITH_CUSOLVER "Enable cuSOLVER library" OFF)
option(POLYSOLVE_WITH_PARDISO "Enable Pardiso library" OFF)
option(POLYSOLVE_WITH_HYPRE "Enable hypre" ON)
option(POLYSOLVE_WITH_HYPRE "Enable hypre" OFF)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on

@@ -4,6 +4,10 @@

#include <memory>

#include <Eigen/Dense>
#include <Eigen/Sparse>
#include <vector>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are not necessary?

{
if (params.contains("Trilinos"))
{
if (params["Trilinos"].contains("block_size"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now the block size is a method

{
conv_tol_ = params["Trilinos"]["tolerance"];
}
if (params["Trilinos"].contains("is_nullspace"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also a method

{
if (test_vertices.cols()==3)
{
reduced_vertices=remove_boundary_vertices(test_vertices,test_boundary_nodes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shoudnt be here, the null space is a method

Eigen::MatrixXd test_vertices;
Eigen::MatrixXd init_vertices;
std::vector<int> test_boundary_nodes;
Eigen::MatrixXd remove_boundary_vertices(const Eigen::MatrixXd &vertices, const std::vector<int> &boundary_nodes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be inside an util file

#include <Eigen/Sparse>
#include <vector>

#ifdef HAVE_MPI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mpi is always here?

// column-major matrix, the solver will actually solve A^T x = b.
//

extern Eigen::MatrixXd init_vertices;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no extern, this is not part of the api

#include "Teuchos_CommandLineProcessor.hpp"
#include "Epetra_Map.h"
#include "Epetra_Vector.h"
#include "Epetra_CrsMatrix.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need all these includes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are all pointers, we could forward declare

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants