Clear Filters
Clear Filters

How can I import a mesh / nodes from Matlab into Ansys?

8 views (last 30 days)
Hi there
May you have any advice how I can create an input file which can be used by Ansys for further analysis?
My aim is to set-up a script to parametrise my model and then automatically alter all the parameters and execute the analysis in Ansys.
My initial draft from last year is generating an ABAQUS input file, but I couldn´t find any information how I can import into Ansys.
Example of my draft (Matlab + main file) and the import of the rolled-up structure in ABAQUS attached:
  2 Comments
Dyuman Joshi
Dyuman Joshi on 8 Dec 2023
Please copy and paste the code here, as the image is not clear.
Florian
Florian on 8 Dec 2023
Code in Matlab:
file=fopen('nodes.inp','w');
fprintf(file,'%12.f, %12.8f, %12.8f, %12.8f\n',nodes');
fclose(file);
file=fopen('elements.inp','w');
fprintf(file,'%12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f\n',elements');
fclose(file);
file=fopen('sets.inp','w');
for i=1:1:length(sets)
fprintf(file,['*Elset, elset=set',num2str(i),'\n'],elements');
fprintf(file,'%12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f, %12.f\n',sets{1,i}');
fprintf(file,'\n');
end
fclose(file);
Code in main:
*Node
*Include, input=nodes.inp
*Element, type=C3D8
*Include, input=elements.inp
*Include, input=sets.inp

Sign in to comment.

Answers (0)

Categories

Find more on Automotive in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!