Outputting Dynamic Results in Abaqus - abaqus

I ran a dynamic simulation in Abaqus 6.11, and need a way to output the results in an efficient manner. I would like to report the velocity (among other quantities) of all the nodes at all time steps. In the GUI I could create a field output and select each step one at a time to report, but this approach is not practical. Does anyone know how to do this? In the end I'm hoping to get one/multiple rpt files containing the data I need. Then I can write a script in Matlab for reading/performing operations with the data.
Thanks

You should write a script to automate the process for you. Since Abaqus exposes interface for writing Python scripts, you should try that out.
If you've never done something like that, then create a field report for one step/frame manually and then open abaqus.rpy file to see the code necessary to create that single output. Once you figure out how to do it for one step, write a script with a loop to do it for all steps.
When you open abaqus.rpy file, there will probably be a lot of code, depending on how much commands you had previously issued. The like you need to look for looks something like
session.writeFieldReport(some parameters...)
The script you write can be run via 'File > Run script'.
If you need actual help writing the script, maybe you should open a question with specific problem.

Related

how to get bazel cache items or fail

I know this is stupid, but I am trying to prove that bazel will do great things for us. We have a hairy, complex build system and it is going to be a huge lift to move it to bazel. I have been told we can't have the money/time to do this. So I trying to do this bass ackward.
I want to make rules for our unit tests that don't use bazel for the build. My thinking is that when I run a test, it first looks for a marker file with the current hash tree. If it's not there, I run the test and gather stats about the time it took. Then I put that info in the marker file with a bazel rule. The next time for the same hash tree, I find the marker file, extract the info and generate a nice message that bazel just saved X time on this job. I can then scrape those messages and produce shiny management graphs demonstrating how great having hash dependency test control is. Hopefully, this will get us funded to do it right.
I am hoping you stop laughing at me long enough to help figure this out.
thanks,
jerry
Bazel do not write anything to source directory, and it is hard to do this. Your solution is probably doable, but you need to know how bazel works underhood, and it will be overkill for such a hack
IMO the best way is to write a simple bash script, which will run you tests:
sh_test(
name = "test",
srcs = ["test_wrapper.sh"],
data = [all_files_required_by_tests_runner],
)
and you will get that pretty message about saved time for free

Extract information from a log file using powershell

Hi I am new to the language of powershell s i though about playing around with it. I am trying to extract information out of a log file (the file belongs to a program called event viewer). I need to use the information under Boot Duration.
Could somebody guide me a little bit?
It will be greatly appreciated
Thanks.
Logs are always the same. Not sure if you are going to monitor boot log of windows or linux or what.. but will try to answer.
If you edit your question and add info on the operating system and an example of relevant lines of boot log file I can provide you with some powershell code.
In general you should do:
Identify how to manually see boot time in log file. For example
probably it will have a starting boot time and a finished boot time.
Something similar to this.
[2012-06-08 12:00:04] starting boot
lot of log entries
[2012-06-08 12:00:34] finished boot
Once you know how to do it manually, you have to convince powershell to do it for you. You can use regular expressions to look for the pattern of dates. In my example look for lines that contains "starting boot" and then parse it to load date.
Here you have an useful link on powershell and regular expressions: http://www.regular-expressions.info/powershell.html

F# interactive session persistance and other such user questions

Is there any way of persisting my F# session or serializing it into a file? i.e. so I can hand it to a friend and say "run this" and they will be at the same place I was? I know forth had this ability but I can't find any way of doing this.
An alternative would be a log file or something of similar ilk, but ideally it would strip the output and just give me the code I wrote.
On the topic of user questions, is there a config file for F# so I can add some "always includes" or alter the defaults?
There is no way to serialize the F# Interactive session or create some log of commands automatically.
The typical user interaction is that you write all your code in F# Script File (.fsx extension) and evaluate code by selecting lines and sending them to F# Interactive using Alt+Enter. If you work like this, then the F# Script File is a bit like log of your work - and you can easily send it to other people.
The good thing about this approach is that you can edit the file - if you write something wrong, you can correct it and the wrong version will not appear in the log. The bad thing is that you need some additional effort to keep the source file correct.
Regarding automatic inclusions - you can specify options for fsi.exe in Visual Studio Options (F# Tools). The --load command line parameter can be used to load some F# source at startup.

Is there a tool that allows to edit related code in single file?

My idea is that it's much easier to edit related code when it sits in single "work" file. E.g. in Rails application when you implementing some functionality you may edit 1 function per file in the following files: integration test, controller test, controller, model, controller helper. So if it would be possible to 1) mark this code fragments 2) automatically collect them in "work" file 3) edit them togather 4) the tool synchronizes (puts back) the changes; it could simplify development process in many cases. Especially if you need to go through many tweek-and-try iterations.
Vim works fine for this. Install the Rails.vim(1) plugin and with the command :AV you can open a vertical split with the accompanied tests/specs, or :RV to open related files like migrations and views (depending on whether you're viewing model or controller). When you're workspace becomes to cluttered, use :only to go back to one file. Splits are the best way to manage multiple related files IMHO. You can even open the same file twice to see two parts of the same file. It's not exactly the same as you are describing, but it comes close.
1: http://rails.vim.tpope.net/
Just open up Vim and open some windows. What's the problem?

Delphi: Check whether file is in use

I want to write to/delete a file but sometimes I get a crash if the file is in use by another program. How do I check to see whether the file is opened by another process or I can open it for writing?
The problem is, that between the time you check to see if you could get exclusive access and opening the file, something else gets exclusive access to the file, and you get the exception anyway.
The only fool proof way to see if you can get an exclusive lock on a file is to try and get an exclusive lock on the file, if you get it you have it.
If not, you catch the exception, and either
Go do something else
Wait a while and try again
It's one of life’s situations where it's better to ask for forgiveness than permission :)
There is a new way to get the origin of file locking for Vista and up here:
http://www.remkoweijnen.nl/blog/2011/01/03/cannot-access-files-but-need-the-origin/
UserMode:
The best way to write to a locked file is to ask the user to close it in the other process. In batch processes you should ignore such a file and log the problem. Providing the name of the other process is a very good way to find a solution for the user.
Not sure in which programming language you'd like to check if you can write to a file. In Java, java.io.File.canWrite() can do the job for you.
General:
In UNIX-like OS, you can use the lsof command.
If you want to see which program holds a handle to your file, use the Process Monitor (download from MicroSoft).
This tool has a command line interface, so you could use your language's scripting interface (for example java.lang.Process) to run the tool and display a useful error message.
IsFileInUse as given in http://delphi.about.com/cs/adptips1999/a/bltip0999_3.htm

Resources