|
6 | 6 | # TODO : use the massDensity ONLY and deduce totalMass if necessary from it + volume |
7 | 7 |
|
8 | 8 | @ReusableMethod |
9 | | -def addMass(node, elem:ElementType, totalMass=DEFAULT_VALUE, massDensity=DEFAULT_VALUE, lumping=DEFAULT_VALUE, **kwargs): |
| 9 | +def addMass(node, elem:ElementType, totalMass=DEFAULT_VALUE, massDensity=DEFAULT_VALUE, lumping=DEFAULT_VALUE, topology=DEFAULT_VALUE, **kwargs): |
10 | 10 | if (not isDefault(totalMass)) and (not isDefault(massDensity)) : |
11 | 11 | print("[warning] You defined the totalMass and the massDensity in the same time, only taking massDensity into account") |
12 | 12 | del kwargs["massDensity"] |
13 | 13 |
|
14 | | - # if(elem !=ElementType.POINTS and elem !=ElementType.EDGES): |
15 | | - # node.addObject("MeshMatrixMass",name="mass", totalMass=totalMass, massDensity=massDensity, lumping=lumping, **kwargs) |
16 | | - # else: |
17 | | - # if (not isDefault(massDensity)) : |
18 | | - # print("[warning] mass density can only be used on a surface or volumetric topology. Please use totalMass instead") |
19 | | - # if (not isDefault(lumping)) : |
20 | | - # print("[warning] lumping can only be set for surface or volumetric topology") |
| 14 | + if(elem !=ElementType.POINTS and elem !=ElementType.EDGES): |
| 15 | + node.addObject("MeshMatrixMass",name="mass", totalMass=totalMass, massDensity=massDensity, lumping=lumping, topology=topology, **kwargs) |
| 16 | + else: |
| 17 | + if (not isDefault(massDensity)) : |
| 18 | + print("[warning] mass density can only be used on a surface or volumetric topology. Please use totalMass instead") |
| 19 | + if (not isDefault(lumping)) : |
| 20 | + print("[warning] lumping can only be set for surface or volumetric topology") |
21 | 21 |
|
22 | | - node.addObject("UniformMass",name="mass", totalMass=totalMass, **kwargs) |
| 22 | + node.addObject("UniformMass",name="mass", totalMass=totalMass, topology=topology,**kwargs) |
23 | 23 |
|
0 commit comments