Path: blob/devel/elmerice/examples/Adjoint_CostRegSolver/Valid_CostRegSolver1.sif
3204 views
!################################################ !# Validation test case for Adjoint_CostRegSolver !# Test regularisation penalising !# first spatial derivatives !################################################ ! PARAMETERS: $name="CostReg1" !############################################### Header Mesh DB "." "mesh2D" End !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Simulation Coordinate System = Cartesian 2D Simulation Type = Steady State Output Intervals = 1 Steady State Max Iterations = 20 Steady State Min Iterations = 20 !Post File = "case.vtu" max output level = 4 End !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Body 1 Equation = 1 Body Force = 1 Initial Condition = 1 End !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Initial Condition 1 ! initial value for var ! Cost function is int 0.5 [ (dV/dx)^2 + (dV/dy)^2] Var = Variable Coordinate 1, Coordinate 2 Real MATC "sqrt(2.0)*tx(0)^2+sqrt(2)*tx(1)*tx(1)/2" !=> V = a x^2 + b y^2 !=> J = (a^2 * 2/3 + b^2 * 2/3) ! perturbation variable VarP = REAL MATC "0.1*rand(1,1)" End !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Body Force 1 End !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! dumy just here to declare variables !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Solver 1 Exec Solver = never Equation = String "UpdateExport" procedure = "ElmerIceSolvers" "UpdateExport" Exported Variable 1 = -global "CostValue" Exported Variable 2 = Var Exported Variable 3 = DJDp Exported Variable 4 = VarP End !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Compute regularisation cost !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Solver 2 Equation = String "CostReg" procedure = "ElmerIceSolvers" "Adjoint_CostRegSolver" !# True if cost function and gradient must be initialised to 0 in this solver Reset Cost Value = Logical True Cost Filename = File "CostFile_$name$.dat" Lambda=Real 1.0 Cost Variable Name = String "CostValue" Gradient Variable Name = String "DJDp" Optimized Variable Name = String "Var" A priori Regularisation = Logical FALSE end !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Validation !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Solver 3 Equation = "GradientValidation" procedure = "ElmerIceSolvers" "Adjoint_GradientValidation" Cost Variable Name = String "CostValue" Optimized Variable Name = String "Var" Perturbation Variable Name = String "VarP" Gradient Variable Name = String "DJDp" Result File = File "Validation_$name$.dat" end !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Equation 1 Active Solvers (3)= 1 2 3 End