Back

StringMeshCreator

sofa::component::io::mesh::StringMeshCreator
MeshLoader
Doc (from source)

Procedural creation of a one-dimensional mesh. Procedurally creates a string. The coordinates range from (0,0,0) to (1,0,0). They can be translated, rotated and scaled using the corresponding attributes of the parent class. @author François Faure, 2012

Abstract (AI generated)

The `StringMeshCreator` procedurally generates one-dimensional meshes (strings) from \( (0,0,0) \) to \( (1,0,0) \), with the number of vertices controlled by the resolution attribute.

Metadata
module
Sofa.Component.IO.Mesh
namespace
sofa::component::io::mesh
include
sofa/component/io/mesh/StringMeshCreator.h
inherits
  • MeshLoader
description

The StringMeshCreator is a procedural mesh generator in the SOFA framework designed to create one-dimensional meshes (strings). It generates a string with coordinates ranging from \$ (0,0,0) \$ to \$ (1,0,0) \$, allowing vertices and edges to be created along this line. The number of vertices is controlled by the resolution attribute, which specifies how many vertices should be included in the string mesh.

Governing Equations or Operators

The component does not directly implement any governing equations or operators typically associated with FEM (such as mass matrix \$ M \$, stiffness matrix \$ K \$, internal force \$ f_{int} \$, residual \$ R \$). Instead, it is responsible for generating the mesh data required by these operators.

Constitutive or Kinematic Laws Involved

The StringMeshCreator does not involve any constitutive or kinematic laws. It purely generates a one-dimensional geometric structure with specified resolution.

Role in the Global FEM Pipeline

In the context of the global FEM pipeline, the role of the StringMeshCreator is to generate mesh data for further processing:
1. Modeling Phase: The component procedurally creates the string mesh geometry.
2. Discretization Phase: It ensures that the spatial domain \$ [0, 1] \$, aligned along one axis (say $ x $-axis in this case), is discretized into a specified number of vertices and edges.
3. Assembly Phase: The generated mesh data can then be used to construct finite elements for further assembly of global operators like mass matrix \$ M \$ or stiffness matrix \$ K \$.
4. Time Integration, Nonlinear Resolution, Linear Solve, Constraint Handling, Mapping: These stages are not directly handled by StringMeshCreator; they rely on the generated mesh data.

Numerical Methods or Discretization Choices Encoded

The component generates a one-dimensional mesh with vertices and edges based on user-defined resolution. It creates:
- Vertices: The coordinates of each vertex are given by \$ (x, 0, 0) $, where \$ x = i / (numX - 1) $ for \$ i = 0, 1, 2, ..., numX - 1 $.
- Edges: Each edge connects consecutive vertices, i.e., the edge between vertex \$ i $ and vertex \$ i+1 $ is defined as \$ (i, i + 1) $.

How the Component Fits into the Broader Variational / Lagrangian Mechanics Framework

The StringMeshCreator is a preparatory step in the FEM pipeline. It creates the mesh data required for subsequent steps such as spatial discretization and operator assembly. This generated mesh can be used to define finite elements, which are then used to derive variational formulations leading to equations of motion and other governing operators.

The component itself does not contribute directly to the Lagrangian mechanics framework but provides a necessary geometric input that facilitates further FEM operations.

Data Fields
NameTypeDefaultHelp
d_resolution unsigned int Number of vertices
Methods
int type ()
bool canLoad () virtual
bool doLoad () virtual
void doClearBuffers () virtual
{
  "name": "StringMeshCreator",
  "namespace": "sofa::component::io::mesh",
  "module": "Sofa.Component.IO.Mesh",
  "include": "sofa/component/io/mesh/StringMeshCreator.h",
  "doc": "Procedural creation of a one-dimensional mesh.\n\nProcedurally creates a string.\n  The coordinates range from (0,0,0) to (1,0,0). They can be translated, rotated and scaled using the corresponding attributes of the parent class.\n  @author François Faure, 2012",
  "inherits": [
    "MeshLoader"
  ],
  "templates": [],
  "data_fields": [
    {
      "name": "d_resolution",
      "type": "unsigned int",
      "xmlname": "resolution",
      "help": "Number of vertices"
    }
  ],
  "links": [],
  "methods": [
    {
      "name": "type",
      "return_type": "int",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "canLoad",
      "return_type": "bool",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "doLoad",
      "return_type": "bool",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "doClearBuffers",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    }
  ],
  "description": "The `StringMeshCreator` is a component in the SOFA framework, specifically under the `sofa::component::io::mesh` namespace, designed for procedural creation of one-dimensional meshes (strings). It extends the `MeshLoader` class to generate mesh data programmatically.\n\nThis component generates a string with coordinates ranging from (0,0,0) to (1,0,0), allowing vertices and edges to be created along this line. The number of vertices can be controlled through the `resolution` attribute, which specifies how many vertices should be included in the string mesh.\n\nThe `StringMeshCreator` interacts with other SOFA components by inheriting from `MeshLoader`, utilizing its methods such as `canLoad()` and `doLoad()`. It also provides a `type()` method to return the type of object it creates, confirming that the object is procedurally created.\n\nPractical usage involves setting the `resolution` attribute to define the number of vertices needed for the string. The component automatically handles vertex and edge creation based on this resolution value.",
  "maths": "The `StringMeshCreator` is a procedural mesh generator in the SOFA framework designed to create one-dimensional meshes (strings). It generates a string with coordinates ranging from \\\\( (0,0,0) \\\\) to \\\\( (1,0,0) \\\\), allowing vertices and edges to be created along this line. The number of vertices is controlled by the `resolution` attribute, which specifies how many vertices should be included in the string mesh.\n\n### Governing Equations or Operators\n\nThe component does not directly implement any governing equations or operators typically associated with FEM (such as mass matrix \\\\( M \\\\), stiffness matrix \\\\( K \\\\), internal force \\\\( f_{int} \\\\), residual \\\\( R \\\\)). Instead, it is responsible for generating the mesh data required by these operators.\n\n### Constitutive or Kinematic Laws Involved\n\nThe `StringMeshCreator` does not involve any constitutive or kinematic laws. It purely generates a one-dimensional geometric structure with specified resolution.\n\n### Role in the Global FEM Pipeline\n\nIn the context of the global FEM pipeline, the role of the `StringMeshCreator` is to generate mesh data for further processing:\n1. **Modeling Phase**: The component procedurally creates the string mesh geometry.\n2. **Discretization Phase**: It ensures that the spatial domain \\\\( [0, 1] \\\\), aligned along one axis (say \\( x \\)-axis in this case), is discretized into a specified number of vertices and edges.\n3. **Assembly Phase**: The generated mesh data can then be used to construct finite elements for further assembly of global operators like mass matrix \\\\( M \\\\) or stiffness matrix \\\\( K \\\\).\n4. **Time Integration, Nonlinear Resolution, Linear Solve, Constraint Handling, Mapping**: These stages are not directly handled by `StringMeshCreator`; they rely on the generated mesh data.\n\n### Numerical Methods or Discretization Choices Encoded\n\nThe component generates a one-dimensional mesh with vertices and edges based on user-defined resolution. It creates:\n- **Vertices**: The coordinates of each vertex are given by \\\\( (x, 0, 0) \\), where \\\\( x = i / (numX - 1) \\) for \\\\( i = 0, 1, 2, ..., numX - 1 \\).\n- **Edges**: Each edge connects consecutive vertices, i.e., the edge between vertex \\\\( i \\) and vertex \\\\( i+1 \\) is defined as \\\\( (i, i + 1) \\).\n\n### How the Component Fits into the Broader Variational / Lagrangian Mechanics Framework\n\nThe `StringMeshCreator` is a preparatory step in the FEM pipeline. It creates the mesh data required for subsequent steps such as spatial discretization and operator assembly. This generated mesh can be used to define finite elements, which are then used to derive variational formulations leading to equations of motion and other governing operators.\n\nThe component itself does not contribute directly to the Lagrangian mechanics framework but provides a necessary geometric input that facilitates further FEM operations.",
  "abstract": "The `StringMeshCreator` procedurally generates one-dimensional meshes (strings) from \\( (0,0,0) \\) to \\( (1,0,0) \\), with the number of vertices controlled by the resolution attribute.",
  "sheet": "# StringMeshCreator\n\n## Overview\n\nThe `StringMeshCreator` is a component in the SOFA framework designed for procedural creation of one-dimensional meshes. It extends the `MeshLoader` class and generates mesh data programmatically, creating strings with coordinates ranging from \\( (0,0,0) \\) to \\( (1,0,0) \\). The number of vertices is controlled by the `resolution` attribute.\n\n## Parameters and Data\n\n- **d_resolution**: Number of vertices in the string mesh. Type: unsigned int. Default value not specified."
}