Hi everyone,
I am trying to visualize the results of measurement circles (in 2D) that I have distributed in a container (box consisting of four walls) .
Visualizing the porosities that I have represented within a numpy array seems to work fine (see picture) but unfortunately this isnt the case for the stresses.
The lines below I have used to create the arrays (for positions in X and Y direction as well as porosities and stress_xx) . What I have noticed is that the array for the stresses would only be represented by one element (the stress component of the last measurement circle) and not by an array consisting of the stress components of all measurement circles. There must be something wrong with the last line here - mabe someone has an idea how to fix this issue…
Defines the range for total number of measurement spheres
b = range(it.measure.maxid())
Introduces the numpy arrays that have no values before iteration
X_all = np.array([]) # for x coordinate of measurement sphere
Y_all = np.array([]) # for y coordinate of measurement sphere
P_all = np.array([]) # for porosities of measurement spheres
S_all = np.array ([]) # for stress components of measurement sphreres
for loop to create numpy arrays for contourplot
for a in b:
x_a = ma.Measure.pos_x(it.measure.find(a+1)) # iterate x positions
X_all = np.concatenate((X_all, [x_a])) # concatenate to a numpy array
y_a = ma.Measure.pos_y(it.measure.find(a+1)) # iterate y positions
Y_all = np.concatenate((Y_all, [y_a])) # concatenate to a numpy array
p_a = ma.Measure.porosity(it.measure.find(a+1)) # iterate porosities
P_all = np.concatenate((P_all, [p_a])) # concatenate to a numpy array
s_11_a = ma.Measure.stress(it.measure.find(a+1))[0,0] # iterate stress_xx
S_11_all = np.concatenate((S_all, [s_11_a])) # concatenate to a numpy array