Giter Club home page Giter Club logo

Comments (4)

tzanio avatar tzanio commented on May 20, 2024

Hi Mikhail,

Can you provide more details about your use case?

Of the two options you are proposing, I think the second one is better, because it will also enable the use of FormLinearSystem(), at least in some case.

Cheers,
Tzanio

from mfem.

martemyev avatar martemyev commented on May 20, 2024

Hi Tzanio,

My goal is to compute a dense matrix D = W^T * S * W, where S is a full matrix of a bilinear form, and W is a dense matrix each column X_i of which is a solution of the equation S*X_i = 0, where i corresponds to a boundary degree of freedom, i.e. W = DenseMatrix(fespace.GetVSize(), n_bdr_dofs). To solve many equations S*X_i = 0 I use the FormLinearSystem function, which creates mat_e, eliminates rows and columns corresponding to boundary dofs, and finalizes the matrix, so when I compute D using D = RAP(S, W);, the S matrix is not full, and I need it to be without boundary conditions applied.

What I do right now is - I compute S two times: first time - to compute W, and the second time - to compute D. That works fine, but I'm wondering if I can do it more efficiently.

Thanks,
Mikhail

from mfem.

tzanio avatar tzanio commented on May 20, 2024

Hi Mikhail,

If I understand correctly, D is the Schur complement with respect to the boundary? The action of D can probably be computed more efficiently than solving the many systems, but if you need the actual dense matrix itself, than I what you are doing is certainly a valid approach.

If you want to restore the full matrix, you probably want to call

SparseMatrix * Add(const SparseMatrix & A, const SparseMatrix & B);

though depending on the sizes, this may not be more efficient than reassembly.

Hope this helps,
Tzanio

from mfem.

martemyev avatar martemyev commented on May 20, 2024

Hi Tzanio,

Thank you for the reply. I do need the dense matrix W itself, so I need to construct it explicitly. I'm going to follow your advice on the computation of the full matrix using Add() function, therefore I created a pull request to get an access to the mat_e matrix.

Thank you,
Mikhail

from mfem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.