Data
Use Data () to export numerical data to a file. Data export operates directly on datasets. You can use different types of evaluation points other than the ones in the dataset (for example, a grid) and export the data in spreadsheet or sectionwise formats.
To export data, you can right-click Export () and select Data (), or right-click any dataset node, for example, Solution, and select Add Data to Export. Click the Data node under Export.
Go to Common Results Node Settings for information about the Expressions section.
For detailed information about Data Formats, see the COMSOL Multiphysics Programming Reference Manual.
Data
Go to Common Results Node Settings for more information about the Data section.
If you have defined a compatible configuration (see Configurations), which is typically a Multiselect Solution, the you can choose From configuration from the Solution parameters list (the default is Manual). With From configuration, choose a compatible configuration from the Configuration list to use its settings for the solution parameters such as time, eigenvalue, or parameter values to use.
Output
From the File type list, select the file type for the exported data.
Choose Text (the default), for any of these text file types: text files (*.txt), CSV (comma-separated values) files (*.csv), data files (*.dat), or, if the license includes LiveLink™ for Excel®, Microsoft Excel workbook (*.xlsx).
Choose Unstructured VTK file (*.vtu), for saving to an unstructured VTK (the Visualization Toolkit) file.
Enter a Filename including a path to save the data file 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 Data window. When you have chosen Text from the File type list, you can save the data using any of the supported text file types that you choose from the Save as type list. Click the downward arrow for the Location menu () to choose Copy Location () and (if you have copied a file location) Paste Location ().
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 data.
Select the Points to evaluate in: From dataset (the default), From file, Grid, or Regular grid. Depending on the selected type of points to evaluate in, various settings are available.
From Dataset
The default From dataset uses the data points for the data in the dataset. For export to a text file, select a Data format: Spreadsheet (the default) or Sectionwise. Spreadsheet data is useful to use the data in spreadsheet applications and sectionwise data format is useful for unstructured interpolation because it contains the exact mesh used to perform the interpolation.
For either choice, select a Space dimension: From dataset (the default), Global, 0, 1, 2, or 3. Then select a Geometry level: From dataset (the default), Volume, Surface, Line, or Point (availability is based on the model space dimension).
If Spreadsheet is selected (and if required), choose the Transpose check box to transpose the data from columns to rows.
From File
If From file is selected, it uses coordinates from a data file. Enter a Coordinate file for a text file with the coordinates for the data output, or click Browse to locate the file. The file format for a coordinate file is such that each row contains N coordinates for an N-dimensional geometry. That is, each row contains coordinate values like the following example, for a 3D case:
x0 y0 z0 …
x1 y1 z1 …
You can use any of the following characters to separate the coordinates: space, comma, semicolon, or a tab character. Empty lines and lines that begin with a percent (%) character are ignored.
Grid or Regular Grid
If Grid or Regular grid is selected, it uses a grid to define the points to evaluate in. Select a Data format: Spreadsheet (the default) or Grid. Spreadsheet data is useful for using the data in spreadsheet applications, whereas the grid data format is more compact and can be useful to store data that can be imported into another model.
If Grid is selected as the Data format, also specify the x, y, and z coordinates for the grid points in the fields, or, for the Regular grid, specify the Number of x points, Number of y points, and Number of z points for the regular grid in the fields (default: 10 points in each direction). The coordinate names can vary depending on the physics and space dimension.
Advanced
The following settings apply for the text file format and partially for the VTK (the Visualization Toolkit) file format. Text and VTK Files
The Include header is selected by default. Click to clear the Include header check box if you do not want to include a header. When exporting to VTK files, the Include header check box is not available.
The Full precision check boxes is selected by default. Click to clear the Full precision check box to limit the precision in the output to six significant figures (and which provides an output that contains all significant figures for data stored as double-precision numbers).
By default, the data is unsorted. Select the Sort check box to sort the data by increasing x, y, and z coordinates.
By default, the data included data points whose values are NaN (Not a Number). Clear the Include NaN data points to exclude such data points from the data export. NaN values represent data that is missing, undefined, or unrepresentable, such as the result of zero divided by zero.
From the If the file exists list, select Overwrite (the default) to replace the data in the file with the data you export, or choose Append to append the data to the end of the file. Appending data can be useful when exporting data for a parametric sweep, for example. When exporting to VTK files, the If the file exists list is not available.
The Evaluate in list is only available for data from Solution datasets. From the Evaluate in list, select Lagrange points (the default) or Gauss points to specify where COMSOL Multiphysics evaluates the data — the nodes of the Lagrange elements or in the Gauss points for the Gaussian quadrature, respectively.
Smoothing of the data is available with Solution datasets where the Evaluation in list is set to Lagrange points and with nonsolution datasets, in both cases when the Points to evaluate in list in the Output section is set to From dataset. Select a data Smoothing method — None, Inside material domains (the default, for smoothing within domains shared by the same material but not across material boundaries), Inside geometry domains (for smoothing within each geometry domain but not across interior boundaries), Everywhere, or Expression. If you choose Expression, enter an expression in the Expression field such that smoothing occurs where the expression is continuous. The default expression is dom, the domain variable, which is equivalent to the Internal smoothing. You can also — in a surface plot, for example — use material.domain, which is an indicator variable for domains that share the same material (see Material Group Indicator Variables) and is equivalent to the Inside material domains setting.
For all Smoothing methods except None, you can also choose smoothing threshold, if needed. From the Smoothing threshold list, select None (the default), or select Manual to enter a relative smoothing threshold value (default: 0.1) in the Threshold field.
Select a Resolution: Normal (default), Finer, Fine, or Custom. If Custom is selected, enter a Lagrange-element node-point order (the default is 1). Use a higher node-point order for a finer resolution.
Select a recovery setting from the Recover list. The default is Off because recovery takes processing time. To use polynomial-preserving recovery and recover fields with derivatives such as stresses or fluxes with a higher theoretical convergence than smoothing, from the Recover list, select Within domains to perform recovery inside domains or Everywhere to apply recovery to all domain boundaries.
Select a column separator from the Separator list: Column (the default), Space, Tab, Comma, Semicolon, Colon, or Vertical bar (pipe).
Exporting the Data
Click the Export button () in the Settings window or right-click the node and select Export. 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 Messages window confirms where the files are exported as specified in the Output section.