Animation
Use Animation () to define and export a movie or series of images based on a plot group. Play the animation in a web browser or use it in presentations or on a website. You can also use it as a player directly in the COMSOL Desktop Graphics window. Use this node, for example, to export multiple images for different time steps or eigenvalues.
Right-click Export () and choose Animation>Player to create an Animation node set up for a player, or choose Animation>File to create an Animation node set up for a exporting a movie or images to files.
Scene
Select a Subject, which is one of the plot groups previously defined, or None.
Target
From the Target list, choose Player (the default when the Animation node was added as a Player) to play the movie directly in the COMSOL Desktop, or choose File (the default when the Animation node was added as a File) to export the animation to file as a movie or as an image sequence.
Output
Select an Output type: Movie (the default) to generate a single movie file containing all the images, or Image sequence to generate multiple image files, one for each frame. This section is only available when the Target is set to File.
If Image sequence is selected:
Enter a Filename including a path to save it to your computer, or click Browse () and navigate to where you want to Save the output. You can also click the downward arrow beside the Browse button and choose Browse From () to open the fullscreen Select File window. For example, navigate to the desktop and enter a Filename in the Export Image Sequence dialog box, then select a image file type from the Save as type list: .png, .bmp, or .jpg. Click the downward arrow for the Location menu ()to choose Copy Location () and (if you have copied a file location) Paste Location ().
The text entered in the Filename field is used for all the images generated. For example, if image is entered, select .png as the file type, and if there are 11 frames in the movie, 11 files are created: image01.png, image02.png, …, image11.png.
If Movie is selected, select a Format for the movie: GIF (the default), AVI, or WebM. For any movie or video format, enter a path and include a Filename. Or click Browse and navigate to where you want to Save the output. You can also click the downward arrow beside the Browse button and choose Browse From () to open the fullscreen Select File window. Click the downward arrow for the Location menu () to choose Copy Location () and (if you have copied a file location) Paste Location (). Also enter a number of Frames per second (the default is 10).
Select the Always ask for filename check box (only available if you are not saving to a database) if you want the program to always display a dialog box for specifying where to store the movie or images.
Enter information into these fields based on the Format for the movie:
If AVI is selected, enter a Quality, a scalar value between 0 and 1. The default is 0.75.
If WebM is selected, select the choose a Codec (compression format): VP9 (the default) or VP8. VP9 is a compression format that is a successor to VP8 and that is customized for video resolutions greater than 1080p and also enables lossless compression. If you have chosen VP9, select the Lossless check box for a lossless compression. If you do no select the Lossless check box, you can enter a Quality parameter (a value between 0 and 1), where a higher values means a higher quality. The default is 0.6. The encoder uses VBR (variable bit rate), and a higher value for the quality parameter means a higher target bit rate. A higher quality value usually results in large file sizes and longer encoding times.
The default for the Advanced parameters list is Automatic. Choose Manual to specify the advanced parameters under Advanced Parameters for the WebM Video Format below.
For GIF and WebM, select the Open in browser check box to launch the default web browser to view the output file.
Enter a value for the number of Frames per second when playing the movie (default: 10 frames per second).
Advanced Parameters for the WebM Video Format
The following advanced parameters are available for the WebM format:
The Enable parallel encoding check box is selected by default. Select the Enable parallel decoding check box to also enable parallel decoding when the Enable parallel encoding check box is selected.
From the Dither list, choose Off (the default) for no dithering or a level 1–5. Dither is low volume noise, and dithering adds white noise to reduce distortion of low-amplitude signals.
From the Optimize for list, choose Speed (faster encoding) (the default) or Quality (slower encoding). If you have selected the Lossless check box, this setting is not available.
From the Color space list, choose one of the following color spaces: BT.601 (limited range), BT.601 (full range), BT.709 (limited range) (the default), or BT.709 (full range).
Animation Editing
Control how the software creates the frames for the animation sequence. Select a Sequence type: Stored Solutions (the default), Result Parameter, Global Parameter, Dynamic Data Extension, or Streamline. Define the Sequence type parameters as needed.
Stored Solutions
The default, Stored solutions, is useful to animate time-dependent solutions or across the eigenmodes for an eigenvalue or eigenfrequency solution or across the parametric solutions for a solution from a parametric sweep. If Stored solutions is selected:
From the Loop over list, select the steps or parameter values to Loop over: All solutions (the default), or if applicable, a parameter or combination of parameters, any parameter in a Parametric Sweep study, or the Time. If All solutions is selected, a list appears that contains all combinations of parameter values and times (if applicable).
Parametric Sweep Study: For parametric sweep studies where there are multiple inner solutions (for example, a parameter sweep around a time-dependent solution), Inner solutions and Outer solutions are also available, typically corresponding to Time and parameter values, respectively. Typically, an animation shows variations looping over a parameter, frequency, or time; animating all solutions might be useful to get an overview of all solutions that the model contains.
-
If you choose to loop over Inner solutions, select the Parameter value set to animate, then the time steps, which you can select, using the Select via list, as Stored output times (a Time list of all stored times), or Interpolated times (a text field where you can specify any times within the time range directly). See Volume Integration, Surface Integration, and Line Integration and Global for more information about the inner and outer solutions.
-
If you choose to loop over Outer solutions (that is, the parameters from the parametric sweep), the Parameter values list contains all combinations of parameter values. Select as needed, then select an option from the Inner type list: First, Last (the default), or All.
If a parameter or combination of parameters are selected to loop over, choose an option from the Parameter selection list: All (the default), From list to select from a list of all parameter combinations, or Manual to enter a range of parameter value indices directly (or click the Range button ()).
If the model includes other parametric sweeps or frequency sweeps, specify the value of those parameters for the frames in the animation in separate Parameter value lists. Also, if the model includes a time-dependent solution, select a time step from the Time list, or select Interpolated to specify any time within the time span in the text field that appears.
If you select to loop over the Time, for time-dependent problems, choose an option from the Time selection list: All to use all time steps, From list to select from a list of all time steps, Manual to enter a range of times as indices directly, or Interpolated to enter Times. If the model contains a parametric sweep, select an option from the Parameter value list.
Result Parameter
Use a Result parameter to animate the changes resulting from a sweep of the values for a defined result parameter (found under Results>Parameters). Using a parameter you can, for example, animate a sweep of the position of a slice across the geometry in a slice plot using it in the slice coordinates. Typically, you can use a result parameter in text fields for coordinates. It is not possible to use a result parameter in, for example, text fields for expressions.
If Result parameter is selected, choose a Parameter from the list (or select None), which contains all result parameters, and define an interval for the parameter values using the Start and Stop fields and a unit in the Unit field, if desired (the parameter’s unit appears here if it exists).
Global Parameter
If Global parameter is selected, choose a Parameter from the list (or select None), which contains all global parameters, and define an interval for the parameter values using the Start and Stop fields and a unit in the Unit field, if desired (the parameter’s unit appears here if it exists). It is not possible to use a global parameter in, for example, text fields for expressions.
Dynamic Data Extension
Use a Dynamic data extension, for example, to animate the dynamics of an eigenmode in an eigenfrequency or eigenvalue solution. In such a dynamic data extension, the full harmonic cycle (the default) is the normal choice. You can also use it to animate a stationary solution even if there is no obvious interpretation of the animation.
If Dynamic data extension is selected, and when animating static and eigenvalue solutions, select a Cycle type:
Full harmonic — a full sine wave (the solution phase grows linearly from 0 to 360°)
Half harmonic — half a sine wave (the solution phase grows linearly from 0 to 180°)
Linear — a linear ramp (Re(eiα), where α is the phase, grows linearly from 0 to 1)
The cycle starts from the angle specified in the Solution at angle (phase) field when defining a Solution dataset.
Streamline
Select Streamline when you want to animate streamlines with moving arrows to indicate some fluid flow, for example. From the Plot list, choose the streamline plot to animate from any existing Streamline plot nodes.
Frames
If the selected Sequence type is Stored Solutions, choose a Frame selection: All (to play all solutions in the stored solution) or Number of frames. For any sequence type, or if number of frames is selected here, enter the Number of frames. The default is 25 frames.
If the Target is set to File, you can specify the following additional settings:
From the Size list, select Manual (the default), HD, or Current. The high-definition option, HD, uses 1280 by 720 pixels. The Current option uses the current size of the Graphics window.
For Manual, select the Lock aspect ratio check box to keep the original animation width and height. In the Width and Height fields, enter the number of pixels (px) for the generated image size. The default value is 640 pixels (width) by 480 pixels (height).
If required, select the Record in reverse order check box.
If required, select the Zoom extents check box to zoom the output frames to the extents of the plot’s subject.
If the Target is set to Player, and to preview individual frames, enter the Frame number or select it using the slider. Observe the geometry in the Graphics window to see the Shown frame number.
Playing
Use this section, when the Target is set to Player, to adjust some settings that affect the playing of the recorded plots. In the Display each frame for field, enter the time to display each frame (in seconds) to control how fast the player runs (default value: 0.1 s). From the Repeat list, choose Off (the default) to play the sequence of plots once and not repeat it, Forever to replay the sequence of plots repeatedly until you stop it, or Number of iterations to replay it as many times as you enter in the Number of iterations field (default: 1). Note that if you want to use a player in an app, then Forever does not apply; instead, use Number of iterations if you want to replay the sequence of plots several times.
At the top of the Settings window, click Show Frame () (or right-click the Animation node) to regenerate the animation if it has not already been generated. Then the frame of the animation corresponding to the settings for the player is shown.
Right-click the Animation node and select Play (). Watch each Frame number cycle from beginning to end in the Graphics window. You can also use the buttons on the Graphics window to Play () and Stop (), and Next () and Previous () to cycle through the animation.
Layout
If the Target is set to File, you can specify the following layout settings:
By default, the Title, Legend (1D graphs) or Color legend (2D plots); Axes; and Logo (1D and 2D plots) or Title, Color legend, Grid, Axis orientation, and Logo (3D plots) parts of the graphics are included. To edit the default, select the Include check box and click to clear or select one or several of the available check boxes.
Enter a Font size (pt) for the text in the animation frames. The default is 9 pt.
Select a Background: Color (the default), From theme, Transparent, or Current. If Color is selected, click Color to select a custom color background to replace the default, which is white. Select Current to use the background in the plot group, which is a blue gradient background for 3D plots and white for 2D and 1D plots.
Advanced
By default, the Synchronize scales between frames check box is selected, which means that all frames in the animation use the same color legend, isosurface levels, deformation scale, and so on. This synchronization makes areas with the same solution values keep the same color, for example, during the entire animation. Click to clear the check box to make the scales and levels adapt to the solution in each frame. This can be useful, for example, for time-dependent simulations of transient phenomena where the magnitude of the solution changes significantly during the time stepping. With the synchronization active, it can then be difficult to distinguish small variations in the solution.
The remaining settings below are only available if Target is set to File.
If needed, adjust settings for the resolution and antialiasing:
Enter a Resolution for the images in the animation. The default is 96 DPI.
The Antialiasing check box is selected by default to reduce stairstep-like lines and to smooth lines and edges.
Click the Export button () in the Settings window or right-click the node and select Export to export the animation to a file, if Target is set to File. You can also click the downward arrow beside the Export button or right-click and choose Export To () to open the fullscreen Export window for exporting to a database. The animation file is exported to the location on your computer previously specified. The Messages window confirms where the files are exported as specified in the Output section. Click the Refresh button () to refresh the Graphics window. This is useful if you have disabled Only plot when requested in the Results node’s Settings window and change the Subject in the animation.