SelfweightCalculator
- class compas_fd.loads.SelfweightCalculator
Bases:
object
Class for computing the selfweight of a mesh representing a surface structure with a specific density and thickness.
After construction, the calculator provides a callable that can be used to compute the selfweight for the current mesh coordinates.
- Parameters:
- mesh
compas.datastructures.Mesh
The mesh representing a surface structure.
- densityfloat, optional
The density of the surface material.
- thickness_attr_namestr, optional
The name of the vertex attribute storing the surface thickness.
- mesh
Examples
>>> from compas.datastructures import Mesh >>> from compas_fd.loads import SelfWeightCalculator >>> mesh = Mesh.from_meshgrid(dx=10, nx=10) >>> mesh.update_default_vertex_attributes(t=0.10) >>> density = 22 >>> calculator = SelfweightCalculator(mesh, density=density) >>> xyz = mesh.vertices_attributes("xyz") >>> selfweight = calculator(xyz) >>> len(selfweight) == mesh.number_of_vertices() True >>> selfweight[0] == 0.25 * density True
Methods
Compute the face matrix of the mesh.
Compute the tributary are of every vertex for the current coordinates.