Giter Site home page Giter Site logo

Comments (5)

cglwdm avatar cglwdm commented on June 12, 2024 1

It is global, but you can use IdentityInterpolator ector H1 into the RT space.

This is done for example in the construction of AMS which needs the similar Nedelec interpolant Π from vector H1 into the NS space as a matrix, see https://github.com/mfem/mfem/blob/master/linalg/hypre.cpp#L5614

Thank you for your help! So IdentityInterpolator and ParDiscreteLinearOperator can define a Matrix from H1 space to RT space, is it correct?
The above Pi can be calculate locally, since (18) ensures that pi v\in H(div) spaces when v\in H1. I think the above pi can also be obtained in the help of MFEM locally. Since I'm investigating the postprocessing methods in the HDG branch of MFEM, where a postprocessing method is proposed and implemented element by element. We can solve (18) and (19) element by element for any given v\in [H^1(\Omega)]^d.

from mfem.

tzanio avatar tzanio commented on June 12, 2024

It is global, but you can use IdentityInterpolator ector H1 into the RT space.

This is done for example in the construction of AMS which needs the similar Nedelec interpolant $\Pi$ from vector H1 into the NS space as a matrix, see https://github.com/mfem/mfem/blob/master/linalg/hypre.cpp#L5614

from mfem.

cglwdm avatar cglwdm commented on June 12, 2024

The below is the RTk projection written by my own code, I will try it in MFEM to implement the similar code.

int RTkprojection(
    MESH &Mesh,
    int degreeVecSigmah,
    Matrix<dataType, 2, 1>(*VecSigma)(const MESH &Mesh, int p_k, int id, int i, int i_face, int i_edge, dataType x, dataType y),
    dataType(*curl_VecSigma)(const MESH &Mesh, int p_k, int id, int i, int i_face, int i_edge, dataType x, dataType y),
    Matrix<dataType, Dynamic, 1> &coeffVecSigmah)
{
    int freedomVecSigmah = FREEDOM_RTK[degreeVecSigmah];
    coeffVecSigmah.resize(Mesh.getNumElement() * freedomVecSigmah);
    printf("Matrix ");
    fflush(stdout);

#pragma omp parallel for 
    for (int id = 0; id < Mesh.num_Element; id++) {
        int m_k = degreeVecSigmah;
        Matrix<dataType, Dynamic, 1> Fl(freedomVecSigmah);
        Matrix<dataType, Dynamic, Dynamic> Al(freedomVecSigmah, freedomVecSigmah);
        Fl.setZero();
        Al.setZero();

        for (int i = 0; i < 3 * (m_k + 1); i++) {
            int face_k = i / (m_k + 1);
            int face_i = i;
            for (int j = 0; j < FREEDOM_RTK[m_k]; j++) {

                Al(i, j) = qf5pE(Mesh, local_RTk, normalVecPkEdge, 1.0, m_k, m_k, id, j, face_i, face_k, face_k, 0, 0, face_k);
            }
            Fl(i) +=
                qf5pE(Mesh, VecSigma, normalVecPkEdge, 1.0, m_k, m_k, id, face_i, face_i, face_k, face_k, 0, 0, face_k);
        }
        if (m_k >= 1) {
            for (int i = 0; i < FREEDOM_VECTORPK[m_k - 1]; i++) {
                for (int j = 0; j < FREEDOM_RTK[m_k]; j++) {
                    Al(i + 3 * (m_k + 1), j) = qf25pT(Mesh, vectorPk, local_RTk, 1.0, m_k - 1, m_k, id, i, j);
                }
                Fl(i + 3 * (m_k + 1)) = qf25pT(Mesh, vectorPk, VecSigma, 1.0, m_k - 1, m_k, id, i, i);
            }
        }
        coeffVecSigmah.segment(id * freedomVecSigmah, freedomVecSigmah) = Al.inverse() * Fl;
    }

    return Mesh.getNumElement() * freedomVecSigmah;

}

from mfem.

cglwdm avatar cglwdm commented on June 12, 2024

I have implemented the above RT projection, may I will pull a request to add this new RT projection.

from mfem.

tzanio avatar tzanio commented on June 12, 2024

Yes, please feel free to open a PR

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.