EdgePressureForceField
The EdgePressureForceField class is part of the SOFA (Simulation Open-Framework Architecture) framework, which is used for modeling and simulation in various domains such as biomechanics and virtual reality. This specific component applies pressure forces to edges of a mesh or structure within the simulation environment. ### Key Features: - **Force Application**: It allows users to apply pressure forces on selected edges of a mesh. The force can be specified per unit area, allowing for realistic simulations involving pressures such as fluid interaction with deformable objects. - **Edge Selection Mechanisms**: - **Plane Selection**: Users can define a plane using a normal vector and distance parameters (`dmin` and `dmax`) to select edges within that plane. This is useful when the force should be applied uniformly across a specific region of the mesh. - **Explicit Indices/Edges List**: Edges can also be selected directly by specifying their indices or explicitly listing them, providing precise control over which edges receive the pressure force. - **Customization**: The intensity and direction of the applied pressures are customizable. Users can define a binormal to specify the orientation for 2D plane selection scenarios, making it flexible enough to handle various simulation needs. - **Visualization**: There is an option to visualize the forces as arrows in the graphical representation of the simulation, aiding in debugging and understanding the impact of applied pressures on the system. ### Integration into SOFA Framework: The EdgePressureForceField inherits from `core::behavior::ForceField`, which is a base class for components that apply forces or constraints to mechanical systems within SOFA. It integrates with SOFA's topology management, allowing it to adaptively apply forces based on the current state of the simulated object’s mesh. ### Use Cases: - **Fluid-Solid Interaction**: Simulating fluid flow over deformable surfaces where pressure is applied at various points or along certain edges of a structure. - **Biomechanical Modeling**: Applying pressures to specific parts of anatomical models, such as blood pressure forces on arteries in cardiovascular simulations. - **Material Testing**: Conducting virtual tests on materials under different pressures, particularly useful in the design and analysis phase for new material development. ### Technical Details: The component defines several data fields (e.g., `d_pressure`, `d_edgeIndices`, etc.) to configure how forces are applied. It also utilizes methods like `addForce` and `draw` to integrate with SOFA’s simulation pipeline, allowing it to modify the state of objects in real-time during a simulation run. ### Conclusion: The EdgePressureForceField is a powerful tool within the SOFA framework for applying controlled pressures on specific edges of a mesh. Its flexibility and customization options make it suitable for a wide range of simulation scenarios involving pressure-based forces.
- abstract
- The EdgePressureForceField applies pressure forces to edges of a mesh within the SOFA simulation environment, allowing precise control over edge selection and force application.
- sheet
- # EdgePressureForceField ## Overview The EdgePressureForceField is part of the `sofa::component::mechanicalload` namespace in the Sofa.Component.MechanicalLoad module. It inherits from `core::behavior::ForceField`, applying pressure forces to edges within a specified plane or based on explicit indices. ## Mathematical Model The force applied per unit area (pressure) is given by: \[ F_{i} = -P \cdot n_i \cdot A_i, \] where: - \( F_i \): Force vector at edge \( i \). - \( P \): Pressure intensity. - \( n_i \): Normal direction of the edge \( i \), a unit vector orthogonal to the edge. - \( A_i \): Length associated with edge \( i \). Edges are selected based on their position relative to a specified plane defined by normal vector \( n \) and distance parameters \( dmin \) and \( dmax \): \[ dmin \leq (p_i - o) \cdot n \leq dmax, \] where: - \( p_i \): Any point on the edge \( i \). - \( o \): Origin or reference point. ## Parameters and Data The significant data fields are: - **pressure**: Pressure force per unit area (`Deriv` type, default not specified). - **normal**: Normal direction for plane selection of edges (`Deriv` type, default not specified). - **dmin**: Minimum distance from the origin along the normal direction (`Real` type, default not specified). - **dmax**: Maximum distance from the origin along the normal direction (`Real` type, default not specified). - **arrowSizeCoef**: Size of drawn arrows (0 for no arrows, sign indicates drawing direction; `SReal` type, default not specified). - **binormal**: Binormal of the 2D plane (`Coord` type, default not specified). - **showForces**: Draw arrows representing edge pressures (`bool` type, default not specified). ## Dependencies and Connections The EdgePressureForceField requires a link to the topology container (`BaseMeshTopology`) for accessing mesh information.
- description
- The EdgePressureForceField class is part of the SOFA (Simulation Open-Framework Architecture) framework, which is used for modeling and simulation in various domains such as biomechanics and virtual reality. This specific component applies pressure forces to edges of a mesh or structure within the simulation environment. ### Key Features: - **Force Application**: It allows users to apply pressure forces on selected edges of a mesh. The force can be specified per unit area, allowing for realistic simulations involving pressures such as fluid interaction with deformable objects. - **Edge Selection Mechanisms**: - **Plane Selection**: Users can define a plane using a normal vector and distance parameters (`dmin` and `dmax`) to select edges within that plane. This is useful when the force should be applied uniformly across a specific region of the mesh. - **Explicit Indices/Edges List**: Edges can also be selected directly by specifying their indices or explicitly listing them, providing precise control over which edges receive the pressure force. - **Customization**: The intensity and direction of the applied pressures are customizable. Users can define a binormal to specify the orientation for 2D plane selection scenarios, making it flexible enough to handle various simulation needs. - **Visualization**: There is an option to visualize the forces as arrows in the graphical representation of the simulation, aiding in debugging and understanding the impact of applied pressures on the system. ### Integration into SOFA Framework: The EdgePressureForceField inherits from `core::behavior::ForceField`, which is a base class for components that apply forces or constraints to mechanical systems within SOFA. It integrates with SOFA's topology management, allowing it to adaptively apply forces based on the current state of the simulated object’s mesh. ### Use Cases: - **Fluid-Solid Interaction**: Simulating fluid flow over deformable surfaces where pressure is applied at various points or along certain edges of a structure. - **Biomechanical Modeling**: Applying pressures to specific parts of anatomical models, such as blood pressure forces on arteries in cardiovascular simulations. - **Material Testing**: Conducting virtual tests on materials under different pressures, particularly useful in the design and analysis phase for new material development. ### Technical Details: The component defines several data fields (e.g., `d_pressure`, `d_edgeIndices`, etc.) to configure how forces are applied. It also utilizes methods like `addForce` and `draw` to integrate with SOFA’s simulation pipeline, allowing it to modify the state of objects in real-time during a simulation run. ### Conclusion: The EdgePressureForceField is a powerful tool within the SOFA framework for applying controlled pressures on specific edges of a mesh. Its flexibility and customization options make it suitable for a wide range of simulation scenarios involving pressure-based forces.
- summary
- EdgePressureForceField is a component in the SOFA framework that applies pressure forces to selected edges of a mesh, offering plane selection and explicit edge index specification mechanisms. It supports custom force intensity and direction settings and can visualize applied forces as arrows. This makes it ideal for simulations like fluid-solid interactions and biomechanical modeling.
- maths
- <h2>Mathematical and Physical Description of EdgePressureForceField</h2> <h3>Introduction</h3> <p>The <code>EdgePressureForceField</code> is a component in the SOFA (Simulation Open-Framework Architecture) framework designed to apply pressure forces along edges of a mesh. This type of force field can be used in various simulation scenarios, such as fluid-structure interactions or biomechanical modeling where precise control over edge pressures is necessary.</p> <h3>Mathematical Formulation</h3> <p>The primary goal of this component is to apply forces per unit area (pressure) on selected edges. The force applied can be mathematically represented as:</p> \[ F_{i} = -P \cdot n_i \cdot A_i, \] <ul> <li><strong>\( F_i \)</strong>: Force vector at edge <span class="math-inline">\( i \)</span>.</li> <li><strong>\( P \)</strong>: Pressure intensity (scalar value).</li> <li><strong>\( n_i \)</strong>: Normal direction of the edge <span class="math-inline">\( i \)</span>. This is typically a unit vector orthogonal to the edge.</li> <li><strong>\( A_i \)</strong>: Area (or length) associated with edge <span class="math-inline">\( i \)</span>.</li> </ul> <p>Note that in 3D, edges do not have a straightforward area, but the concept can be generalized to lengths for simplicity.</p> <h4>Edge Selection Mechanisms</h4> <p>The component provides several ways to select which edges receive pressure forces:</p> <ul> <li><strong>Plane Selection:</strong> Edges lying within a specified plane are selected. The plane is defined by a normal vector <span class="math-inline">\( n \)</span> and distance parameters <code>dmin</code> and <code>dmax</code>, which represent the minimum and maximum distances from the origin along the normal direction.</li> <li><strong>Explicit Indices or Edges List:</strong> Users can provide specific edge indices or a list of edges directly, allowing precise control over force application.</li> </ul> <p>The condition for an edge to be within the selected plane is given by:</p> \[ dmin \leq (p_i - o) \cdot n \leq dmax, \] <ul> <li><strong>\( p_i \)</strong>: Any point on the edge <span class="math-inline">\( i \)</span>.</li> <li><strong>\( o \)</strong>: Origin or reference point (typically the origin).</li> </ul> <h3>Physical Interpretation</h3> <p>The physical interpretation of applying a pressure force along an edge involves understanding how this affects the overall dynamics and deformation of the structure. Pressure forces can induce both linear and rotational effects, depending on their orientation relative to the object’s geometry.</p> <ul> <li><strong>Linear Effects:</strong> When the normal direction <span class="math-inline">\( n_i \)</span> is consistent with the global coordinate system, the force acts purely along that direction, causing linear deformation or displacement of the edge and its adjacent vertices.</li> <li><strong>Rotational Effects:</strong> If multiple edges receive pressure forces in different directions (or if the object’s geometry is complex), rotational effects can arise. This can lead to twisting or bending deformations depending on the distribution and magnitude of applied pressures.</li> </ul> <p>The overall effect of these forces depends heavily on the underlying mechanical properties of the material being simulated, such as its stiffness, density, and boundary conditions.</p> <h3>Visualization</h3> <p>To aid in understanding the distribution and magnitude of applied pressures, the component allows for visualization via arrow representations. These arrows can be scaled based on the force magnitude and oriented along the normal direction <span class="math-inline">\( n_i \)</span>.</p>
{
"name": "EdgePressureForceField",
"main": {
"name": "EdgePressureForceField",
"namespace": "sofa::component::mechanicalload",
"module": "Sofa.Component.MechanicalLoad",
"include": "sofa/component/mechanicalload/EdgePressureForceField.h",
"doc": "Apply a force on edges, distributed on the edge nodes.",
"inherits": [
"ForceField"
],
"templates": [
"sofa::defaulttype::Vec3Types"
],
"data_fields": [
{
"name": "d_pressure",
"type": "Deriv",
"xmlname": "pressure",
"help": "Pressure force per unit area"
},
{
"name": "d_normal",
"type": "Deriv",
"xmlname": "normal",
"help": "Normal direction for the plane selection of edges"
},
{
"name": "d_dmin",
"type": "Real",
"xmlname": "dmin",
"help": "Minimum distance from the origin along the normal direction"
},
{
"name": "d_dmax",
"type": "Real",
"xmlname": "dmax",
"help": "Maximum distance from the origin along the normal direction"
},
{
"name": "d_arrowSizeCoef",
"type": "SReal",
"xmlname": "arrowSizeCoef",
"help": "Size of the drawn arrows (0->no arrows, sign->direction of drawing"
},
{
"name": "d_binormal",
"type": "Coord",
"xmlname": "binormal",
"help": "Binormal of the 2D plane"
},
{
"name": "d_showForces",
"type": "bool",
"xmlname": "showForces",
"help": "draw arrows of edge pressures"
}
],
"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": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addForce",
"return_type": "void",
"params": [
{
"name": "",
"type": "const sofa::core::MechanicalParams *"
},
{
"name": "dataF",
"type": "DataVecDeriv &"
},
{
"name": "dataX",
"type": "const DataVecCoord &"
},
{
"name": "dataV",
"type": "const DataVecDeriv &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addDForce",
"return_type": "void",
"params": [
{
"name": "mparams",
"type": "const core::MechanicalParams *"
},
{
"name": "",
"type": "DataVecDeriv &"
},
{
"name": "",
"type": "const DataVecDeriv &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPotentialEnergy",
"return_type": "SReal",
"params": [
{
"name": "",
"type": "const core::MechanicalParams *"
},
{
"name": "",
"type": "const DataVecCoord &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "draw",
"return_type": "void",
"params": [
{
"name": "vparams",
"type": "const core::visual::VisualParams *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setDminAndDmax",
"return_type": "void",
"params": [
{
"name": "_dmin",
"type": "const SReal"
},
{
"name": "_dmax",
"type": "const SReal"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setNormal",
"return_type": "void",
"params": [
{
"name": "n",
"type": "const Coord"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setPressure",
"return_type": "void",
"params": [
{
"name": "_pressure",
"type": "Deriv"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "buildStiffnessMatrix",
"return_type": "void",
"params": [
{
"name": "matrix",
"type": "core::behavior::StiffnessMatrix *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "buildDampingMatrix",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::DampingMatrix *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "selectEdgesAlongPlane",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "selectEdgesFromIndices",
"return_type": "void",
"params": [
{
"name": "inputIndices",
"type": "const int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "selectEdgesFromString",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "selectEdgesFromEdgeList",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "updateEdgeInformation",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "initEdgeInformation",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "isPointInPlane",
"return_type": "bool",
"params": [
{
"name": "p",
"type": "Coord"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
}
]
},
"desc": {
"description": "The EdgePressureForceField class is part of the SOFA (Simulation Open-Framework Architecture) framework, which is used for modeling and simulation in various domains such as biomechanics and virtual reality. This specific component applies pressure forces to edges of a mesh or structure within the simulation environment.\n\n### Key Features:\n\n- **Force Application**: It allows users to apply pressure forces on selected edges of a mesh. The force can be specified per unit area, allowing for realistic simulations involving pressures such as fluid interaction with deformable objects.\n\n- **Edge Selection Mechanisms**:\n - **Plane Selection**: Users can define a plane using a normal vector and distance parameters (`dmin` and `dmax`) to select edges within that plane. This is useful when the force should be applied uniformly across a specific region of the mesh.\n - **Explicit Indices/Edges List**: Edges can also be selected directly by specifying their indices or explicitly listing them, providing precise control over which edges receive the pressure force.\n\n- **Customization**: The intensity and direction of the applied pressures are customizable. Users can define a binormal to specify the orientation for 2D plane selection scenarios, making it flexible enough to handle various simulation needs.\n\n- **Visualization**: There is an option to visualize the forces as arrows in the graphical representation of the simulation, aiding in debugging and understanding the impact of applied pressures on the system.\n\n### Integration into SOFA Framework:\n\nThe EdgePressureForceField inherits from `core::behavior::ForceField`, which is a base class for components that apply forces or constraints to mechanical systems within SOFA. It integrates with SOFA's topology management, allowing it to adaptively apply forces based on the current state of the simulated object’s mesh.\n\n### Use Cases:\n\n- **Fluid-Solid Interaction**: Simulating fluid flow over deformable surfaces where pressure is applied at various points or along certain edges of a structure.\n- **Biomechanical Modeling**: Applying pressures to specific parts of anatomical models, such as blood pressure forces on arteries in cardiovascular simulations.\n- **Material Testing**: Conducting virtual tests on materials under different pressures, particularly useful in the design and analysis phase for new material development.\n\n### Technical Details:\n\nThe component defines several data fields (e.g., `d_pressure`, `d_edgeIndices`, etc.) to configure how forces are applied. It also utilizes methods like `addForce` and `draw` to integrate with SOFA’s simulation pipeline, allowing it to modify the state of objects in real-time during a simulation run.\n\n### Conclusion:\n\nThe EdgePressureForceField is a powerful tool within the SOFA framework for applying controlled pressures on specific edges of a mesh. Its flexibility and customization options make it suitable for a wide range of simulation scenarios involving pressure-based forces.",
"summary": "EdgePressureForceField is a component in the SOFA framework that applies pressure forces to selected edges of a mesh, offering plane selection and explicit edge index specification mechanisms. It supports custom force intensity and direction settings and can visualize applied forces as arrows. This makes it ideal for simulations like fluid-solid interactions and biomechanical modeling."
},
"maths": {
"maths": "<h2>Mathematical and Physical Description of EdgePressureForceField</h2>\n\n<h3>Introduction</h3>\n<p>The <code>EdgePressureForceField</code> is a component in the SOFA (Simulation Open-Framework Architecture) framework designed to apply pressure forces along edges of a mesh. This type of force field can be used in various simulation scenarios, such as fluid-structure interactions or biomechanical modeling where precise control over edge pressures is necessary.</p>\n\n<h3>Mathematical Formulation</h3>\n<p>The primary goal of this component is to apply forces per unit area (pressure) on selected edges. The force applied can be mathematically represented as:</p>\n\\[\nF_{i} = -P \\cdot n_i \\cdot A_i,\n\\]\n\n<ul>\n<li><strong>\\( F_i \\)</strong>: Force vector at edge <span class=\"math-inline\">\\( i \\)</span>.</li>\n<li><strong>\\( P \\)</strong>: Pressure intensity (scalar value).</li>\n<li><strong>\\( n_i \\)</strong>: Normal direction of the edge <span class=\"math-inline\">\\( i \\)</span>. This is typically a unit vector orthogonal to the edge.</li>\n<li><strong>\\( A_i \\)</strong>: Area (or length) associated with edge <span class=\"math-inline\">\\( i \\)</span>.</li>\n</ul>\n\n<p>Note that in 3D, edges do not have a straightforward area, but the concept can be generalized to lengths for simplicity.</p>\n\n<h4>Edge Selection Mechanisms</h4>\n<p>The component provides several ways to select which edges receive pressure forces:</p>\n\n<ul>\n<li><strong>Plane Selection:</strong> Edges lying within a specified plane are selected. The plane is defined by a normal vector <span class=\"math-inline\">\\( n \\)</span> and distance parameters <code>dmin</code> and <code>dmax</code>, which represent the minimum and maximum distances from the origin along the normal direction.</li>\n<li><strong>Explicit Indices or Edges List:</strong> Users can provide specific edge indices or a list of edges directly, allowing precise control over force application.</li>\n</ul>\n\n<p>The condition for an edge to be within the selected plane is given by:</p>\n\\[\ndmin \\leq (p_i - o) \\cdot n \\leq dmax,\n\\]\n\n<ul>\n<li><strong>\\( p_i \\)</strong>: Any point on the edge <span class=\"math-inline\">\\( i \\)</span>.</li>\n<li><strong>\\( o \\)</strong>: Origin or reference point (typically the origin).</li>\n</ul>\n\n<h3>Physical Interpretation</h3>\n<p>The physical interpretation of applying a pressure force along an edge involves understanding how this affects the overall dynamics and deformation of the structure. Pressure forces can induce both linear and rotational effects, depending on their orientation relative to the object’s geometry.</p>\n\n<ul>\n<li><strong>Linear Effects:</strong> When the normal direction <span class=\"math-inline\">\\( n_i \\)</span> is consistent with the global coordinate system, the force acts purely along that direction, causing linear deformation or displacement of the edge and its adjacent vertices.</li>\n<li><strong>Rotational Effects:</strong> If multiple edges receive pressure forces in different directions (or if the object’s geometry is complex), rotational effects can arise. This can lead to twisting or bending deformations depending on the distribution and magnitude of applied pressures.</li>\n</ul>\n\n<p>The overall effect of these forces depends heavily on the underlying mechanical properties of the material being simulated, such as its stiffness, density, and boundary conditions.</p>\n\n<h3>Visualization</h3>\n<p>To aid in understanding the distribution and magnitude of applied pressures, the component allows for visualization via arrow representations. These arrows can be scaled based on the force magnitude and oriented along the normal direction <span class=\"math-inline\">\\( n_i \\)</span>.</p>"
},
"summary": {
"abstract": "The EdgePressureForceField applies pressure forces to edges of a mesh within the SOFA simulation environment, allowing precise control over edge selection and force application.",
"sheet": "# EdgePressureForceField\n\n## Overview\nThe EdgePressureForceField is part of the `sofa::component::mechanicalload` namespace in the Sofa.Component.MechanicalLoad module. It inherits from `core::behavior::ForceField`, applying pressure forces to edges within a specified plane or based on explicit indices.\n\n## Mathematical Model\nThe force applied per unit area (pressure) is given by:\n\\[\nF_{i} = -P \\cdot n_i \\cdot A_i,\n\\]\nwhere:\n- \\( F_i \\): Force vector at edge \\( i \\).\n- \\( P \\): Pressure intensity.\n- \\( n_i \\): Normal direction of the edge \\( i \\), a unit vector orthogonal to the edge.\n- \\( A_i \\): Length associated with edge \\( i \\).\n\nEdges are selected based on their position relative to a specified plane defined by normal vector \\( n \\) and distance parameters \\( dmin \\) and \\( dmax \\):\n\\[\ndmin \\leq (p_i - o) \\cdot n \\leq dmax,\n\\]\nwhere:\n- \\( p_i \\): Any point on the edge \\( i \\).\n- \\( o \\): Origin or reference point.\n\n## Parameters and Data\nThe significant data fields are:\n- **pressure**: Pressure force per unit area (`Deriv` type, default not specified).\n- **normal**: Normal direction for plane selection of edges (`Deriv` type, default not specified).\n- **dmin**: Minimum distance from the origin along the normal direction (`Real` type, default not specified).\n- **dmax**: Maximum distance from the origin along the normal direction (`Real` type, default not specified).\n- **arrowSizeCoef**: Size of drawn arrows (0 for no arrows, sign indicates drawing direction; `SReal` type, default not specified).\n- **binormal**: Binormal of the 2D plane (`Coord` type, default not specified).\n- **showForces**: Draw arrows representing edge pressures (`bool` type, default not specified).\n\n## Dependencies and Connections\nThe EdgePressureForceField requires a link to the topology container (`BaseMeshTopology`) for accessing mesh information."
}
}