Adaptmesh chaging boundary labels

Hello everyone,

I have a mesh resulting from adaptmesh function, now, I’m trying to use this mesh to solve a new problem, however, my problem has neumann and non homogeneous dirichlet boundary conditions and the solution is coming out wrong, is there a way to use adaptmesh but keep the boundary labels?

For exemple, this is my initial mesh

real x0 = 0.;
real x1 = 1200;
real y0 = 0;
real y1 = 2200;

int globalH = 2^3;
mesh calP = square(globalH,globalH);

since I’m using square, the boundary labels are 1, 2, 3 and 4, I would like to keep this labels in the adapted mesh.

I’m using this function:

ReMeshIndicator(calP, Etah, V0, etaTot[], 1, nDoFu0);

as specified in the documentation section 5.1.9 Adaptation using residual error indicator.

I think you might be having a different problem… adaptmesh shouldn’t change your boundary labels.

Interesting…
because I have another example and the only thing that changes is the boundary condition, I though it might have something to do with it.

Thanks though!

I’m imposing a global boundary condition like this:

varf muhgbndDir(unused,muh) = int1d(calP, 1)((1.*muh)) + int1d(calP, 3)((0.*muh));

and then, when I look at the solution, it seems that for these specific corner elements, it doesn’t work and I have no idea why, beacause the other side is basically the same

its unclear to me what you are trying to do. Your BC on boundary 3 is not doing anything since it is multiplied by 0. Did you mean to use the on() function?

either way, is the same problem
the boundary condition on boundary 3 is suposed to do nothing, is there just in case I wanted to change examples
but my problem is for the condition on boundary 1, it seems that it’s not working on that last element

What are you imposing on boundary 2?