LaminarStressStrainInput.fromJson constructor

LaminarStressStrainInput.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory LaminarStressStrainInput.fromJson(Map<String, dynamic> json) {
  return LaminarStressStrainInput(
    E1: (json['E1'] ?? 0).toDouble(),
    E2: (json['E2'] ?? 0).toDouble(),
    G12: (json['G12'] ?? 0).toDouble(),
    nu12: (json['nu12'] ?? 0).toDouble(),
    layupSequence: (json['layup_sequence'] ?? "").toString(),
    layerThickness: (json['layer_thickness'] ?? 0).toDouble(),
    tensorType: TensorType.values.firstWhere(
      (e) => e.toString() == 'TensorType.' + (json['tensorType'] ?? 'stress'),
      orElse: () => TensorType.stress, // Default value if not found
    ),
    N11: (json['N11'] ?? 0).toDouble(),
    N22: (json['N22'] ?? 0).toDouble(),
    N12: (json['N12'] ?? 0).toDouble(),
    M11: (json['M11'] ?? 0).toDouble(),
    M22: (json['M22'] ?? 0).toDouble(),
    M12: (json['M12'] ?? 0).toDouble(),
    epsilon11: (json['epsilon11'] ?? 0).toDouble(),
    epsilon22: (json['epsilon22'] ?? 0).toDouble(),
    epsilon12: (json['epsilon12'] ?? 0).toDouble(),
    kappa11: (json['kappa11'] ?? 0).toDouble(),
    kappa22: (json['kappa22'] ?? 0).toDouble(),
    kappa12: (json['kappa12'] ?? 0).toDouble(),
  );
}