chrono::fea::ChDrawerTetrahedron_4 Class Reference

Description

Drawing function to draw a ChFieldElementTetrahedron_4 finite element.

Allows a 3D visualization of the finite element in real time rendering, raytraced postprocessing, etc.

#include <ChDrawer.h>

Inheritance diagram for chrono::fea::ChDrawerTetrahedron_4:
Collaboration diagram for chrono::fea::ChDrawerTetrahedron_4:

Public Member Functions

virtual void IncrementBufferSizes (ChFieldElement &melement, size_t &num_vertexes, size_t &num_triangles, size_t &num_normals) const
 This method takes a ChFieldElement and increments the counters of total used number of triangle vertexes, number of triangles, number of normals, used in a triangle mesh that shows the shape of the finite element. More...
 
virtual void UpdateBuffers (ChFieldElement &melement, ChTriangleMeshConnected &mmesh, size_t &vert_offset, size_t &tri_offset, size_t &norm_offset) const
 This method takes a ChFieldElement and, given a ChTriangleMeshConnected& mmesh, does this: 1) per each triangle from tri_offset sets the indexes in mmesh.GetIndicesVertexes() to 3 triangle vertexes; 2) per each triangle from tri_offset sets the indexes in mmesh.GetIndicesNormals() to 3 triangle normals; 3) per each normal from norm_offset sets its value in mmesh.GetCoordsNormals() (can be automated via ChDrawer::AutoComputeNormals()); Assumes there is no need to update the position of vertexes in mmesh.GetCoordsVertices() because already update by the caller, that sets the first N triangle vertices as the N finite element nodes - and same for N colors in mmesh.GetCoordsColors(), and N scalars/vectors/etc in myproperty.data of all properties in mmesh.GetPropertiesPerVertex(). More...
 

Additional Inherited Members

- Protected Member Functions inherited from chrono::fea::ChDrawer
void AutoComputeNormals (ChTriangleMeshConnected &mmesh, const size_t tri_offset, const size_t norm_offset, const size_t num_triangles, const size_t num_normals) const
 This is a helper function that can be called at the end of each element's UpdateBuffers(), to avoid setting all normals with ad-hoc formulas. More...
 

Member Function Documentation

◆ IncrementBufferSizes()

virtual void chrono::fea::ChDrawerTetrahedron_4::IncrementBufferSizes ( ChFieldElement melement,
size_t &  num_vertexes,
size_t &  num_triangles,
size_t &  num_normals 
) const
inlinevirtual

This method takes a ChFieldElement and increments the counters of total used number of triangle vertexes, number of triangles, number of normals, used in a triangle mesh that shows the shape of the finite element.

This function is called on all finite elements, to get the total amount of vertexes, triangles etc. in a ChTriangleMeshConnected that will be used to show finite elements on the screen.

Implements chrono::fea::ChDrawer.

◆ UpdateBuffers()

virtual void chrono::fea::ChDrawerTetrahedron_4::UpdateBuffers ( ChFieldElement melement,
ChTriangleMeshConnected mmesh,
size_t &  vert_offset,
size_t &  tri_offset,
size_t &  norm_offset 
) const
inlinevirtual

This method takes a ChFieldElement and, given a ChTriangleMeshConnected& mmesh, does this: 1) per each triangle from tri_offset sets the indexes in mmesh.GetIndicesVertexes() to 3 triangle vertexes; 2) per each triangle from tri_offset sets the indexes in mmesh.GetIndicesNormals() to 3 triangle normals; 3) per each normal from norm_offset sets its value in mmesh.GetCoordsNormals() (can be automated via ChDrawer::AutoComputeNormals()); Assumes there is no need to update the position of vertexes in mmesh.GetCoordsVertices() because already update by the caller, that sets the first N triangle vertices as the N finite element nodes - and same for N colors in mmesh.GetCoordsColors(), and N scalars/vectors/etc in myproperty.data of all properties in mmesh.GetPropertiesPerVertex().

However, if one has more triangle vertexes than N element nodes, there could be an additional task: 4) (optional) per each vertex beyond the N element nodes, interpolate position/color/properties by looking at values already updated in the position/color/properties of the first N vertexes of the mmesh, starting from vert_offset.

Implements chrono::fea::ChDrawer.


The documentation for this class was generated from the following file:
  • /builds/uwsbel/chrono/src/chrono/fea/ChDrawer.h