# Computing Raviart Thomas function

**URL:** <https://community.freefem.org/t/computing-raviart-thomas-function/2574>\
**Category:** General Discussion\
**Created:** [July 2, 2023, 3:17pm UTC](https://community.freefem.org/t/computing-raviart-thomas-function/2574 "2023-07-02T15:17:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![larismartins](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/larismartins/32/2712_2.png) [@larismartins](https://community.freefem.org/u/larismartins)\
**Post date:** [July 2, 2023, 3:17pm UTC](https://community.freefem.org/t/computing-raviart-thomas-function/2574/1 "2023-07-02T15:17:02Z")

</div>

Hi guys, can someone help me? I’m having a hard time computing the following set of equations:  
 ![Screenshot from 2023-07-02 12-13-48](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/e/ec4e963a0591038a767d9f7ca67b39e6f61fc9fc.png)

This is the mesh I’m working with:

 ![Screenshot from 2023-07-02 12-13-09](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/4/46daad6b9210bd16c6567ebe52b4dcf0fce7b24c.png)

I need to compute the normal component of sigma on all egdes, I tried doing like:

```auto
func RT = RT0;
func PPme = P0edge;

fespace RTm(Th[K], RT);
RTm [sigmaHx, sigmaHy];
    
fespace PPm(Th[K], PPme);
PPm q;

matrix mCk1;

    varf chk1([sigmaHx, sigmaHy], [q])
      = intalledges(Th[K])((sigmaHx*N.x + sigmaHy*N.y)*q);
  
    mCk1 = chk1(RTm, PPm);
    cout << mCk1 << "\n";

```

but it does not seem to work on internal edges

for the RHS, I tried something like:

```auto
VhKaux AgraduHhX = kappa*dx(auxuHhK);
VhKaux AgraduHhY = kappa*dy(auxuHhK);
    varf lhK([vsolx, vsoly], [q])
      = intalledges(Th[K])((1-nTonEdge)*(mean(AgraduHhX)*N.x + mean(AgraduHhY)*N.y)*q);

    real[int] vlhK = lhK(0, PPm);
    // cout << vlhK << "\n";

    real[int] vbl(ndofPPm);
    for(int e=0; e<edgeLabel.n; e++){
      varf blk(muHk,q)
      = int1d(Th[K], edgeLabel[e])(edgeSignG(K,e)*lambdaH*q);

      real[int] vblaux = blk(0,PPm);
      vbl = vbl + vblaux;
      // cout << vblaux << "\n";
    }
    // cout << vbl << "\n";

```

does anyone have any idea if this is right?
