Stress-Strain Data Parser

Given a file containing experimental stress-strain data, this class parses it and turns it into a numpy array.

If the data is in a text file, it just needs to be two columns, the first one strain, and the second one stress.

If the data is in an XML file, it should have a stressStrain tag where the relevant data begins and then rows and columns with data as follows:

<headers>
    <column id="1">True Strain</column>
    <column id="2">True Stress [MPa]</column>
    <column id="3">True Strain Rate [1/s]</column>
</headers>
<rows>
    <row id="1">
        <column id="1">0.000303349228225</column>
        <column id="2">-10.3437455647</column>
        <column id="3">0.0</column>
    </row>
    <row id="2">
        <column id="1">4.86122562637e-06</column>
        <column id="2">9.89667339963</column>
        <column id="3">-596.976005197</column>
    </row>
</rows>
class mat_data_parser.stress_strain(data_file, type='txt')

This class will contain the relevant data from a file

For the constructor: Takes in a file name, by default assuming it’s a text file.

data_file is the name of the file with the data (must be in your directory).

Include the full file name, with the extension (if applicable). If you wish to parse an xml file, specify type=”xml” as a keyword argument.

get_experimental_data()

Returns experimental data gathered from initialization.

If you are using the other methods in this package to automatically determine yield stress, call this method after creating an instance of this class to be able to use the data with those methods.