# SPDX-FileCopyrightText: 2026 Daru AndrĂ¡s # SPDX-License-Identifier: MIT """Synthetic compressible foam in unconfined tension and compression.""" from pathlib import Path from rend import ( SearchPhysicsChecks, PostSearchChecks, ConstitutiveChecks, DeformationRange as Range, FEChecks, MaterialProfile, MaterialRegressor, Operator, SearchConfig, StressUnit, ValidationRanges, ) CSV = "foam.csv" if __name__ == "__main__": regressor = MaterialRegressor.advanced( search=SearchConfig(add_operators=(Operator.SOFTPLUS,)), csv_path=Path(__file__).with_name(CSV), name="Synthetic compressible foam", profile=MaterialProfile.COMPRESSIBLE_ISOTROPIC, stress_unit=StressUnit.MPA, max_generations=5000, # Use 500 for a first exploratory run. verbose=True, live_plot=False, # Set True to watch the search progress. target_mse=1e-2, validation_ranges=ValidationRanges( uniaxial=Range(0.48, 1.28), biaxial=None, planar=None, shear=None, volumetric=None, ), search_checks=SearchPhysicsChecks( reference_stability=True, ), post_search_checks=PostSearchChecks( constitutive=ConstitutiveChecks( stress=True, tangent=True, objectivity=True, stress_covariance=True, material_symmetry=True, reference=True, domain=True, max_states=18, ), fe=FEChecks(kinematic=True, robustness=False, benchmark=False, convergence=False), ), export_json=True, export_uhyper=False, ) result = regressor.run() if result.error: raise RuntimeError(result.error) if result.cancelled: raise SystemExit(130) print("Report:", result.report_path)