Closed Capedvilla closed 1 month ago
pip install --upgrade --upgrade-strategy eager ansys-mapdl-core
Here is the code of ansys apdl:
FINISH /SOLU ANTYPE,TRANS TRNOPT,FULL lumpm,off *dim,aceX,table,751,1 *creat,ei_wv *vread,aceX(1,1),Imva10_acc,txt,,1 (f14.9) *vread,aceX(1,0),Imva10_t,txt,,1 (f5.2) aceX(0,1)=1 *end /input,ei_wv TM_START=0.02 TM_END=1 TM_INCR=0.02 *DO,TM,TM_START,TM_END,TM_INCR TIME,TM KBC,0 NSUB,1 ACEL,,aceX(TM), allsel SOLVE *ENDDO finish
I want translate it in pymapdl , here is what I facing:
mapdl.finish() # Enter solution mode mapdl.run("/SOLU") mapdl.antype('TRANS') mapdl.trnopt('FULL') mapdl.kbc(0) # Linear ramping of loading # Importing acceleration data mapdl.lumpm('OFF') acceleration_data = np.loadtxt('Imva10_acc.txt') time_data = np.loadtxt('Imva10_t.txt') earthquake_data = np.column_stack((time_data, acceleration_data)) mapdl.load_table('earthquake_jiasudu_apdl', earthquake_data, 'TIME') print(mapdl.parameters['earthquake_jiasudu_apdl']) mapdl.parameters["aceX"] = earthquake_data mapdl.parameters["acc"] = acceleration_data # Analysis setup tm_start = 0.02 tm_end = 1 tm_incr = 0.02 for tm in np.arange(tm_start, tm_end+tm_incr , tm_incr): mapdl.time(tm) mapdl.kbc(0) # Linear ramping of loading mapdl.nsubst(1) # Setting number of substeps mapdl.acel(['',mapdl.parameters['earthquake_jiasudu_apdl'][tm],'']) mapdl.allsel() mapdl.solve() mapdl.finish()
The mapdl.acel seems not easy to apply, in apdl there is aceX(TM), which seems not the accelerate data, how can I do
The log will automatically be formatted as Python code! No need to type backticks.
Windows
3.9
2021R1
π€ Before submitting the issue
pip install --upgrade --upgrade-strategy eager ansys-mapdl-core
in your activated virtual environment.π Description of the bug
Here is the code of ansys apdl:
I want translate it in pymapdl , here is what I facing:
The mapdl.acel seems not easy to apply, in apdl there is aceX(TM), which seems not the accelerate data, how can I do
π΅οΈ Steps To Reproduce
π» Which Operating System are you using?
Windows
π Which Python version are you using?
3.9
πΎ Which MAPDL version are you using?
2021R1
π PyMAPDL Report
Show the Report!
```text # PASTE HERE THE OUTPUT OF `python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"` here ```π Installed packages
Show the installed packages!
```text # PASTE HERE THE OUTPUT OF `python -m pip freeze` here ```π Logger output file
Show the logger output file.
```text # PASTE HERE THE CONTENT OF THE LOGGER OUTPUT FILE. ```