Main Content

findElectromagneticBC

(To be removed) Find electromagnetic boundary conditions assigned to geometric region

Since R2021a

    findElectromagneticBC will be removed. Use the FaceBC and EdgeBC properties property of femodel instead. (since R2023a) For more information on updating your code, see Version History.

    Description

    emBC = findElectromagneticBC(boundaryConditions,RegionType,RegionID) returns the boundary conditions assigned to the specified region of the specified model.

    example

    Examples

    collapse all

    Create an electromagnetic model for magnetostatic analysis.

    emagmodel = createpde("electromagnetic","magnetostatic");

    Include an L-shaped membrane geometry in the model and plot it with the face labels.

    geometryFromEdges(emagmodel,@lshapeg);
    pdegplot(emagmodel,"FaceLabels","on")
    ylim([-1.1 1.1])
    axis equal

    Figure contains an axes object. The axes object contains 4 objects of type line, text.

    Assign magnetic potential values to edges 1 and 2.

    electromagneticBC(emagmodel,"Edge",1,"MagneticPotential",1);
    electromagneticBC(emagmodel,"Edge",2,"MagneticPotential",0);

    Check the boundary condition specifications for edges 1 and 2.

    emBC = findElectromagneticBC(emagmodel.BoundaryConditions,"Edge",1:2);
    emBC(1)
    ans = 
      ElectromagneticBCAssignment with properties:
    
                 RegionID: 1
               RegionType: 'Edge'
               Vectorized: 'off'
               InternalBC: []
        MagneticPotential: 1
    
    
    emBC(2)
    ans = 
      ElectromagneticBCAssignment with properties:
    
                 RegionID: 2
               RegionType: 'Edge'
               Vectorized: 'off'
               InternalBC: []
        MagneticPotential: 0
    
    

    Input Arguments

    collapse all

    Boundary conditions of an electromagnetic model, specified as the BoundaryConditions property of the model.

    Example: findElectromagneticBC(emagmodel.BoundaryConditions,"Edge",1)

    Geometric region type, specified as "Edge" for a 2-D model or "Face" for a 3-D model.

    Data Types: char | string

    Region ID, specified as a vector of positive integers. Find the edge or face IDs by using pdegplot with the "EdgeLabels" or "FaceLabels" name-value argument set to "on".

    Data Types: double

    Output Arguments

    collapse all

    Electromagnetic boundary condition assignment, returned as an ElectromagneticBCAssignment object. For more information, see ElectromagneticBCAssignment Properties.

    Version History

    Introduced in R2021a

    collapse all