UDFRCRulesOfMixtureInput.fromJson constructor

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

Implementation

factory UDFRCRulesOfMixtureInput.fromJson(Map<String, dynamic> json) {
  return UDFRCRulesOfMixtureInput(
    analysisType: AnalysisType.values.firstWhere(
      (e) =>
          e.toString() ==
          'AnalysisType.' + (json['analysis_type'] ?? "elastic"),
      orElse: () => AnalysisType.elastic, // Default value if not found
    ),
    E1_fiber: (json['E1_fiber'] ?? 0).toDouble(),
    E2_fiber: (json['E2_fiber'] ?? 0).toDouble(),
    G12_fiber: (json['G12_fiber'] ?? 0).toDouble(),
    nu12_fiber: (json['nu12_fiber'] ?? 0).toDouble(),
    alpha11_fiber: (json['alpha11_fiber'] ?? 0).toDouble(),
    alpha22_fiber: (json['alpha22_fiber'] ?? 0).toDouble(),
    E_matrix: (json['E_matrix'] ?? 0).toDouble(),
    nu_matrix: (json['nu_matrix'] ?? 0).toDouble(),
    alpha_matrix: (json['alpha_matrix'] ?? 0).toDouble(),
    fiberVolumeFraction: (json['fiberVolumeFraction'] ?? 0).toDouble(),
  );
}