Hello,
I’m working on a problem where I have to redefine the mesh and its fespace asociated. Right now I’m rebuilding everything at every step and it works. As you may deduce this is not efficient so I would like to use a criteria in order to redefine or not at that time step. I did get into sintax problems when i try to redefine the mesh and its fespace, I wrote a simple code to show the problem. If i use something like this:
for(int i=0; i<2; i++){
mesh Th = square(10*(i+1), 10*(i+1));
fespace Vh(Th,P1);
}
It works as espected but if I do:
mesh Th = square(10,10);
fespace Vh(Th,P1);
mesh Th = square(20,20);
fespace Vh(Th,P1);
I get syntax error. I’m not sure why this happens because it should be the same code.
Is there a way to delete a existing mesh and fespace so I can name a new one with the same name? I think i could get over this problem wiht that.
Thanks,