MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / get_material_tensor

Method get_material_tensor

python/pymesh/material.py:50–60  ·  view source on GitHub ↗

Return 4th order material tensor of size d x d x d x d evaluated at coord.

(self, coord)

Source from the content-addressed store, hash-verified

48 return self.raw_material.strain_to_stress(strain, coord)
49
50 def get_material_tensor(self, coord):
51 """ Return 4th order material tensor of size d x d x d x d evaluated at
52 coord.
53 """
54 tensor = np.empty([self.dim, self.dim, self.dim, self.dim])
55 indices = np.arange(self.dim)
56 I,J,K,L = np.meshgrid(indices, indices, indices, indices)
57 for i,j,k,l in zip(I.ravel(), J.ravel(), K.ravel(), L.ravel()):
58 tensor[i,j,k,l] = self.raw_material.get_material_tensor(
59 int(i),int(j),int(k),int(l),coord)
60 return tensor
61
62 def get_density(self, coord):
63 return self.raw_material.get_density(coord)

Callers 1

material_tensorMethod · 0.95

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected