Wiki

Clone wiki

mofem-joseph / LoadDispPlot

##How to plot a load displacement graph for arclength control

When running the arclength control example the displacement for a particular node at each load step is piped to the display. To set the specific node which you wish to monitor, you need to create a nodeset in Cubit with the name "LoadPath". The nodes which are part of that nodeset will then display their spatial position.

To capture the output into a textfile, which you can then use to plot, postfix the run command with tee and the name of the text file you wish the data to be sent to. An example:

mpirun -np 2 ./arc_length_nonlinear_elasticity "-my_file" cantilever.cub ... | tee log.

Next, filter the log so you only have the data needed for the load displacement graph. This can be done using the unix command grep and awk. grep returns the lines of text you were searching for and awk filters the text in the line. An example:

grep LAMBDA log | grep '\[ 1 \]' | awk '{print $5}'| tee plot.data

The first part grep LAMBDA log searches the log file for the word "LAMBDA" and returns the results. Lambda is a scalling factor for the arc length control and is where the spatial position of the montired node is stored. The returned lines are then filtered further using grep again to keep only the lines with [ 1 \]. This is the y component of the spatial position of the monitored node. And finally awk {print $5} selects the 5th whole word/symbol in the sentence, in this case the spatial position value. The results are then written to plot.data. Note it's also possible to carry out arithmetic operations using the awk command.

Updated