def recovery_le( pb, corrs, macro ): out = {} dim = corrs['corrs_le']['u_00'].shape[1] mic_u = - compute_micro_u( corrs['corrs_le'], macro['strain'], 'u', dim ) mic_p = - compute_micro_u( corrs['corrs_le'], macro['strain'], 'p', dim ) out['u_mic'] = Struct( name = 'output_data', mode = 'vertex', data = mic_u, var_name = 'u', dofs = None ) out['p_mic'] = Struct( name = 'output_data', mode = 'cell', data = mic_p[:,nm.newaxis, :,nm.newaxis], var_name = 'p', dofs = None ) stress_Y, strain_Y = compute_stress_strain_u( pb, 'i1', 'Y', 'mat.D', 'u', mic_u ) stress_Y += compute_mac_stress_part( pb, 'i1', 'Y', 'mat.D', 'u', macro['strain'] ) add_stress_p( stress_Y, pb, 'i1', 'Y', 'p', mic_p ) strain = macro['strain'] + strain_Y out['cauchy_strain'] = Struct( name = 'output_data', mode = 'cell', data = strain, dofs = None ) out['cauchy_stress'] = Struct( name = 'output_data', mode = 'cell', data = stress_Y, dofs = None ) return out
def recovery_le(pb, corrs, macro): out = {} dim = corrs['corrs_le']['u_00'].shape[1] mic_u = - compute_micro_u(corrs['corrs_le'], macro['strain'], 'u', dim) mic_p = - compute_micro_u(corrs['corrs_le'], macro['strain'], 'p', dim) out['u_mic'] = Struct(name='output_data', mode='vertex', data=mic_u, var_name='u', dofs=None) out['p_mic'] = Struct(name='output_data', mode='cell', data=mic_p[:, nm.newaxis, :, nm.newaxis], var_name='p', dofs=None) stress_Y, strain_Y = \ compute_stress_strain_u(pb, 'i', 'Y', 'mat.D', 'u', mic_u) stress_Y += \ compute_mac_stress_part(pb, 'i', 'Y', 'mat.D', 'u', macro['strain']) add_stress_p(stress_Y, pb, 'i', 'Y', 'p', mic_p) strain = macro['strain'] + strain_Y out['cauchy_strain'] = Struct(name='output_data', mode='cell', data=strain, dofs=None) out['cauchy_stress'] = Struct(name='output_data', mode='cell', data=stress_Y, dofs=None) return out