Interface Model

    • Method Detail

      • app

        com.comsol.api.AppModel app()
        Returns the runtime application API object.
        Returns:
        The runtime application API object.
      • baseSystem

        Model baseSystem​(java.lang.String name)
        Sets the base unit system.
        Specified by:
        baseSystem in interface AbstractModel
        Parameters:
        name - Name of base unit system: : SI, bft, cgs,mpa, emu, esu, fps, ips, or psi.
        Returns:
        Modified model.
      • batch

        BatchList batch()
        Returns all batch jobs.
        Returns:
        List of batch jobs.
      • batch

        BatchFeature batch​(java.lang.String tag)
        Returns a batch job.
        Parameters:
        tag - Batch job tag.
        Returns:
        Batch job.
      • bem

        BEMFeatureList bem()
        Returns all boundary elements.
        Returns:
        List of boundary elements.
      • bem

        BEMFeature bem​(java.lang.String tag)
        Return a boundary element.
        Parameters:
        tag - Boundary element tag.
        Returns:
        Boundary element.
      • clearThumbnail

        void clearThumbnail()
        Clears the model thumbnail.
      • coeff

        CoeffList coeff()
        Returns all coefficient form equations.
        Returns:
        List of coefficient form equations.
      • coeff

        Coeff coeff​(java.lang.String tag)
        Returns coefficient form equations.
        Parameters:
        tag - Coefficient form equations tag.
        Returns:
        Coefficient form equations.
      • colorTheme

        java.lang.String colorTheme()
        Returns the color theme used in graphics. "automatic" indicates that the theme specified in the preferences is used.
        Returns:
        Color theme.
      • colorTheme

        void colorTheme​(java.lang.String theme)
        Sets the color theme to be used in graphics. "automatic" indicates that the theme specified in the preferences will be used. Available color themes are stored in the data/color folder in the COMSOL installation folder.
        Parameters:
        theme - The color theme to use.
      • component

        ModelNodeList component()
        Returns all model components.
        Returns:
        List of model components.
      • component

        ModelNode component​(java.lang.String tag)
        Returns a model component.
        Parameters:
        tag - Model component tag.
        Returns:
        Model component.
      • constr

        ConstrList constr()
        Returns all constraints.
        Returns:
        List of constraints.
      • constr

        Constr constr​(java.lang.String tag)
        Returns a constraint.
        Parameters:
        tag - Constraint tag.
        Returns:
        Constraint.
      • description

        java.lang.String description()
        Returns the model descriptiom.
        Returns:
        The model description.
      • description

        Model description​(java.lang.String description)
        Sets the model description.
        Parameters:
        description - New description.
        Returns:
        Model.
      • disableUpdates

        boolean disableUpdates()
        Returns the current state of the disabling of variable updates.
        See also: disableUpdates(boolean).
        Returns:
        The previous state of the update flag.
      • disableUpdates

        boolean disableUpdates​(boolean state)
        Temporarily disables and re-enables the update of variables in entities that automatically generates other entities. Leaving this flag disabled may cause strange side effects during modeling. For example, some parameter values may not be valid until an update has been made. The model inputs are such parameters, and they all end with the suffix _src. Trying to set a value to any of these parameters, may give an error message unless to activate the updates again. Other effects are that the generated variables are unknown to the unit evaluator, and equation view readings may be incomplete.
        When the disabled state goes from true to false, the program performs a full update of the variables.
        Parameters:
        state - If true the update will be disabled from now on.
        Returns:
        The previous state of the update flag.
      • elem

        ElemList elem()
        Returns all elements.
        Returns:
        List of elements.
      • elem

        Element elem​(java.lang.String tag)
        Returns an element.
        Parameters:
        tag - Element tag.
        Returns:
        Element.
      • elementSet

        ElementSetList elementSet()
        Returns all mesh element sets.
        Returns:
        List of mesh element sets.
      • elementSet

        ElementSet elementSet​(java.lang.String tag)
        Returns a mesh element set.
        Parameters:
        tag - Mesh element set tag.
        Returns:
        Mesh element set.
      • excludeComputedDataInDrafts

        boolean excludeComputedDataInDrafts()
        Whether to exclude built, computed, and plotted data in draft versions when saving to a database.
        Returns:
        Whether to exclude built, computed, and plotted data in draft versions when saving to a database.
      • excludeComputedDataInDrafts

        Model excludeComputedDataInDrafts​(boolean exclude)
        Sets whether to exclude built, computed, and plotted data when saving draft versions to a database.
        Parameters:
        exclude - Whether to exclude the data.
        Returns:
        Model.
      • excludeComputedDataInMph

        boolean excludeComputedDataInMph()
        Whether to exclude built, computed, and plotted data when saving to an mph file.
        Returns:
        Whether to exclude built, computed, and plotted data when saving to an mph file.
      • excludeComputedDataInMph

        Model excludeComputedDataInMph​(boolean exclude)
        Sets whether to exclude built, computed, and plotted data when saving to an mph file.
        Parameters:
        exclude - Whether to exclude the data.
        Returns:
        Model.
      • excludeComputedDataInRegular

        boolean excludeComputedDataInRegular()
        Whether to exclude built, computed, and plotted data in regular versions when saving to a database.
        Returns:
        Whether to exclude built, computed, and plotted data in regular versions when saving to a database.
      • excludeComputedDataInRegular

        Model excludeComputedDataInRegular​(boolean exclude)
        Sets whether to exclude built, computed, and plotted data when saving regular versions to a database.
        Parameters:
        exclude - Whether to exclude the data.
        Returns:
        Model.
      • externalInterface

        ExternalInterfaceFeatureList externalInterface()
        Returns all external interface features.
        Returns:
        List of external interface features.
      • externalInterface

        ExternalInterfaceFeature externalInterface​(java.lang.String tag)
        Returns an external interface feature.
        Parameters:
        tag - External interface feature tag.
        Returns:
        External interface feature.
      • field

        FieldList field()
        Returns all fields.
        Returns:
        List of fields.
      • field

        Field field​(java.lang.String tag)
        Returns a field.
        Parameters:
        tag - Field tag.
        Returns:
        Field.
      • file

        FileResourceList file()
        Returns a list of file entities referenced by model entities.
        Returns:
        List of file entities.
      • file

        FileResource file​(java.lang.String tag)
        Returns a file entity.
        Parameters:
        tag - File entity tag.
        Returns:
        File node.
      • fontFamily

        java.lang.String fontFamily()
        Returns the font family to be used in plots.
        Returns:
        Font family.
      • fontFamily

        void fontFamily​(java.lang.String family)
        Sets the font family to be used in plots. The font default is always available. If using Windows, most system fonts can also be used.
        Parameters:
        family - Font family. The built-in font 'default' is always available. If using Windows, most system fonts can also be used. The font 'automatic' stands for getting the font specified in preference setting of the actual running client.
      • fontSize

        int fontSize()
        Returns the font size used in plots.
        Returns:
        Font size.
      • fontSize

        void fontSize​(int size)
        Sets the font size to be used in plots.
        Parameters:
        size - Integer font size. If the returned font size is '-1', it means the font size is not fixed and will be fetched from the actual running client, which makes the font size in graphics window look similar to the one in GUI widgets even on different platforms. It is preferred to set to '-1' instead of a fixed value.
      • form

        FormFeatureList form()
        Returns all form features.
        Returns:
        List of form features.
      • form

        FormFeature form​(java.lang.String tag)
        Returns a form feature.
        Parameters:
        tag - Form feature tag.
        Returns:
        Form feature.
      • frame

        FrameList frame()
        Returns all frames.
        Returns:
        List of frames.
      • frame

        Frame frame​(java.lang.String tag)
        Returns a frame.
        Parameters:
        tag - Frame tag.
        Returns:
        Frame.
      • getComsolVersion

        java.lang.String getComsolVersion()
        Get the COMSOL version used to save the model, or the current version if the model has never been saved.
        Returns:
        The COMSOL version.
      • getEntityFromModelPath

        PrimitiveModelEntity getEntityFromModelPath​(java.lang.String modelPath)
        Returns the entity identified by the given path such that entity.resolveModelPath().equals(modelPath), or null if no such entity exists.
        Parameters:
        modelPath - Model path.
        Returns:
        Model entity.
      • getExpectedComputationTime

        java.lang.String getExpectedComputationTime()
        Returns a text specifying the expected computation time.
        Returns:
        Expected time.
      • getFilePath

        java.lang.String getFilePath()
        Returns the absolute path of the model. Returns an empty string if the model has not been saved.
        Returns:
        Absolute path of the model.
      • getLastComputationTime

        long getLastComputationTime()
        Returns the last computation time in milliseconds. A negative value means that no measured time is available.
        Returns:
        Computation time in milliseconds.
      • getLastComputationTime

        java.lang.String getLastComputationTime​(java.lang.String format)
        Returns the last computation time in the given format. The format can either be a time unit or a text describing a longer format. Currently supported formats are:
        hr:min:sec Returns format in hours, minutes, and seconds in the form X hr Y min Z sec. No translation.
        h:min:s Returns format in hours, minutes, and seconds in the form X h Y min Z s. No translation.
        detailed Returns format in seconds and also includes more readable units for longer times. Translates the output to the current language.
        .
        Parameters:
        format - Time format.
        Returns:
        Formatted computation time.
      • getThumbnail

        java.lang.String getThumbnail()
        Get the path to the thumbnail file. This is a file in the temporary folder and may be deleted when the model is removed from the server or the thumbnail it set to new image. .
        Returns:
        The path to the thumbnail file, or null if the model has no thumbnail.
      • getUsedProducts

        java.lang.String[] getUsedProducts()
        Returns the products that this model uses.
        Returns:
        List of products.
      • group

        GroupList group()
        Returns all groups.
        Returns:
        List of groups.
      • group

        Group group​(java.lang.String tag)
        Returns a group.
        Parameters:
        tag - Group tag.
        Returns:
        Group.
      • hist

        History hist()
        Returns the model history.
        Returns:
        Model history.
      • imageColorTheme

        java.lang.String imageColorTheme()
        Returns the default color theme used for image export. "automatic" indicates that the theme specified in the preferences is used.
        Returns:
        Color theme.
      • imageColorTheme

        void imageColorTheme​(java.lang.String theme)
        Sets the default color theme to be used for image export. "automatic" indicates that the theme specified in the preferences will be used. Available color themes are stored in the data/color folder in the COMSOL installation folder.
        Parameters:
        theme - The color theme to use.
      • init

        InitList init()
        Returns all initial values.
        Returns:
        List of initial values.
      • init

        Init init​(java.lang.String tag)
        Returns an initial value.
        Parameters:
        tag - Initial value tag.
        Returns:
        Initial value.
      • intRule

        IntRuleList intRule()
        Returns all integration rules.
        Returns:
        List of integration rules.
      • intRule

        IntRule intRule​(java.lang.String tag)
        Returns an integration rule.
        Parameters:
        tag - Integration rule tag.
        Returns:
        Integration rule.
      • isGeometryMeshDependent

        boolean isGeometryMeshDependent​(java.lang.String[] pnames)
        Returns true if either geometry or mesh is parameter dependent.
        Parameters:
        pnames - List of parameter names to check.
        Returns:
        True if any if either geometry or mesh is parameter dependent.
      • isReadOnly

        boolean isReadOnly()
        Returns whether the file where the model is saved is read-only and cannot be overwritten. The file can be read-only for two reasons:
        • The COMSOL process does not have permission to write to the file.
        • On Windows, the file can be locked by another COMSOL instance.
        If the model has not been saved, this method returns false.
        Returns:
        Whether the file where the model is saved is read-only and cannot be overwritten.
      • methodCall

        MethodCallFeatureList methodCall()
        Returns all method calls.
        Returns:
        List of method calls.
      • methodCall

        MethodCallFeature methodCall​(java.lang.String tag)
        Returns a method call.
        Parameters:
        tag - Method call tag.
        Returns:
        Method call.
      • modelData

        AppFeature modelData()
        Get the model data.
        Returns:
        The model data.
      • modelNode

        ModelNodeList modelNode()
        Returns all model nodes.
        Returns:
        List of model nodes.
      • modelNode

        ModelNode modelNode​(java.lang.String tag)
        Returns a model node.
        Parameters:
        tag - Model node tag.
        Returns:
        Model node.
      • modelPath

        java.lang.String modelPath()
        Returns the model path, which is path for additional files related to the model.
        Returns:
        Model path.
      • modelPath

        void modelPath​(java.lang.String path)
        Sets the model path, which is the path for additional files related to the model.
        Parameters:
        path - Model path.
      • nodeGroup

        NodeGroupList nodeGroup()
        Returns all node groups.
        Returns:
        List of node groups.
      • nodeGroup

        NodeGroup nodeGroup​(java.lang.String tag)
        Returns a node group.
        Parameters:
        tag - Group tag.
        Returns:
        Node group.
      • ode

        OdeList ode()
        Returns all global equations.
        Returns:
        List of global equations.
      • ode

        Ode ode​(java.lang.String tag)
        Returns a global equation.
        Parameters:
        tag - Global equation tag.
        Returns:
        Global equation.
      • opt

        OptSequence opt()
        Returns the optimization interface.
        Returns:
        Optimization interface.
      • param

        ModelParam param()
        Returns the parameters.
        Returns:
        Parameters.
      • param

        ModelParamGroup param​(java.lang.String gTag)
        Returns a parameter group with the given tag.
        Parameters:
        gTag - Parameter group tag.
        Returns:
        Parameter group.
      • reduced

        ReducedModelList reduced()
        Returns all reduced models.
        Returns:
        List of Reduced models.
      • reduced

        ReducedModel reduced​(java.lang.String tag)
        Returns a reduced order model.
        Parameters:
        tag - Reduced model sequence tag.
        Returns:
        Reduced model.
      • resetHist

        void resetHist()
        Resets the history of the model to an almost minimal sequence of actions that creates the current state.
      • result

        Results result()
        Returns postprocessing interface.
        Returns:
        Results.
      • result

        ResultFeature result​(java.lang.String tag)
        Returns a plot group.
        Parameters:
        tag - Plot group tag.
        Returns:
        Plot group.
      • save

        void save()
           throws java.io.IOException
        Saves the model object to file.
        Throws:
        java.io.IOException
      • save

        void save​(java.lang.String filename)
           throws java.io.IOException
        Saves the model object to file.
        Parameters:
        filename - Filename.
        Throws:
        java.io.IOException
      • save

        void save​(java.lang.String filename,
                  java.lang.String type)
        Saves a Model Java file or a Model M-file.
        Parameters:
        filename - File name.
        type - File type.
      • save

        void save​(java.lang.String filename,
                  boolean saveCopy)
           throws java.io.IOException
        Saves the model object to file.
        Parameters:
        filename - Filename.
        saveCopy - When true, save a copy of the model. After saving a copy, the model does not remember where the copy was saved. Instead it remembers its previous save location.
        Throws:
        java.io.IOException
      • savePoint

        SavePointDataList savePoint()
        Returns containers holding selections and hide features used by result features.
        Returns:
        Containers holding selections and hide features used by result features.
      • savePoint

        SavePointData savePoint​(java.lang.String tag)
        Returns a container holding selections and hide features used by result features.
        Parameters:
        tag - The container's tag.
        Returns:
        A container holding selections and hide features used by result features.
      • setExpectedComputationTime

        void setExpectedComputationTime​(java.lang.String text)
        Sets a text specifying the expected computation time.
        Parameters:
        text - Computation time text.
      • setLastComputationTime

        void setLastComputationTime​(long timeInMs)
        Manually sets the last computation time in milliseconds. This value is always automatically updated after a study has been computed. A negative value means that no measured time is available.
        Parameters:
        timeInMs - Computation time in milliseconds.
      • setThumbnail

        void setThumbnail​(java.lang.String thumbnailPath)
        Sets the model thumbnail.
        Parameters:
        thumbnailPath - The path to an image file.
      • shape

        ShapeList shape()
        Returns all shape functions.
        Returns:
        List of shape functions.
      • shape

        Shape shape​(java.lang.String tag)
        Returns a shape function.
        Parameters:
        tag - Shape function tag.
        Returns:
        Shape function.
      • shortcutTarget

        java.lang.Object shortcutTarget​(java.lang.String shortcut)
        Internal use.
        Parameters:
        shortcut - Shortcut name.
        Returns:
        ...
      • sol

        SolverSequenceList sol()
        Returns all solver sequences.
        Returns:
        List of solver sequences.
      • sol

        SolverSequence sol​(java.lang.String tag)
        Returns a solver sequence.
        Parameters:
        tag - Solver sequence tag.
        Returns:
        Solver sequence.
      • solverEvent

        EventList solverEvent()
        Returns all events.
        Returns:
        List of events.
      • solverEvent

        Event solverEvent​(java.lang.String tag)
        Returns an event.
        Parameters:
        tag - Event tag.
        Returns:
        Event.
      • study

        StudyList study()
        Returns all studies.
        Returns:
        List of studies.
      • study

        Study study​(java.lang.String tag)
        Returns a study.
        Parameters:
        tag - Study tag.
        Returns:
        Study.
      • thermodynamics

        Thermodynamics thermodynamics()
        Returns the Thermodynamic Properties interface.
        Returns:
        Thermodynamics interface.
      • title

        java.lang.String title()
        Returns the model title.
        Returns:
        The model title.
      • title

        Model title​(java.lang.String title)
        Sets the model title.
        Parameters:
        title - New title.
        Returns:
        Model.
      • unitSystem

        UnitSystemList unitSystem()
        Returns all unit systems.
        Returns:
        List of unit systems.
      • unitSystem

        UnitSystem unitSystem​(java.lang.String tag)
        Returns a unit system.
        Parameters:
        tag - Unit system tag.
        Returns:
        Unit system.
      • weak

        WeakList weak()
        Returns all weak form equations.
        Returns:
        List of weak form equations.
      • weak

        Weak weak​(java.lang.String tag)
        Returns a weak form equation.
        Parameters:
        tag - Weak form equation tag.
        Returns:
        Weak form equation.