geometryFromEdges
Create 2-D geometry from decomposed geometry matrix
Description
Examples
Create a decomposed solid geometry model representing a rectangle and include it in a PDE model.
Create a default scalar PDE model.
model = createpde;
Define a geometry representing a rectangle.
R1 = [3,4,-1,1,1,-1,0.5,0.5,-0.75,-0.75]';
Decompose the geometry into minimal regions.
g = decsg(R1);
Create the geometry from the decomposed geometry matrix.
geometryFromEdges(model,g);
Plot the geometry.
pdegplot(model,EdgeLabels="on") axis equal xlim([-1.1,1.1]) ylim([-0.9,0.6])

Create a decomposed solid geometry model and include it in a PDE model.
Create a default scalar PDE model.
model = createpde;
Define a circle in a rectangle, place these in one matrix, and create a set formula that subtracts the circle from the rectangle.
R1 = [3,4,-1,1,1,-1,0.5,0.5,-0.75,-0.75]';
C1 = [1,0.5,-0.25,0.25]';
C1 = [C1;zeros(length(R1) - length(C1),1)];
gm = [R1,C1];
sf = 'R1-C1';Create the geometry.
ns = char('R1','C1'); ns = ns'; g = decsg(gm,sf,ns);
Include the geometry in the model and plot it.
geometryFromEdges(model,g); pdegplot(model,EdgeLabels="on") axis equal xlim([-1.1,1.1])

The toolbox provides the several geometry functions. Specify them by using the following function handles.
model = createpde; g = geometryFromEdges(model,@cardg); pdegplot(model)

clear model
model = createpde;
g = geometryFromEdges(model,@circleg);
pdegplot(model)
clear model
model = createpde;
g = geometryFromEdges(model,@cirsg);
pdegplot(model)
clear model
model = createpde;
g = geometryFromEdges(model,@crackg);
pdegplot(model)
clear model
model = createpde;
g = geometryFromEdges(model,@lshapeg);
pdegplot(model)
clear model
model = createpde;
g = geometryFromEdges(model,@scatterg);
pdegplot(model)
clear model
model = createpde;
g = geometryFromEdges(model,@squareg);
pdegplot(model)
Input Arguments
Model container, specified as a PDEModel object.
Example: model = createpde(3)
Geometry description, specified as a decomposed geometry matrix, as the
name of a geometry function, or as a handle to a geometry function. For
details about a decomposed geometry matrix, see decsg.
A geometry function must return the same result for the same input arguments in every function call. Thus, it must not contain functions and expressions designed to return a variety of results, such as random number generators.
Example: geometryFromEdges(model,@circleg)
Data Types: double | char | function_handle
Output Arguments
Geometry object, returned as an AnalyticGeometry object. This
object is stored in model.Geometry.
Version History
Introduced in R2015ageometryFromEdges will no longer accept
StructuralModel, ThermalModel, and
ElectromagneticModel. These objects will be removed. To
create a geometry for structural, thermal, or electromagnetic analysis, use femodel or
fegeometry.
geometryFromEdges will continue accepting
PDEModel.
The unified finite element model workflow defines the type of a problem and all of
its parameters as the properties of an femodel object. This
object enables you to specify physical parameters for structural, thermal, and
electromagnetic types of analyses. The solver in the unified workflow uses only the
parameters (properties) appropriate for the current analysis type while ignoring all
other properties. If you switch the analysis type by setting the
AnalysisType property of the model, the solver uses the
appropriate set of properties corresponding to the new analysis type.
For more help migrating your existing code that uses
StructuralModel, ThermalModel, or
ElectromagneticModel to the unified finite element workflow,
see Migration from Domain-Specific to Unified Workflow.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)