Download example.py from HaomingLuo/AgentFEM-Pipe-ROM: direct link, hf CLI and curl.
- Browser
- Download file 747 Bytes
-
https://huggingface.co/HaomingLuo/AgentFEM-Pipe-ROM/resolve/main/example.py
- Command line
-
hf download hf://HaomingLuo/AgentFEM-Pipe-ROM/example.py
-
curl -L -o example.py https://huggingface.co/HaomingLuo/AgentFEM-Pipe-ROM/resolve/main/example.py
747 Bytes
| """Run from the downloaded Model repository. Apache-2.0.""" | |
| from pipe_rom import pipe | |
| import numpy as np | |
| result=pipe(['straight-d200-t06-r5','elbow-d200-t06-r2','straight-d200-t06-r5']) | |
| print('Natural frequencies / Hz:',result['frequency']) | |
| print('Tip displacement / mm:',result['displacements'][-1][-1]*1000) | |
| print('Maximum centreline displacement / mm:', | |
| max(np.linalg.norm(v,axis=1).max() for v in result['displacements'])*1000) | |
| # Add a vertical spring at the outlet (global z direction): | |
| supported=pipe(['straight-d200-t06-r5','elbow-d200-t06-r2','straight-d200-t06-r5'], | |
| supports=[{'node':0,'fixed':[0,1,2,3,4,5]}, | |
| {'node':3,'spring':[0,0,100000,0,0,0]}]) | |
| print('With 100 kN/m outlet spring / Hz:',supported['frequency']) | |