<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,
<div>I am still trying to output the priciple stress in pylith, now when I am using the pylith_genxdmf --file=stress.h5</div>
<div>I get this error:</div>
<div>_____________________________________</div>
<div>
<div>assertion "0" failed: file "topology/FieldBase.cc", line 87, function: static py</div>
<div>lith::topology::FieldBase::VectorFieldEnum pylith::topology::FieldBase::parseVec</div>
<div>torFieldString(const char*)</div>
<div>Aborted (core dumped)</div>
</div>
<div>_______________________________________</div>
<div>What I am doing is like the following:</div>
<div>________________________________________</div>
<div>
<div>import numpy</div>
<div>import h5py</div>
<div>import matplotlib.pyplot as plt</div>
<div># Load in change in tractions from coseismic simulation</div>
<div>h5 = h5py.File("output/stress.h5", 'r', driver="sec2")</div>
<div><br>
</div>
<div>vertices = h5['geometry/vertices'][:]</div>
<div>#tractions_change = h5['vertex_fields/traction_change'][0,:,:]</div>
<div>stress=h5['cell_fields/stress'][:]</div>
<div>h5.close()</div>
<div>pstress=(stress[:,:,0]+stress[:,:,1])/2+numpy.sqrt(((stress[:,:,0]-stress[:,:,1])/2)**2+(stress[:,:,2])**2)</div>
<div>h5 = h5py.File("output/stress.h5", 'a', driver="sec2")</div>
<div>field=h5.create_dataset('cell_fields/pstress',data=pstress[:,:])</div>
<div>field.attrs['vector_field_type']='other'</div>
<div>h5.close()</div>
</div>
<div>__________________________________________</div>
<div>I can see that in the .h5 file the pstress is already add into the cell fields.</div>
<div>Also for example the principle stress pstress  dimension is 500,10000, which is good , because the 500 time steps, and 10000 elments, however the vertices number is 10302, because there is a fault interface in the model, there are extra nodes. </div>
<div>What I want to do is that I want plot contours of pricple stress all over the mesh, using python, but the vertrices have repeated coordinates , because the fault interface.</div>
<div>How can I implement that ? </div>
<div>Best,</div>
<div>Xiao</div>
</div>
</body>
</html>