[Scons-users] SCons for Ansys APDL Analysis

Bill Deegan bill at baddogconsulting.com
Tue Oct 25 13:51:54 EDT 2022


On Tue, Oct 18, 2022 at 10:44 AM Hubley, Christopher (GE Aerospace, US) <
Christopher.Hubley at ge.com> wrote:

> > So it looks like you can scan the input file to find the dependencies.
> I'm sure that you could, but I think it'd take a bit of noodling be tough
> to
> make it bulletproof.
> There aren't namespaces in APDL. If I read in another file with the /INPUT
> command, it just executes The code in that file. So, a scanner might have
> to
> descend into dependencies to look for more dependencies.
>

That's what scanners do.. (recursively scan for dependencies) So that
wouldn't be a problem.


>
>
> > Though it writes to it's input file?
> There is typically a binary database file which is a dependency of a
> APDL script. The database contains FEM nodes, elements, boundary
> conditions,
> model settings, etc.
> When running a mission analysis, we will update this database for each time
> step. When the model is solved, Ansys creates a second results database,
> and
> Some other files (restart files, etc.). A mission might include hundreds of
> timesteps.
>
>
ok so initial database is a source, and there's a separate db file which is
a target.


>
> > Can you get it to write to a different named file?
> Yes, you can copy/rename the input file to a new filename within the
> script.
> I think that this kind of coding discipline would be required for SCons.
>
> Perhaps a SCons-compatible APDL script might look something like this:
>
>     ! MyFile.inp
>     /COPY, path/to/PREV_DATABASE,   db,, DATABASE_NAME,   db   ! <- An
> input
>     /COPY, path/to/PREV_DATABASE, emat,, DATABASE_NAME, emat   ! <- An
> input
>     /COPY, path/to/PREV_DATABASE, esav,, DATABASE_NAME, esav   ! <- An
> input
>     /FILENAM, DATABASE_NAME
>     RESUME
>
>     /SOLU
>         ANTYPE, STATIC, RESTART
>         /INPUT, cut_boundary_loads, inp   ! <- An input
>         /INPUT, nodal_temperatures, inp   ! <- An input
>         /INPUT, pressure_loads, inp   ! <- An input
>         SOLVE   ! <- Creates a results database (DATABASE_NAME.rst, .emat,
> .esav)
>                 !    and other files
>     FINISH
>     SAVE ! Updates DATABASE_NAME.db
>
>
> One issue that I have is that I'd like to understand what SCons is doing
> when I
> set "duplicate=False".
>

Duplicate = False tells SCons not to duplicate any of the files from the
source of the variant dir into the variant dir (either copy, hard or soft
link depending on options set and the OS).



>
> I've only gotten Ansys to run with "duplicate=True", but then that leaves
> me
> with a bunch of extra files in my build directory. It'd be great if I
> could
> clean that up afterwards without SCons requiring a rebuild.
>

You most likely cannot.
If you clean those files (in variant dir when duplicate=True), and then run
scons --debug=explain, why does it say it's rebuilding?
I'd guess it's your DB file which is changed during your build? (and also a
source)..

You could specify the source files as being in the source (of the variant
dir) and then duplicate=False.
That should work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20221025/17323b1e/attachment.htm>


More information about the Scons-users mailing list