Pipe Assembly Lab v1.1: validated viscous damping, comparison and project delivery (part 2)
757df37 verified Download source/dynamic_batch.cjs from HaomingLuo/AgentFEM-Pipe-Components: direct link, hf CLI and curl.
- Browser
- Download file 664 Bytes
-
https://huggingface.co/datasets/HaomingLuo/AgentFEM-Pipe-Components/resolve/main/source/dynamic_batch.cjs
- Command line
-
hf download hf://datasets/HaomingLuo/AgentFEM-Pipe-Components/source/dynamic_batch.cjs
-
curl -L -o dynamic_batch.cjs https://huggingface.co/datasets/HaomingLuo/AgentFEM-Pipe-Components/resolve/main/source/dynamic_batch.cjs
664 Bytes
| const fs=require('node:fs'),{solve}=require('../web/solver.js'); | |
| const root=require('node:path').join(__dirname,'..'); | |
| const requests=JSON.parse(fs.readFileSync(process.argv[2],'utf8')); | |
| const cache={};const output=[]; | |
| for(const row of requests){try{const components=row.component_ids.map(id=>cache[id]||(cache[id]=JSON.parse(fs.readFileSync(root+'/web/data/'+id+'.json','utf8'))));const result=solve({...row,components});output.push({...row,result});}catch(e){console.error(row.id,e.message,e.stack.split('\n').slice(1).join('\n'));process.exit(1);}} | |
| fs.writeFileSync(process.argv[3],JSON.stringify(output));console.log('Solved dynamic requests:',output.length); | |