findBoundaryConditions
Find boundary condition assignment for a geometric region
Description
returns boundary condition BCregion
= findBoundaryConditions(BCs
,RegionType
,RegionID
)BCregion
assigned to the specified
region.
Examples
Find Boundary Conditions for Particular Regions
Create a PDE model and import a simple block geometry. Plot the geometry displaying the face labels.
model = createpde(3); importGeometry(model,"Block.stl"); pdegplot(model,"FaceLabels","on","FaceAlpha",0.5)
Set zero Dirichlet conditions on faces 1 and 2 for all equations.
applyBoundaryCondition(model,"dirichlet","Face",1:2,"u",[0,0,0]);
On face 3, set the Neumann boundary condition for equation 1 and Dirichlet boundary condition for equations 2 and 3.
h = [0 0 0;0 1 0;0 0 1]; r = [0;3;3]; q = [1 0 0;0 0 0;0 0 0]; g = [10;0;0]; applyBoundaryCondition(model,"mixed","Face",3,"h",h,"r",r,"g",g,"q",q);
Set Neumann boundary conditions with opposite signs on faces 5 and 6 for all equations.
applyBoundaryCondition(model,"neumann","Face",4:5,"g",[1;1;1]); applyBoundaryCondition(model,"neumann","Face",6,"g",[-1;-1;-1]);
Check the boundary condition specification on face 1.
findBoundaryConditions(model.BoundaryConditions,"Face",1)
ans = BoundaryCondition with properties: BCType: 'dirichlet' RegionType: 'Face' RegionID: [1 2] r: [] h: [] g: [] q: [] u: [0 0 0] EquationIndex: [] Vectorized: 'off'
Check the boundary condition specification on face 3.
findBoundaryConditions(model.BoundaryConditions,"Face",3)
ans = BoundaryCondition with properties: BCType: 'mixed' RegionType: 'Face' RegionID: 3 r: [3x1 double] h: [3x3 double] g: [3x1 double] q: [3x3 double] u: [] EquationIndex: [] Vectorized: 'off'
Check the boundary condition specification on face 5.
findBoundaryConditions(model.BoundaryConditions,"Face",5)
ans = BoundaryCondition with properties: BCType: 'neumann' RegionType: 'Face' RegionID: [4 5] r: [] h: [] g: [3x1 double] q: [] u: [] EquationIndex: [] Vectorized: 'off'
Input Arguments
BCs
— Boundary conditions of a PDE model
BoundaryConditions
property of a PDE model
Boundary conditions of a PDE model, specified as the
BoundaryConditions
property of
PDEModel
.
Example: model.BoundaryConditions
RegionType
— Geometric region type
"Face"
for 3-D geometry | "Edge"
for 2-D geometry
Geometric region type, specified as "Face"
for 3-D
geometry or "Edge"
for 2-D geometry.
Example: findBoundaryConditions(model.BoundaryConditions,"Face",3)
Data Types: char
| string
RegionID
— Geometric region ID
vector of positive integers
Geometric region ID, specified as a vector of positive integers. Find the
region IDs by using pdegplot
with the
"FaceLabels"
(3-D) or "EdgeLabels"
(2-D) value set to "on"
.
Example: findBoundaryConditions(model.BoundaryConditions,"Face",3)
Data Types: double
Output Arguments
BCregion
— Boundary condition for a particular region
BoundaryCondition
object
Boundary condition for a particular region, returned as a
BoundaryCondition
object.
Version History
Introduced in R2016b
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)