Clarification regarding extraction of data for every crystallite. #2
-
I am working on a simulation involving two phases. I am currently able to obtain the stress and strain outputs for each of the phases. However, I am not able to obtain the data for the entire material or for each crystallite/grain. How can I proceed? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Let's suppose that your two phases are called 'A' and 'B', the material configuration I assume you already do something along these lines to calculate the Cauchy stress (from import numpy as np
import damask
r = damask.Result('out.hdf5')
r.add_stress_Cauchy()
r.add_equivalent_Mises('sigma') The following code condenses the two Cauchy stress arrays of phases A and B (at increment 10): cauchy = r.view(increments=[10]).get('sigma') # dictionary of each phase
all = np.concatenate((cauchy['A'],cauchy['B']))
avg = np.average(all,axis=0) To generate a phase-specific list of each grain (at exemplary increment 10), one would need to from collections import defaultdict
materialID = damask.VTK.load('grid.vti').get('material')
cfg = damask.ConfigMaterial.load('material.yaml')
cauchy = r.view(increments=[10]).place('sigma') # tensor-valued at every grid point
grainCauchy = defaultdict(dict)
for g,m in enumerate(cfg['material']):
myPhase = m['constituents][0]['phase']
grainCauchy[myPhase][g] = cauchy[materialID == g] |
Beta Was this translation helpful? Give feedback.
-
@nitheeshkumar11: Did this answer your question? If so, please mark it as solved. |
Beta Was this translation helpful? Give feedback.
DAMASK, at its core, is a "material point model", meaning that it allows describing the constitutive behavior of the discretization points in the overall boundary/initial value problem. Depending on the scale of that "outer" problem, those points might be representing a bunch of different phases or grains, instead of being a part of a (highly resolved) grain. For the former case, there are different strategies for homogenizing the behavior of individual constituents present within one material point. The variable
N_constituents
specifies how many separate entities are considered to make up a specific material point. In the case that you are likely dealing with, the spatial resolution is l…