Main Content

findElectromagneticBC

Find electromagnetic boundary conditions assigned to geometric region

    Description

    example

    emBC = findElectromagneticBC(emagmodel.BoundaryConditions,RegionType,RegionID) returns the voltage or magnetic potential assigned to the specified region of the specified model.

    Examples

    collapse all

    Create an electromagnetic model for a magnetostatic analysis.

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

    Include the 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. The axes 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 edge 1 and 2.

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

    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'.

    Data Types: char | string

    Edge ID, specified as a vector of positive integers. Find edge IDs by using pdegplot with the 'EdgeLabels' 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.

    Introduced in R2021a