I am writing an ACT extension to encapsulate a custom result and need to take the derivative of that
October 4, 2017 at 12:20 pmVishal GanoreAnsys EmployeeThere are two main options here: Create the derivative yourself in Python, or call out to APDL to invoke the DERIV command. If creating the derivative yourself, it will require some numerical programming as (unfortunately) ACT's Python does not have access to SciPy. If calling APDL, note that ansys.RunANSYS() might not won't work in an Evaluate or Generate callback due to a threading issue. It probably will, but if not, here is how to do it without "import ansys" capabilities: --------------- import Ansys.Utilities from Ansys.Utilities import ApplicationConfiguration import System from System.Diagnostics import Process from System.Diagnostics import ProcessStartInfo from System.Diagnostics import ProcessWindowStyle # Create a tmp bat file in this path bat_file = System.IO.Path.Combine(apdlDir,'tmp.bat'); info = System.IO.StreamWriter(bat_file) a = ApplicationConfiguration.DefaultConfiguration.AwpRootEnvironmentVariableValue b = System.IO.Path.Combine(a,'ansys') c = System.IO.Path.Combine(b,'bin') d = System.IO.Path.Combine(c,ApplicationConfiguration.DefaultConfiguration.AnsysPlatform) e = System.IO.Path.Combine(d,'ansys162.exe') commandLine = '"'+e+'" -dir "'+apdlDir+'" -j "file" -b -i "'+apdlInput+'" -o "'+apdlOutput+'"' info.WriteLine(commandLine) info.Close() # Run the bat file now startInfo = ProcessStartInfo(bat_file, None) startInfo.WindowStyle = ProcessWindowStyle.Minimized p = Process.Start(startInfo) p.WaitForExit() # Delete the tmp bat file System.IO.File.Delete(bat_file) --------------- In this code, we create a tmp file with the command we want, and execute it with ANSYS. A nice way to get any APDL functionality in your ACT code.
- You must be logged in to reply to this topic.
Simulation World 2022
Earth Rescue – An Ansys Online Series
- How to deal with the error message about “You have specified result time (or frequency) = xxxx for a
- Any suggestions on speeding up convergence behavior with surface-to-surface radiation?
- What is cause of error: display time for result item greater than the step end time?
- What causes the following Warning message to be issued: “material XXX has a crack softening property
- How can I do a response spectrum analysis using more than 10,000 modes? The current solver limit is
- If SCDM issues the message “Cannot open the document. Reason: Failed to load body geometry.” and the
- Can I define springs with coincident nodes defining each end? Can I use one spring element to define
- How can I get displacements, stresses and plastic strains at the integration points for a shell mode
- In SpaceClaim, when I take section of the assembly, it is not recognizing all parts. How to identify