model.mesh()
Meshing sequences.
See the Mesh section for more information.
Syntax
model.component(<ctag>).mesh().create(<tag>,<gtag>);
model.component(<ctag>).mesh().remove(<tag>);
model.component(<ctag>).mesh(<tag>).create(<ftag>,operation);
model.component(<ctag>).mesh(<tag>).feature(<ftag>).create(<ftag2>,operation);
model.component(<ctag>).mesh(<tag>).feature(<ftag>).set(property,<value>);
model.component(<ctag>).mesh(<tag>).feature(<ftag>).getType(property);
model.component(<ctag>).mesh(<tag>).feature(<ftag>).feature().meshMethod
model.component(<ctag>).mesh(<tag>).current(<ftag>);
model.component(<ctag>).mesh(<tag>).feature(<ftag>).active(boolean);
model.component(<ctag>).mesh(<tag>).feature(<ftag>).isActive();
model.component(<ctag>).mesh(<tag>).feature().move(<ftag>,<position>);
model.component(<ctag>).mesh(<tag>).feature().remove(<ftag>);
model.component(<ctag>).mesh(<tag>).feature(<fgtag>).getAllowedPropertyValues(property);
model.component(<ctag>).mesh(<tag>).feature().image();
model.component(<ctag>).mesh(<tag>).clearMesh();
model.component(<ctag>).mesh(<tag>).geom();
model.component(<ctag>).mesh(<tag>).image();
 
model.component(<ctag>).mesh(<tag>).run(<ftag>);
model.component(<ctag>).mesh(<tag>).run();
model.component(<ctag>).mesh().run();
 
model.component(<ctag>).mesh(<tag>).current();
model.component(<ctag>).mesh(<tag>).feature(<ftag>).status();
model.component(<ctag>).mesh(<tag>).feature(<ftag>).message();
 
model.component(<ctag>).mesh(<tag>).meshGetMethod
model.component(<ctag>).mesh(<tag>).data().meshModificationMethod
model.component(<ctag>).mesh(<tag>).stat().meshStatisticsMethod
 
