# RT0Ortho FE on surface mesh

**URL:** <https://community.freefem.org/t/rt0ortho-fe-on-surface-mesh/4008>\
**Category:** General Discussion\
**Created:** [July 18, 2025, 8:06am UTC](https://community.freefem.org/t/rt0ortho-fe-on-surface-mesh/4008 "2025-07-18T08:06:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![YYy](https://avatars.discourse-cdn.com/v4/letter/y/ebca7d/32.png) [@YYy](https://community.freefem.org/u/YYy)\
**Post date:** [July 18, 2025, 8:06am UTC](https://community.freefem.org/t/rt0ortho-fe-on-surface-mesh/4008/1 "2025-07-18T08:06:11Z")

</div>

Hi everyone,  
I’m trying to use RT0Ortho on a surface mesh (meshS ThL), but it doesn’t seem to work. The interpolation matrix fails to build. Below are my code:

load “msh3”  
load “medit”  
load “Element\_Mixte3d”  
mesh3 Th = cube(2,2,2, [x,y,z]);  
// plot(Th, wait=true);  
func Pk = Edge03d;  
fespace Vh(Th, Pk);

meshS ThL;  
{  
int[int] labels=labels(Th);  
// cout \<\< "labels of Th = " \<\< labels \<\< endl;  
int[int] trueLabels;  
for(int i = 0; i \< labels.n; ++i) {  
if(labels[i] \>=0) {  
trueLabels.resize(trueLabels.n+1);  
trueLabels[trueLabels.n-1] = labels[i];  
}  
}  
// cout \<\< "trueLabels = " \<\< trueLabels \<\< endl;  
ThL = extract(Th,label=trueLabels);  
ThL = trunc(ThL,region==1);  
}

// plot(ThL, wait=true);  
func PkS = [RT0Ortho];  
fespace VhSl(ThL, PkS);  
matrix RVtoSl = interpolate(VhSl, Vh);

error messages:  
sorry no cast to this surface finite element 0x1052cdf48  
current line = 27  
Exec error : sorry no cast to this surface finite element  
– number :1  
Exec error : sorry no cast to this surface finite element  
– number :1  
err code 8 , mpirank 0

Do you have any suggestions or solutions? Thank you
