rafavzqz / geopdes

GeoPDEs: Isogeometric Analysis in Octave and Matlab, for research and teaching purposes.
http://rafavzqz.github.io/geopdes
101 stars 48 forks source link

Request #2

Closed AzerH66 closed 5 years ago

AzerH66 commented 5 years ago

Hi I solved Laplace equation on a unit square using GeoPDE, the source term is chosen such that the exact solution is given by u(x, y) = atan(25(x - y)). After ten steps of refinement, the final mesh is given as follows: mesh It should be noted that the solution has a singularity in the diagonal of the domain but the calculated mesh does not show explicitly the singularity. Would you mind explaining what the problem is?

Best Regards Hamid

rafavzqz commented 5 years ago

Dear Hamid, I have just tried the same problem, and I get a diagonal refinement. Please, check that you are using the correct data for your problem. This is the one I have used:

problem_data.f = @(x, y) (50 1250(x - y))./((25(x - y)).^2 + 1).^2; problem_data.h = @(x, y, ind) atan (25(x-y)); problem_data.uex = @(x, y) atan (25(x-y)); problem_data.graduex = @(x, y) cat(1, ... reshape ( 25./((25(x-y)).^2 + 1), [1, size(x)]), ... reshape (-25./((25*(x-y)).^2 + 1), [1, size(x)]));

If the issue remains, please send me also the other parameters of your discretization (method_data and adaptivity_data), and the version of GeoPDES you are using, so that I can reproduce your problem.

Best, Rafa

AzerH66 commented 5 years ago

Dear Rafa I thank you for your help. I used the following data and I could get diagonal refinement.

% Source and boundary terms problem_data.f = @(x,y)2(25(1250x - 1250y))./((25x - 25y).^2 + 1).^2; problem_data.h = @(x, y,ind) atan(25(x-y)); % Exact solution (optional) problem_data.uex = @(x, y) atan(25(x-y)); problem_data.graduex = @(x,y) cat (1, ... reshape ( 25./((25x - 25y).^2 + 1), [1, size(x)]), ... reshape ( -25./((25x - 25y).^2 + 1), [1, size(x)]));

Explicitly speaking, I implemented a refinement/coarsening algorithm based on truncation mechanism and I used the same example in your paper. The proposed algorithm can be extended to other sequences of nested spaces and it is also efficient using degree elevation. Moreover, it can be combined with Bezier extraction operator. I presented the results of three steps of coarsening as follows: image

In fact, I decided to compare the performance of the code with the one you proposed but I could not find any coarsening code in GeoPDES. Would you mind providing me your open source coarsening code?

Best Regards Hamid

rafavzqz commented 5 years ago

Dear Hamid, I am sorry, but the coarsening implementation has not been released yet. I am planning to do that next Spring. In the meantime, you can check the coarsening algorithms we use, and maybe implement them yourself, in this paper. https://www.mdpi.com/2075-1680/7/3/43

Your results look good. Let me know if you write a paper/report with the details, I would like to check it.

Best regards, Rafa