model.component(<ctag>).mesh(<tag>).export(<filename>);
Description
Creating and Deleting a Meshing Sequence
model.component(<ctag>).mesh().create(<tag>,<gtag>) creates a meshing sequence (or just mesh) for the geometry sequence <gtag> and assigns it the tag <tag>.
model.component(<ctag>).mesh().remove(<tag>) removes the meshing sequence <tag>.
Creating, Editing, and Deleting Features
model.component(<ctag>).mesh(<tag>).create(<ftag>,operation) adds a feature <ftag> of type operation to the meshing sequence <tag>, after the current feature.
model.component(<ctag>).mesh(<tag>).feature(<ftag>).set(property,<value>) sets the property property defined for the feature <ftag> to the value <value>. All data types listed in Table 2-4 are supported; the applicable data types differ between the properties. String expressions can use parameters from model.param().
model.component(<ctag>).mesh(<tag>).feature(<ftag>).getType(property) returns the value of a property in the feature <ftag>.
model.component(<ctag>).mesh(<tag>).feature(<ftag>).selection().selMethod manages the selection of the feature <ftag>. The available selection methods are described in Selection Methods.
model.component(<ctag>).mesh(<tag>).feature(<ftag>).selection(property).selMethod manipulates the selection of the property property. The available selection methods are described in Selection Methods.
model.component(<ctag>).mesh(<tag>).feature(<ftag>).feature().meshMethod manages the entity list for the feature <ftag>.
model.component(<ctag>).mesh(<tag>).current(<ftag>) sets the current feature to be <ftag>.
model.component(<ctag>).mesh(<tag>).feature(<ftag>).active(false) disables the feature <ftag>.
model.component(<ctag>).mesh(<tag>).feature(<ftag>).active(true) enables the feature <ftag>.
model.component(<ctag>).mesh(<tag>).feature(<ftag>).isActive() returns true if the feature <ftag> is enabled, and false otherwise.
model.component(<ctag>).mesh(<tag>).feature(<ftag>)).
getAllowedPropertyValues(property)
returns the set of allowed values for a property if the set is a finite set of strings; otherwise, it returns null.
model.component(<ctag>).mesh(<tag>).feature().move(<ftag>,<position>) moves the feature <ftag> to the zero indexed position <position> in the sequence.
model.component(<ctag>).mesh(<tag>).feature().remove(<ftag>) removes the feature <ftag>.
model.component(<ctag>).mesh(<tag>).clearMesh() removes all features from the sequence and clears the mesh.
Building Features
After each build operation, the current feature is set as the last of features that were built. The mesh is updated to be the mesh generated by these features.
model.component(<ctag>).mesh(<tag>).run(<ftag>) builds all features up to (and including) the feature <ftag>.
model.component(<ctag>).mesh(<tag>).run() builds all features.
model.component(<ctag>).mesh().run() builds all meshing sequences.
Getting Build Status
String fTag = model.component(<ctag>).mesh(<tag>).current() returns the tag of the current feature. If the current state is before the first feature, the empty string "" is returned.
String status = model.component(<ctag>).mesh(<tag>).feature(<ftag>).status() returns the status of the feature <ftag>. The status is built, warning, needs_rebuild, edited, or error.
String msg = model.component(<ctag>).mesh(<tag>).feature(<ftag>).message() returns the warning/error message of the feature <ftag>.
Getting and Setting Mesh Data
model.component(<ctag>).mesh(<tag>).meshGetMethod gets mesh data from the mesh <tag>. The available methods are described in Accessing Mesh Data.
model.component(<ctag>).mesh(<tag>).data().meshModificationMethods are used to modify mesh data on a low level. You can access and modify individual elements. The available methods are described in Accessing Mesh Data.
model.component(<ctag>).mesh(<tag>).data().createMesh() transfers the modified data into to the mesh <tag>. See also Setting or Modifying Mesh Data.
Mesh Statistics
model.component(<ctag>).mesh(<tag>).stat().selection().selMethod can be used to select a number of geometric entities for which statistics is wanted. The available selection methods are described in Selection Methods.
model.component(<ctag>).geom(<tag>).stat().meshStatisticsMethod returns mesh statistics about the selected geometric entities. The available methods are described in Information and Statistics.
Exporting a Mesh to File
model.component(<ctag>).mesh(<tag>).export(<filename>) exports the mesh <tag> to an mphbin or mphtxt file.
Plotting a Mesh
Use the model.component(<ctag>).mesh(<tag>).image() and model.component(<ctag>).mesh(<tag>).feature().image() methods to plotting and exporting mesh images. See Plotting and Exporting Images.
Selection Methods
selection.allGeom() sets the selection to be the entire geometry (that is, all geometric entities).
selection.remaining() sets the selection to be the geometric entities that remains to be meshed when the feature is about to be built.
selection.geom(<dim>).all() sets all geometric entities in dimension <dim>.
selection.geom(<dim>).set(<entities>) sets the selection to be the geometric entities specified in the integer array <entities> in dimension <dim>.
selection.geom(<dim>).add(<entities>) adds the geometric entities specified in the integer array <entities> in dimension <dim> to the selection.
selection.geom(<dim>).remove(<entities>) removes the geometric entities specified in the integer array <entities> in dimension <dim> from the selection.
selection.geom(<dim>).clear() clears the selection.
To access the selections use:
int[] dims = selection.dimension() returns the geometric entity level in dims[0] for the entities in the selection. If dims is empty the selection defines the entire geometry.
selection.isRemaining() returns true if the selection specifies the remaining entities, otherwise false.
selection.dom(<dim>) returns the geometric entities in dimension <dim> for the selection.
Getting the Geometry Tag
model.mesh(<tag>).geom() returns the geometry tag. This can be useful when working with several geometries in the same model.
Example
Create a 2D geometry by the union of a circle and square. Build a triangle mesh with hmax = 0.1 in domains 1 and 3, and hmax = 0.01 in domain 2.
Code for Use with Java
Model model = ModelUtil.create("Model");
model.component().create("comp1");
GeomSequence g = model.component("comp1").geom().create("geom1", 2);
MeshSequence m = model.component("comp1").mesh().create("mesh1", "geom1");
g.create("c1", "Circle");
g.create("sq1", "Square");
g.create("uni1", "Union");
g.feature("uni1").selection("input").set(new String[]{"c1", "sq1"});
m.create("size1", "Size");
m.feature("size1").selection().geom(2).set(new int[]{1, 3});
m.feature("size1").set("hmax", "0.1");
m.create("size2", "Size");
m.feature("size2").selection().geom(2).set(new int[]{2});
m.feature("size2").set("hmax", "0.025");
m.create("ftri1", "FreeTri");
m.run();
Code for Use with MATLAB
model = ModelUtil.create('Model');
model.component.create('comp1');
g = model.component('comp1').geom.create('geom1', 2);
m = model.component('comp1').mesh.create('mesh1', 'geom1');
g.create('c1', 'Circle');
g.create('sq1', 'Square');
g.create('uni1', 'Union');
g.feature('uni1').selection('input').set({'c1', 'sq1'});
m.create('size1', 'Size');
m.feature('size1').selection.geom(2).set([1, 3]);
m.feature('size1').set('hmax', '0.1');
m.create('size2', 'Size');
m.feature('size2').selection.geom(2).set(2);
m.feature('size2').set('hmax', '0.025');
m.create('ftri1', 'FreeTri');
m.run;
See Also
model.geom()