Strange behaviour of pde-toolbox in labeling or a bug?

1 回表示 (過去 30 日間)
Mohammad Monfared
Mohammad Monfared 2013 年 10 月 18 日
コメント済み: Mohammad Monfared 2013 年 10 月 21 日
Hi, I'm new to pde-toolbox but this is kinda weird to me:
let's draw some rectangles in PDE Tollbox like:
but when I export Geometry Description and ... from Draw menu to matlab workspace and then decompose them using:
[g,bt] = decsg(gd,sf,ns) ;
plotting the resulted geometry by:
pdegplot(g)
this is what I get:
as could be seen, labels are randomly changed! any idea of what is happening here?
I'm using Matlab R2012b.

採用された回答

Bill Greene
Bill Greene 2013 年 10 月 18 日
Hi,
Your geometry is unusual in that none of the rectangles intersect each other. The algorithm in function decsg is designed to generally compute the intersections among the input entities and produce a completely new set of regions that are only related to the input entities. Generally, the number of output entities does not match the number of input entities and, as you have discovered, decsg assigns region numbers to these output entities in a way that is not easy to predict.
Bill
  2 件のコメント
Mohammad Monfared
Mohammad Monfared 2013 年 10 月 18 日
Thanks for your response Bill,
As a matter of fact the domain of my problem consists of many rectangular sub-domains which their side borders coincide with the neighboring sub-domains. Constructing 'c' and 'a' matrices, I need to know each sub-domain number to assign the correct values. For example for sub-domain 'R6' I have a sub-domain-number related function, 'F6' to assign.
So how can I access to the predefined(unchanged) sub-domain names(/numbers)? (as I know a common way is to use the 4th row of matrix 't' from 'initmesh' outputs, right?)
Mohammad Monfared
Mohammad Monfared 2013 年 10 月 18 日
the problem domain and their changed sub-domain labels:

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

その他の回答 (1 件)

Bill Greene
Bill Greene 2013 年 10 月 19 日
Hi,
The way I have dealt with the problem of defining coefficient matrices when I have had geometries similar to yours is to simply ignore the sub-domain numbers. I write a function to define the coefficient as shown in this doc page:
This page also shows how you can compute the centroid of each triangle inside this function. Then you simply assign coefficient values based on this location. In your case you can use the x-coordinate to determine which rectangle the element is in.
Hope that helps.
Bill
  3 件のコメント
Bill Greene
Bill Greene 2013 年 10 月 20 日
Without knowing the physics of your problem, I can't really say much definitive. It is not uncommon to have a single scalar equation for u and a "c" coefficient that has different terms in the x and y directions to reflect different properties in those directions. But, for a single PDE, the "a" coefficient is also a scalar. If you have more than one value for "a", I would guess you are missing an equation. That would mean u is a vector with two components.
Bill
Mohammad Monfared
Mohammad Monfared 2013 年 10 月 21 日
編集済み: Mohammad Monfared 2013 年 10 月 21 日
This is the equation of my interest actually:
the water flow equation in a porous media. Domain is in x-z plane.
How can I model it by Pde toolbox?
thanks,
Mohammad

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by