include "test.idp" real t; int nx = 10; int ny = 10; mesh Th1 = square(nx, ny); int nt = Th1.nt; int[int] R = [0, 1]; int[int] L = [1, 0]; t = clock(); mesh Thnew = change(Th1, region=R); t = clock() - t; cout << timeELAPSED << t << endl; test(Thnew[0].region == 1); test(Thnew[1].region == 1); t = clock(); Thnew = change(Th1, label=L); t = clock() - t; cout << timeELAPSED << t << endl; test(Thnew[0].label == 0); test(Thnew[1].label == 0); func int flabelfunc() { return ((x == 0) + (x == 1)); } t = clock(); Thnew = change(Th1, flabel=flabelfunc()); t = clock() - t; cout << timeELAPSED << t << endl; int number1 = Thnew(0, 0.5).nuTriangle; test(Thnew[number1].label == 0); int number2 = Thnew(0.5, 0).nuTriangle; test(Thnew[number2].label == 0); int number3 = Thnew(0, 0).nuTriangle; test(Thnew[number3].label == 0); int number4 = Thnew(0.5, 0.5).nuTriangle; test(Thnew[number4].label == 0); func int fregionfunc() { return (1); } t = clock(); Thnew = change(Thnew, fregion=fregionfunc()); t = clock() - t; cout << timeELAPSED << t << endl; int number5 = Thnew(0, 0).nuTriangle; plot(Thnew); test(Thnew[number5].label == 1); func int fregionfunc2() { return (100); } t = clock(); Thnew = change(Thnew, fregion=fregionfunc2()); t = clock() - t; cout << timeELAPSED << t << endl; int number6 = Thnew(0, 0).nuTriangle; plot(Thnew); test(Thnew[number6].label == 100);