# Plotting MeshL solutions,

I had a hard time figuring out how to do 1D plots in ff so I decided to
make that an early addition to datascope.
The plugin and edp are inhere,
ff_dscope_line.zip (23.7 KB)
the code is a mess and the example not “minimal” but it illustrates the issue
of an indefinite number of fespace solutions overplotted on each other.

Datascope produced this primitive but useful output,

I did note during coding you guys made some clever use of numeric types
and I had a hard time using “unsigned int” for an index.
In any case, I think I can clean this up and get done what I wanted in
1D and make it easy to monitor stuff now.

Is there some existing was to do 1D “oscilloscope” mode in ff 1D?
Thanks.

``````cat  load3line.edp

int nx=10;
int nx2=22;
int[int] lbe=[100,200]; // begin and end point labels
meshL Th1=Sline(nx, [1.0*x],label=lbe);
meshL Th2=Sline(nx2, [.5+ .25*(x-.5)],label=lbe);
fespace Vh1(Th1,P1);
fespace Vh2(Th2,P1);
Vh1 u1x=x;
Vh1 u1=(x>.5)?1:0;
Vh2 u2x=x;
Vh2 u2;
matrix A=interpolate(Vh2,Vh1);
u2[]=A*u1[];
cout<<u1x[]<<endl;
cout<<u1[]<<endl;
cout<<" u2 "<<endl;
cout<<u2x[]<<endl;
cout<<u2[]<<endl;
// program will die before the que is sent lol.
Vh1 a,b,c,d;
for(int ff=0; ff<100; ++ff)
{
real cc=1.0*ff/100.0;
for(int i=0; i<a[].n;  ++i)
{
real x=4.0*i/a[].n;
a[][i]=cc*sin(x);
b[][i]=cc*sin(x*x);
c[][i]=cc*cos(x*x*x);
d[][i]=cc*cos(x*x*x*x);
} //i
mjmdscopeL(Th1,"somestirng ",a,b,c,d); // warning  do not forget ()

} // ff

``````