Skip to content
Snippets Groups Projects
Commit 60f1f539 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

sync with getdp

parent f7b07e71
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -70,6 +70,8 @@ Include "BH.pro"; // nonlinear BH caracteristic of magnetic material ...@@ -70,6 +70,8 @@ Include "BH.pro"; // nonlinear BH caracteristic of magnetic material
Include "BH_anhysteretic.pro"; Include "BH_anhysteretic.pro";
If(Flag_NL_law==NL_ENERGHYST) If(Flag_NL_law==NL_ENERGHYST)
Include "param_EnergHyst.pro"; Include "param_EnergHyst.pro";
Else
N=0;
EndIf EndIf
...@@ -209,12 +211,20 @@ Constraint { ...@@ -209,12 +211,20 @@ Constraint {
{ Name MVP_2D ; { Name MVP_2D ;
Case { Case {
{ Region Corner ; Value 0.0 ; } { Region Corner ; Value 0. ; }
{ Region SurfaceGe0 ; Type Assign ; Value 0. ; } { Region SurfaceGe0 ; Type Assign ; Value 0. ; }
{ Region SurfaceGInf ; Type Assign ; Value 0. ; } { Region SurfaceGInf ; Type Assign ; Value 0. ; }
} }
} }
For i_ In {0:1}
{ Name Dirichlet~{i_} ; Type Assign ;
Case {
{ Region Boundary ; Type Assign; Value 0. * i_ ; }
}
}
EndFor
{ Name Current_2D ; { Name Current_2D ;
Case { Case {
If(!Flag_CircuitCoupling) If(!Flag_CircuitCoupling)
...@@ -255,7 +265,8 @@ FunctionSpace { ...@@ -255,7 +265,8 @@ FunctionSpace {
{ NameOfCoef ae1 ; EntityType NodesOf ; NameOfConstraint MVP_2D ; } { NameOfCoef ae1 ; EntityType NodesOf ; NameOfConstraint MVP_2D ; }
If (Flag_Degree_a == 2) If (Flag_Degree_a == 2)
{ NameOfCoef ae2 ; // Only OK if homogeneous BC, otherwise specify zero-BC { NameOfCoef ae2 ; // Only OK if homogeneous BC, otherwise specify zero-BC
EntityType EdgesOf ; NameOfConstraint MagneticVectorPotential_2D ; } //EntityType EdgesOf ; NameOfConstraint MagneticVectorPotential_2D ; }
EntityType EdgesOf ; NameOfConstraint Dirichlet_0 ; }
EndIf EndIf
} }
} }
...@@ -433,7 +444,8 @@ Formulation { ...@@ -433,7 +444,8 @@ Formulation {
// BF is constant per element (Vector + BF_Volume) => 1 integration point is enough // BF is constant per element (Vector + BF_Volume) => 1 integration point is enough
Galerkin { [ Dof{h} , {h} ] ; Galerkin { [ Dof{h} , {h} ] ;
In DomainNL ; Jacobian Vol ; Integration I1p ; } In DomainNL ; Jacobian Vol ; Integration I1p ; }
Galerkin { [ - (SetVariable[(h_Vinch_K[ {h}[1] , //Galerkin { [ -0*Vector[X[],Y[],Z[]] , {h} ] ; In DomainNL ; Jacobian Vol ; Integration I1p ; } //For Debug
Galerkin { [ - (SetVariable[(h_Vinch_K[ {h} , // new since 2/3/2018: use {h} instead of {h}[1] here (need to init bc by recomputing b from {h} in h_Vinch_K)
{d a}, {d a}[1], {d a}, {d a}[1],
{J_1}, {J_1}[1], {J_1}, {J_1}[1],
{J_2}, {J_2}[1], {J_2}, {J_2}[1],
...@@ -487,7 +499,7 @@ Formulation { ...@@ -487,7 +499,7 @@ Formulation {
// BF is constant per element (Vector + BF_Volume) => 1 integration point is enough // BF is constant per element (Vector + BF_Volume) => 1 integration point is enough
Galerkin { [ Dof{h} , {h} ] ; Galerkin { [ Dof{h} , {h} ] ;
In DomainNL ; Jacobian Vol ; Integration I1p ; } In DomainNL ; Jacobian Vol ; Integration I1p ; }
Galerkin { [ - (SetVariable[(h_Vinch_K[ {h}[1] , Galerkin { [ - (SetVariable[(h_Vinch_K[ {h} , // new since 2/3/2018: use {h} instead of {h}[1] here (need to init bc by recomputing b from {h} in h_Vinch_K)
{d a}, {d a}[1], {d a}, {d a}[1],
{J_1}, {J_1}[1], {J_1}, {J_1}[1],
{J_2}, {J_2}[1], {J_2}, {J_2}[1],
...@@ -719,10 +731,12 @@ Resolution { ...@@ -719,10 +731,12 @@ Resolution {
IterativeLoopN[ Nb_max_iter, RF_tuned[], IterativeLoopN[ Nb_max_iter, RF_tuned[],
//*****Choose between one of the 3 following possibilities:***** //*****Choose between one of the 3 following possibilities:*****
//System { { A , Reltol_Mag, Abstol_Mag, Residual MeanL2Norm }} ]{ //1) //System { { A , Reltol_Mag, Abstol_Mag, Solution MeanL2Norm }} ]{ //1a) //dx=x-xp; x=x
//System { { A , Reltol_Mag, Abstol_Mag, RecalcResidual MeanL2Norm }} ]{ //1b) //dx=res=b-Ax; x=b
//System { { A , Reltol_Mag, Abstol_Mag, Residual MeanL2Norm }} ]{ //1c) //dx=res=b-Ax; x=b #(default for square) #CHECK here
//PostOperation { { az_only , Reltol_Mag, Abstol_Mag, MeanL2Norm }} ]{ //2) //PostOperation { { az_only , Reltol_Mag, Abstol_Mag, MeanL2Norm }} ]{ //2)
//PostOperation { { b_only , Reltol_Mag, Abstol_Mag, MeanL2Norm }} ]{ //3) //PostOperation { { b_only , Reltol_Mag, Abstol_Mag, MeanL2Norm }} ]{ //3)
PostOperation { { h_only , Reltol_Mag, Abstol_Mag, MeanL2Norm }} ]{ //4) //Need the above "INIT" for square with EnergHyst or JA because h_only = 0 at iter 1 PostOperation { { h_only , Reltol_Mag, Abstol_Mag, MeanL2Norm }} ]{ //4) //(default for t32) #CHECK here //Need the above "INIT" for square with EnergHyst or JA because h_only = 0 at iter 1
//************************************************************** //**************************************************************
Evaluate[$res = $ResidualN, $resL = $Residual,$resN = $ResidualN,$iter = $Iteration-1]; Evaluate[$res = $ResidualN, $resL = $Residual,$resN = $ResidualN,$iter = $Iteration-1];
......
///*//default for t32 #CHECK here
dim00 = (Flag_3Dmodel==1)?3:2; dim00 = (Flag_3Dmodel==1)?3:2;
N00 = 3; N00 = 3;
FLAG_TANORLANG00 = 1; FLAG_TANORLANG00 = 1;
FLAG_VARORDIFF00 = 1; FLAG_VARORDIFF00 = 2;
FLAG_INVMETHOD00 = 1; FLAG_INVMETHOD00 = 1;
FLAG_ROOTFINDING1D00 = 0; FLAG_ROOTFINDING1D00 = 0;
FLAG_MINMETHOD00 = 1; FLAG_MINMETHOD00 = 1;
...@@ -11,8 +12,31 @@ TOLERANCE_000 = 1.e-7; ...@@ -11,8 +12,31 @@ TOLERANCE_000 = 1.e-7;
TOLERANCE_NR00 = 1.e-7; TOLERANCE_NR00 = 1.e-7;
MAX_ITER_NR00 = 200; MAX_ITER_NR00 = 200;
TOLERANCE_OM00 = 1.e-11; TOLERANCE_OM00 = 1.e-11;
MAX_ITER_OM00 = 700; MAX_ITER_OM00 = 1000;
FLAG_ANA00 = 1; FLAG_ANA00 = 1;
TOLERANCE_NJ00 = 1.e-3; TOLERANCE_NJ00 = 1.e-14;
DELTA_000 = 1.e-0; DELTA_000 = 1.e-0;
FLAG_HOMO00 = 0; FLAG_HOMO00 = 1;
\ No newline at end of file //*/
//default for square #CHECK here
/*
dim00 = (Flag_3Dmodel==1)?3:2;
N00 = 3;
FLAG_TANORLANG00 = 1;
FLAG_VARORDIFF00 = 2;
FLAG_INVMETHOD00 = 1;
FLAG_ROOTFINDING1D00 = 0;
FLAG_MINMETHOD00 = 1;
FLAG_WARNING00 = 3 ;
TOLERANCE_JS00 = 1.e-3;
TOLERANCE_000 = 1.e-8;
TOLERANCE_NR00 = 1.e-8;
MAX_ITER_NR00 = 200;
TOLERANCE_OM00 = 1.e-11;
MAX_ITER_OM00 = 1000;
FLAG_ANA00 = 1;
TOLERANCE_NJ00 = 1.e-14;
DELTA_000 = 1.e-0;
FLAG_HOMO00 = 0;
//*/
\ No newline at end of file
...@@ -82,7 +82,7 @@ FLAG_MINMETHOD = 6 --> steepest descent (gsl) ...@@ -82,7 +82,7 @@ FLAG_MINMETHOD = 6 --> steepest descent (gsl)
EndIf EndIf
If(FLAG_TANORLANG==2) If(FLAG_TANORLANG==2)
/* /*
// Material M23535A // Material M23535A (default for square) #CHECK here
Ja = 0.595; Ja = 0.595;
ha = 4100; ha = 4100;
Jb = 1.375; Jb = 1.375;
...@@ -100,7 +100,7 @@ FLAG_MINMETHOD = 6 --> steepest descent (gsl) ...@@ -100,7 +100,7 @@ FLAG_MINMETHOD = 6 --> steepest descent (gsl)
Jb=0.549518 ; Jb=0.549518 ;
hb=188.516; hb=188.516;
//*/ //*/
///* //FH(xini=400) // NEW 1/9/2017 ///* //FH(xini=400) // NEW 1/9/2017 (default for t32) #CHECK here
Ja = 0.792234; Ja = 0.792234;
ha = 9.082095; ha = 9.082095;
Jb = 0.790993; Jb = 0.790993;
...@@ -115,7 +115,7 @@ hb = 399.474553851 ...@@ -115,7 +115,7 @@ hb = 399.474553851
EndIf EndIf
If(N==3) If(N==3)
///* ///*
// Material M25050A // Material M25050A (default for square) #CHECK here
Js_1 = 0.11; Js_1 = 0.11;
Js_2 = 0.8; Js_2 = 0.8;
Js_3 = 0.31; Js_3 = 0.31;
...@@ -149,7 +149,7 @@ hb = 399.474553851 ...@@ -149,7 +149,7 @@ hb = 399.474553851
Js_2 = w_2*(Ja+Jb); Js_2 = w_2*(Ja+Jb);
Js_3 = w_3*(Ja+Jb); Js_3 = w_3*(Ja+Jb);
//*/ //*/
/* //FH(xini=400) // NEW 1/9/2017 (chamonix) /* //FH(xini=400) // NEW 1/9/2017 (chamonix) (default for t32) #CHECK here
chi_1 = 0.; chi_1 = 0.;
chi_2 = 53.789872; chi_2 = 53.789872;
chi_3 = 233.910892; chi_3 = 233.910892;
...@@ -338,6 +338,24 @@ Label_FLAG_ANA="..."; ...@@ -338,6 +338,24 @@ Label_FLAG_ANA="...";
If (FLAG_MINMETHOD == 11 && FLAG_VARORDIFF==1) If (FLAG_MINMETHOD == 11 && FLAG_VARORDIFF==1)
Label_FLAG_MINMETHOD ="FLAG_MINMETHOD=11 --> NEW steepest descent naive (homemade)"; Label_FLAG_MINMETHOD ="FLAG_MINMETHOD=11 --> NEW steepest descent naive (homemade)";
EndIf EndIf
If (FLAG_MINMETHOD == 22 && FLAG_VARORDIFF==1)
Label_FLAG_MINMETHOD ="FLAG_MINMETHOD=11 --> NEW conjugate Fletcher-Reeves (homemade)";
EndIf
If (FLAG_MINMETHOD == 33 && FLAG_VARORDIFF==1)
Label_FLAG_MINMETHOD ="FLAG_MINMETHOD=11 --> NEW conjugate Polak-Ribiere (homemade)";
EndIf
If (FLAG_MINMETHOD == 333 && FLAG_VARORDIFF==1)
Label_FLAG_MINMETHOD ="FLAG_MINMETHOD=11 --> NEW conjugate Polak-Ribiere+ (homemade)";
EndIf
If (FLAG_MINMETHOD == 1999 && FLAG_VARORDIFF==1)
Label_FLAG_MINMETHOD ="FLAG_MINMETHOD=11 --> NEW conjugate Dai Yuan 1999 (p.85) (homemade)";
EndIf
If (FLAG_MINMETHOD == 2005 && FLAG_VARORDIFF==1)
Label_FLAG_MINMETHOD ="FLAG_MINMETHOD=11 --> NEW conjugate Hager Zhang 2005 (p.161) (homemade)";
EndIf
If (FLAG_MINMETHOD == 77 && FLAG_VARORDIFF==1)
Label_FLAG_MINMETHOD ="FLAG_MINMETHOD=11 --> NEW newton (homemade)";
EndIf
If (FLAG_MINMETHOD == 2 && FLAG_VARORDIFF==1) If (FLAG_MINMETHOD == 2 && FLAG_VARORDIFF==1)
Label_FLAG_MINMETHOD ="FLAG_MINMETHOD=2 --> conjugate fr (gsl)"; Label_FLAG_MINMETHOD ="FLAG_MINMETHOD=2 --> conjugate fr (gsl)";
EndIf EndIf
......
...@@ -49,7 +49,6 @@ Flag_NLRes00 = 0; // 0: use classical IterativeLoop to solve the NL (non linear) ...@@ -49,7 +49,6 @@ Flag_NLRes00 = 0; // 0: use classical IterativeLoop to solve the NL (non linear)
// 1: use IterativeLoopN to solve the NL (non linear) problem // 1: use IterativeLoopN to solve the NL (non linear) problem
// 2: solve the NL (non linear) problem "by hand" // 2: solve the NL (non linear) problem "by hand"
// non linear loop default parameters // non linear loop default parameters
Nb_max_iter00 = 50; // maximum number of NL (non linear) iterations Nb_max_iter00 = 50; // maximum number of NL (non linear) iterations
stop_criterion00 = 1e-5; // strop criterion for the NL (non linear) iteration stop_criterion00 = 1e-5; // strop criterion for the NL (non linear) iteration
...@@ -58,8 +57,13 @@ Flag_AdaptRelax00 = 1; // set to 1 to test different relaxation factors ...@@ -58,8 +57,13 @@ Flag_AdaptRelax00 = 1; // set to 1 to test different relaxation factors
relax_max00 = 1 ; relax_max00 = 1 ;
relax_min00 = 0.1; relax_min00 = 0.1;
relax_numtest00 = 10; relax_numtest00 = 10;
TestAllFactors00 = 0; // 0 : stops when the residual goes up !! TestAllFactors00 = 2; // 0 : try first relaxation factors (from the list) and stops when the residual goes up
// 1 : try every relaxation factors and keep the optimal one // 1 : try every relaxation factors (from the list) and keep the optimal one
// 2 : find the maximum relaxation factor that decreases the residual:
// - start with the relaxation factor from the previous time step or from the previous iteration
// - the relaxation factor is multiplied by a ratio as long as the residual decreases
// - the relaxation factor is decreased by a ratio until a decreasing residual is found
// [3 : Build a parabola based on three relaxation factors and deduce a minimizing relaxation factor (NOT WORKING!!)]
Reltol_Mag00 = stop_criterion00; // 0 before with IterativeLoopN Reltol_Mag00 = stop_criterion00; // 0 before with IterativeLoopN
Abstol_Mag00 = stop_criterion00; Abstol_Mag00 = stop_criterion00;
Reltoldx_Mag00 = 1e-5*stop_criterion00; Reltoldx_Mag00 = 1e-5*stop_criterion00;
......
...@@ -44,8 +44,13 @@ Flag_AdaptRelax00 = 1; // set to 1 to test different relaxation factors ...@@ -44,8 +44,13 @@ Flag_AdaptRelax00 = 1; // set to 1 to test different relaxation factors
relax_max00 = 1 ; relax_max00 = 1 ;
relax_min00 = 0.1; relax_min00 = 0.1;
relax_numtest00 = 10; relax_numtest00 = 10;
TestAllFactors00 = 1; // 0 : stops when the residual goes up !! TestAllFactors00 = 1; // 0 : try first relaxation factors (from the list) and stops when the residual goes up
// 1 : try every relaxation factors and keep the optimal one // 1 : try every relaxation factors (from the list) and keep the optimal one
// 2 : find the maximum relaxation factor that decreases the residual:
// - start with the relaxation factor from the previous time step or from the previous iteration
// - the relaxation factor is multiplied by a ratio as long as the residual decreases
// - the relaxation factor is decreased by a ratio until a decreasing residual is found
// [3 : Build a parabola based on three relaxation factors and deduce a minimizing relaxation factor (NOT WORKING!!)]
Reltol_Mag00 = stop_criterion00; // 0 before with IterativeLoopN Reltol_Mag00 = stop_criterion00; // 0 before with IterativeLoopN
Abstol_Mag00 = stop_criterion00; Abstol_Mag00 = stop_criterion00;
Reltoldx_Mag00 = 1e-5*stop_criterion00; Reltoldx_Mag00 = 1e-5*stop_criterion00;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment