WriteTopology
Write topology containers information to file at each timestep. Write Topology containers information into a file at a given set of time instants A period can be established at the last time instant. The information to write can be chosen. by default there will be only commun containers. An option is available to write shells containers. This part is not handle yet: Stop to write infos if the kinematic energy reach a given threshold (stopAt) The energy will be measured at each period determined by keperiod
The `WriteTopology` component writes topology container information to a file at specified time intervals during simulation.
- module
- Sofa.Component.Playback
- namespace
- sofa::component::playback
- include
- sofa/component/playback/WriteTopology.h
- inherits
-
- BaseObject
- description
The WriteTopology component in the SOFA framework is designed to write topology container information into a file at specified time instants during simulation. This functionality does not directly contribute to any governing equations, constitutive laws, or numerical methods related to the Finite Element Method (FEM) itself but serves as an output mechanism for topological data. Here is a detailed mathematical and physical description of this component:
Governing Equations or Operators Involved
- None: The
WriteTopologycomponent does not implement or contribute to any governing equations, operators such as mass matrix $ M $, stiffness matrix $ K $, internal force $ f_{int} $, residual $ R $, etc. It is purely an output mechanism.
Constitutive or Kinematic Laws Involved
- None: The component does not involve any constitutive or kinematic laws such as strain measures, stress tensors, hyperelastic potentials, damping models, constraint Jacobians, etc. Its role is to capture and write topological information at specified intervals.
Role in the Global FEM Pipeline
- Output Mechanism: This component serves an external output purpose within the simulation pipeline. It does not participate in assembly, time integration, nonlinear solve, linear solve, constraint handling, or mappings. Instead, it focuses on logging topology data such as edges, triangles, quads, tetrahedra, and hexahedra (if enabled) at specified times.
Numerical Methods or Discretization Choices Encoded
- None: The component does not encode any numerical methods or discretization choices relevant to the FEM simulation. It merely provides a mechanism for writing topological data at given intervals.
Integration into Variational / Lagrangian Mechanics Framework
- External Output:
WriteTopologyis an external output component that operates outside of the core variational and Lagrangian mechanics framework used in FEM simulations within SOFA. Its primary role is to enable users to log topological data for post-processing or analysis purposes.
Practical Usage Details
- d_writeContainers (bool): A flag enabling the output of common topology containers (edges, triangles, quads, tetrahedra, hexahedra). Default value is
true. - d_writeShellContainers (bool): A flag for writing specific shell topology containers; this feature is not currently implemented. The default value is
false. - d_interval (double): Time duration between outputs, controlling the frequency at which data is written to file.
- d_period (double): Period after the last output when further writing will continue, if applicable.
- l_topology: A link pointing to the topology container. This must be set for the component to function correctly.
Conclusion
The WriteTopology component in SOFA is a utility for logging topological data during simulations at specified intervals. It does not influence any of the core numerical methods or governing equations used in FEM but provides valuable output information for post-simulation analysis.
Data Fields
| Name | Type | Default | Help |
|---|---|---|---|
d_writeContainers |
bool | |
flag enabling output of common topology containers. |
d_writeShellContainers |
bool | |
flag enabling output of specific shell topology containers. |
d_interval |
double | |
time duration between outputs |
d_period |
double | |
period between outputs |
Links
| Name | Type | Help |
|---|---|---|
l_topology |
link to the topology container |
Methods
void
init
()
virtual
void
reset
()
virtual
void
handleEvent
(sofa::core::objectmodel::Event * event)
virtual
bool
canCreate
(T *& obj, core::objectmodel::BaseContext * context, core::objectmodel::BaseObjectDescription * arg)
{
"name": "WriteTopology",
"namespace": "sofa::component::playback",
"module": "Sofa.Component.Playback",
"include": "sofa/component/playback/WriteTopology.h",
"doc": "Write topology containers information to file at each timestep.\n\nWrite Topology containers information into a file at a given set of time instants\nA period can be established at the last time instant.\nThe information to write can be chosen. by default there will be only commun containers.\nAn option is available to write shells containers.\nThis part is not handle yet:\nStop to write infos if the kinematic energy reach a given threshold (stopAt)\nThe energy will be measured at each period determined by keperiod",
"inherits": [
"BaseObject"
],
"templates": [],
"data_fields": [
{
"name": "d_writeContainers",
"type": "bool",
"xmlname": "writeContainers",
"help": "flag enabling output of common topology containers."
},
{
"name": "d_writeShellContainers",
"type": "bool",
"xmlname": "writeShellContainers",
"help": "flag enabling output of specific shell topology containers."
},
{
"name": "d_interval",
"type": "double",
"xmlname": "interval",
"help": "time duration between outputs"
},
{
"name": "d_period",
"type": "double",
"xmlname": "period",
"help": "period between outputs"
}
],
"links": [
{
"name": "l_topology",
"target": "BaseMeshTopology",
"kind": "single",
"xmlname": "topology",
"help": "link to the topology container"
}
],
"methods": [
{
"name": "init",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "reset",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "handleEvent",
"return_type": "void",
"params": [
{
"name": "event",
"type": "sofa::core::objectmodel::Event *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "canCreate",
"return_type": "bool",
"params": [
{
"name": "obj",
"type": "T *&"
},
{
"name": "context",
"type": "core::objectmodel::BaseContext *"
},
{
"name": "arg",
"type": "core::objectmodel::BaseObjectDescription *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": true,
"access": "public"
}
],
"description": "<h3>Role and Purpose</h3>\n\n<p>The <code>WriteTopology</code> component in the SOFA framework is designed to write topology container information into a file at specified time instants during simulation. This includes details on common containers (edges, triangles, quads, tetrahedra, hexahedra) and optionally specific shell containers. The output can be controlled by setting an interval or period between outputs.</p>\n\n<h3>Interactions with Other SOFA Components</h3>\n\n<ul>\n <li><strong>BaseMeshTopology Link:</strong> It requires a link to the topology container through which it accesses and writes out topological information. This is crucial for the component's operation as it depends on the mesh topology.</li>\n <li><strong>Event Handling:</strong> The component handles events, particularly <code>AnimateBeginEvent</code>, to trigger writing of topology data at defined times during simulation.</li>\n</ul>\n\n<h3>Practical Usage and Data Fields</h3>\n\n<ul>\n <li><strong>d_writeContainers (bool):</strong> A flag that enables output for common topology containers. Default value is <code>true</code>.</li>\n <li><strong>d_writeShellContainers (bool):</strong> A flag enabling the output of specific shell topology containers, although this feature is not currently implemented.</li>\n <li><strong>d_interval (double):</strong> The time duration between outputs. This sets the frequency at which data is written to file.</li>\n <li><strong>d_period (double):</strong> Period after the last output when further writing will continue, if applicable.</li>\n <li><strong>l_topology:</strong> A link that points to the topology container. This must be set for the component to function correctly.</li>\n</ul>",
"maths": "The `WriteTopology` component in the SOFA framework is designed to write topology container information into a file at specified time instants during simulation. This functionality does not directly contribute to any governing equations, constitutive laws, or numerical methods related to the Finite Element Method (FEM) itself but serves as an output mechanism for topological data. Here is a detailed mathematical and physical description of this component:\n\n### Governing Equations or Operators Involved\n- **None**: The `WriteTopology` component does not implement or contribute to any governing equations, operators such as mass matrix \\( M \\), stiffness matrix \\( K \\), internal force \\( f_{int} \\), residual \\( R \\), etc. It is purely an output mechanism.\n\n### Constitutive or Kinematic Laws Involved\n- **None**: The component does not involve any constitutive or kinematic laws such as strain measures, stress tensors, hyperelastic potentials, damping models, constraint Jacobians, etc. Its role is to capture and write topological information at specified intervals.\n\n### Role in the Global FEM Pipeline\n- **Output Mechanism**: This component serves an external output purpose within the simulation pipeline. It does not participate in assembly, time integration, nonlinear solve, linear solve, constraint handling, or mappings. Instead, it focuses on logging topology data such as edges, triangles, quads, tetrahedra, and hexahedra (if enabled) at specified times.\n\n### Numerical Methods or Discretization Choices Encoded\n- **None**: The component does not encode any numerical methods or discretization choices relevant to the FEM simulation. It merely provides a mechanism for writing topological data at given intervals.\n\n### Integration into Variational / Lagrangian Mechanics Framework\n- **External Output**: `WriteTopology` is an external output component that operates outside of the core variational and Lagrangian mechanics framework used in FEM simulations within SOFA. Its primary role is to enable users to log topological data for post-processing or analysis purposes.\n\n### Practical Usage Details\n- **d_writeContainers (bool)**: A flag enabling the output of common topology containers (edges, triangles, quads, tetrahedra, hexahedra). Default value is `true`.\n- **d_writeShellContainers (bool)**: A flag for writing specific shell topology containers; this feature is not currently implemented. The default value is `false`.\n- **d_interval (double)**: Time duration between outputs, controlling the frequency at which data is written to file.\n- **d_period (double)**: Period after the last output when further writing will continue, if applicable.\n- **l_topology**: A link pointing to the topology container. This must be set for the component to function correctly.\n\n### Conclusion\nThe `WriteTopology` component in SOFA is a utility for logging topological data during simulations at specified intervals. It does not influence any of the core numerical methods or governing equations used in FEM but provides valuable output information for post-simulation analysis.",
"abstract": "The `WriteTopology` component writes topology container information to a file at specified time intervals during simulation.",
"sheet": "# WriteTopology\n\n## Overview\n\nThe `WriteTopology` component in the SOFA framework is designed to write topology container information into a file at specified time instants during simulation. It requires a link to the topology container and can be configured to output common or shell containers.\n\n## Parameters and Data\n\n- **d_writeContainers (bool)**: A flag enabling the output of common topology containers. Default value is `true`.\n- **d_writeShellContainers (bool)**: A flag for writing specific shell topology containers; this feature is not currently implemented. The default value is `false`.\n- **d_interval (double)**: Time duration between outputs, controlling the frequency at which data is written to file.\n- **d_period (double)**: Period after the last output when further writing will continue, if applicable.\n\n## Dependencies and Connections\n\nThe component requires a link to the topology container (`l_topology`). It operates by handling events such as `AnimateBeginEvent` to trigger writing of topology data at defined times during simulation.\n\n## Practical Notes\n\n- The feature for stopping output based on kinetic energy thresholds is not currently implemented.\n- Ensure that the `d_interval` and `d_period` parameters are set appropriately to avoid excessive file writes or missing critical information."
}