# Location Matrix with vectorial space

**URL:** <https://community.freefem.org/t/location-matrix-with-vectorial-space/3572>\
**Category:** General Discussion\
**Created:** [November 4, 2024, 1:58pm UTC](https://community.freefem.org/t/location-matrix-with-vectorial-space/3572 "2024-11-04T13:58:53Z")\
**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:** [November 4, 2024, 1:58pm UTC](https://community.freefem.org/t/location-matrix-with-vectorial-space/3572/1 "2024-11-04T13:58:53Z")

</div>

Hello,

I’m trying to build a location matrix for a FE vectorial space. Am I doing it right like this?

```auto
fespace LambdaH(calP, [Pm, Pm]);
LambdaH [l10, l20];
LambdaH [l1X, l2X] = [x,x], [l1Y, l2Y] = [y,y];

int nDoFl0 = LambdaH.ndof;
int nDoFl0K = LambdaH.ndofK;

// cout << nDoFl0 << "\n";
// cout << nDoFl0K << "\n";

real[int,int] coordbL(nDoFl0,2);
for(int i=0; i<nDoFl0; i++){
    coordbL(i,0) = l1X[][i];
    coordbL(i,1) = l1Y[][i];
}
// cout << coordbL << "\n";

//-------------------------------------LM matrix
int[int,int] locationMatrix(NbTriangles,nDoFl0K);
for(int k=0; k < NbTriangles; k++){
    for(int i=0;i<nDoFl0K;i++){
        locationMatrix(k,i) = LambdaH(k,i);
    }
}
// cout << "LM array Lambda0" << "\n"; 
// cout << locationMatrix << "\n";

```
