How squareg works ?

13 ビュー (過去 30 日間)
Pavel M
Pavel M 2019 年 6 月 5 日
編集済み: Ravi Kumar 2019 年 6 月 6 日
I want to create a model by geometryFromEdges(model,@squareg) but i need other sizes of square. @squareg creates 1x1, but i want 0.6x0.6.
Could anybody help me understand what i need to change in squareg. I look code by using
type squareg
I know that any square is created in PDE TOOLbox and exported in workspace and i can use
geometryFromEdges(model,g)
but then i created mesh by
generateMesh(model,'Hmax',0.05,'GeometricOrder','Linear');
and that mesh is less, and even if i decrease Hmax, i get more unstable solutions of PDE in comparison if i used geometryFromEdges(model,@squareg) and then created mesh.

採用された回答

Ravi Kumar
Ravi Kumar 2019 年 6 月 6 日
編集済み: Ravi Kumar 2019 年 6 月 6 日
Hi Pavel,
I don't fully understand your question, but I can answer a portion on how to create square of different size. You can use decsg to create geometry using coordinate information.
Here is a small example for creating square with 0.6 as edge length.
% Coordinates
lowerLeft = [0 ,0 ];
lowerRight = [0.6 , 0 ];
upperRight = [0.6 , 0.6];
upperLeft = [0.0 , 0.6];
% Geometry matrix
S = [3,4 lowerLeft(1), lowerRight(1), upperRight(1), upperLeft(1), ...
lowerLeft(2), lowerRight(2), upperRight(2), upperLeft(2)];
gdm = S';
% Names
ns = 'S';
% Set formula
sf = 'S';
% Invoke decsg
g = decsg(gdm,ns,sf');
% Import g into model using geometryFromEdges.
model = createpde;
geometryFromEdges(model,g);
pdegplot(model,'EdgeLabel','on');
Regards,
Ravi
  1 件のコメント
Pavel M
Pavel M 2019 年 6 月 6 日
Hi Ravi, thank you for your help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by