[Getdp] GETDP setting Maximum Iterations in a none linear iterative loop???
Paul Knell
paul.knell at hirst-magnetics.com
Tue Jun 15 17:11:37 CEST 2010
Hi All
I'm attempting to run getdp for a magnetic simulation using the
solver.par file to set parameters, as the 10,000 default for max
iterations is driving me nuts. I've tried putting this file into the
working directories and in an /out directory and the parameter is ignored.
Does anyone know what syntax is used to set max iterations, I've
attempted using Nb_Max_Iter 500 to no avail. I'm using KSP, GMRES with
-mat_no_inodes set, as running non-linear solver with PHI_PIC
formulation. Code below.
Any help welcome
Cheers
Paul
/* File "cube_magnet.pro" */
// for 3D example b-conforming
hcMag = 979000; // neo 40MGOe 509630; //50963; //920000.; // same as for original example
//hcMag = 500000.; // test
Rint = 0.45 ; // From geometry file, needed by
Rext = 0.5 ; // VolSphShell Jacobian
NL_NbrMaxIter = 1000; // Max nbr iterations for iteractive loop
NL_Eps = 5.e-4; // Convergence criterium for iteractive loop
NL_Relax = 1.; // Relaxation Factor for iteractive loop
Include "GenSteel.inc"; // Data for non linear material
Include "listhnu.dat";
Group {
DefineGroup[ DomainInf] ;
}
Group {
DefineGroup[ Domain, Domain_S , NonSteel, NonMagnet];
}
Group{
Tool1 = Region[2636];
Tool2 = Region[2640];
// InvarInner = Region[2672]; //Invar
Invar = Region[2682]; //Invar
Keeper = Region[2632]; //Keeper
//Air = Region[430];
//Core1 = Region[279];
//Core2 = Region[280];
Magnet1 = Region[ 279];
Magnet2 = Region[ 280];
Magnet = Region[ {279, 280}];
Air = Region[{2630}];
AirInf = Region[{130}];
//Outer_Boundary = Region[227];
Keeper_Boundary = Region[2633];
Tool1_Boundary = Region[2637];
Tool2_Boundary = Region[2641];
Invar_Boundary = Region[2683];
//InvarOuter_Boundary = Region[2668];
Magnet1_Boundary = Region[232];
Magnet2_Boundary = Region[282];
//Steel = Region[{InvarInner, InvarOuter, Keeper, Tool1, Tool2}]; //, Keeper, Tool1, Tool2
Domain_S = Region[ {} ]; //DomainS_Mag = Region[ {Core,Steel1,Steel2} ];
NonSteel = Region[{Air, AirInf, Magnet, Domain_S}]; //AirInf
NonMagnet = Region[{Air, AirInf, Keeper, Tool1, Tool2, Invar, Domain_S}]; // InvarInner, InvarOuter
Domain = Region[ {NonSteel, Keeper, Tool1, Tool2 , Invar} ]; // InvarOuter,
Dirichlet_a = Region[ {1000} ]; // infinity boundary
Dirichlet_phi = Region[ {1000,1001} ]; // symetry (1000) and infinity boundary
}
//Include "listhnu.dat";
Function {
mu0 = 4.e-7 * Pi ;
muMagnet = 1.049 * mu0; //was 1.1
mu[ Region[ {Air,AirInf} ] ] = mu0; //, AirInf
hc[Magnet1] = Vector[0., hcMag, 0];
hc[Magnet2] = Vector[0., -hcMag, 0];
js [ Domain_S ] = Vector[0, 0, 0] ; // no currents
nu [ Region[ {Air, AirInf}] ] = 1. / mu0 ; //, AirInf
mu[ Magnet1 ] = muMagnet;
mu[ Magnet2 ] = muMagnet;
nu [ Magnet ] = 1. / muMagnet ;
mu [ Domain_S ] = mu0 ;
nu [ Domain_S ] = 1. / mu0 ;
//mu[Tool1] = 100 * mu0 ;
//mu[Tool2] = 100 * mu0 ;
/*
//Steel
// This is for vector magnetic potential formulation with a Newton scheme
Steel1_nu_b2 = ListAlt[Steel1_b2, Steel1_nu] ;
nu_Steel1[] = InterpolationAkima[$1]{List[Steel1_nu_b2]} ;
dnudb2_Steel1[] = dInterpolationAkima[$1]{List[Steel1_nu_b2]} ;
h_Steel1[] = nu_Steel1[(SquNorm[$1])] * $1 ;
dhdb_Steel1[] = TensorDiag[1,1,1] * nu_Steel1[SquNorm[$1]] + 2*dnudb2_Steel1[SquNorm[$1]] * SquDyadicProduct[$1] ;
h[Steel1] = h_Steel1[$1]; dhdb[Steel1] = dhdb_Steel1[$1];
// This is for scalar magnetic potential formulation with a Newton scheme
Steel1_mu_h2 = ListAlt[Steel1_h2, Steel1_mu] ;
mu_Steel1[] = InterpolationAkima[$1]{List[Steel1_mu_h2]} ;
dmudh2_Steel1[] = dInterpolationAkima[$1]{List[Steel1_mu_h2]} ;
b_Steel1[] = mu_Steel1[(SquNorm[$1#3])] * #3 ;
dbdh_Steel1[] = TensorDiag[1,1,1] * mu_Steel1[SquNorm[$1#1]#2] + 2*dmudh2_Steel1[#2] * SquDyadicProduct[#1] ;
b[Steel1] = b_Steel1[$1]; dbdh[Steel1] = dbdh_Steel1[$1];
//steel2
// This is for vector magnetic potential formulation with a Newton scheme
Steel2_nu_b2 = ListAlt[Steel2_b2, Steel2_nu] ;
nu_Steel2[] = InterpolationAkima[$1]{List[Steel2_nu_b2]} ;
dnudb2_Steel2[] = dInterpolationAkima[$1]{List[Steel2_nu_b2]} ;
h_Steel2[] = nu_Steel2[(SquNorm[$1])] * $1 ;
dhdb_Steel2[] = TensorDiag[1,1,1] * nu_Steel2[SquNorm[$1]] + 2*dnudb2_Steel2[SquNorm[$1]] * SquDyadicProduct[$1] ;
h[Steel2] = h_Steel2[$1]; dhdb[Steel2] = dhdb_Steel2[$1];
// This is for scalar magnetic potential formulation with a Newton scheme
Steel2_mu_h2 = ListAlt[Steel2_h2, Steel2_mu] ;
mu_Steel2[] = InterpolationAkima[$1]{List[Steel2_mu_h2]} ;
dmudh2_Steel2[] = dInterpolationAkima[$1]{List[Steel2_mu_h2]} ;
b_Steel2[] = mu_Steel2[(SquNorm[$1#3])] * #3 ;
dbdh_Steel2[] = TensorDiag[1,1,1] * mu_Steel2[SquNorm[$1#1]#2] + 2*dmudh2_Steel2[#2] * SquDyadicProduct[#1] ;
b[Steel2] = b_Steel2[$1]; dbdh[Steel2] = dbdh_Steel2[$1];
*/
/*
//steel3
// This is for vector magnetic potential formulation with a Newton scheme
Steel3_nu_b2 = ListAlt[Steel3_b2, Steel2_nu] ;
nu_Steel3[] = InterpolationAkima[$1]{List[Steel3_nu_b2]} ;
dnudb2_Steel3[] = dInterpolationAkima[$1]{List[Steel3_nu_b2]} ;
h_Steel3[] = nu_Steel3[(SquNorm[$1])] * $1 ;
dhdb_Steel3[] = TensorDiag[1,1,1] * nu_Steel3[SquNorm[$1]] + 2*dnudb2_Steel3[SquNorm[$1]] * SquDyadicProduct[$1] ;
h[Steel3] = h_Steel3[$1]; dhdb[Steel3] = dhdb_Steel3[$1];
// This is for scalar magnetic potential formulation with a Newton scheme
Steel3_mu_h2 = ListAlt[Steel3_h2, Steel3_mu] ;
mu_Steel3[] = InterpolationAkima[$1]{List[Steel3_mu_h2]} ;
dmudh2_Steel3[] = dInterpolationAkima[$1]{List[Steel3_mu_h2]} ;
b_Steel3[] = mu_Steel3[(SquNorm[$1#3])] * #3 ;
dbdh_Steel3[] = TensorDiag[1,1,1] * mu_Steel3[SquNorm[$1#1]#2] + 2*dmudh2_Steel3[#2] * SquDyadicProduct[#1] ;
b[Steel3] = b_Steel3[$1]; dbdh[Steel3] = dbdh_Steel3[$1];
*/
/* This is for vector magnetic potential formulation with a Picard scheme */
//nu[Invar] = InterpolationLinear[Norm[$1]]{List[nu_steel1_couples]};
//nu[Keeper] = InterpolationAkima[Norm[$1]]{List[nu_steel2_couples]};
//nu[Steel3] = InterpolationAkima[Norm[$1]]{List[nu_steel3_couples]};
/* This is for scalar magnetic potential formulation with a Picard scheme */
mu[Keeper] = InterpolationLinear[Norm[$1]]{List[mu_steel2_couples]};
mu[Invar] = InterpolationAkima[Norm[$1]]{List[Alnico36_mu]}; //36
//mu[InvarOuter] = InterpolationAkima[Norm[$1]]{List[Alnico36Outer_mu]};
mu[Tool1] = InterpolationAkima[Norm[$1]]{List[Tool1_mu]};
mu[Tool2] = InterpolationAkima[Norm[$1]]{List[Tool2_mu]};
}
Constraint {
{ Name a ;
Case {
{ Region Dirichlet_a ; Value 0. ; }
}
}
{ Name phi ;
Case {
{ Region Dirichlet_phi ; Value 0. ; }
}
}
}
/*
Constraint {
{ Name Gauge; Type Assign;
Case {{ Region Domain ; SubRegion Boundary ; Value 0.; }}
}
{ Name a; Type Assign;
Case {{ Region Outer_Boundary ; Value 0.; }}
}
// Val_I_1_ = 0.01 * 1000.;
//{ Name SourceCurrentDensityZ;
// Case {
// { Region Core; Value Val_I_1_/Sc[]; }
// }
//}
}*/
Jacobian {
{ Name MyJac;
Case {
{ Region DomainInf ; Jacobian VolSphShell{Rint, Rext} ; }
{ Region All; Jacobian Vol; }
}
}
}
Integration {
{ Name MyInt;
Case {
{ Type Gauss;
Case {
{ GeoElement Tetrahedron; NumberOfPoints 4; }
{ GeoElement Triangle; NumberOfPoints 4; }
{ GeoElement Quadrangle; NumberOfPoints 4; }
{ GeoElement Hexahedron ; NumberOfPoints 6 ; }
{ GeoElement Prism ; NumberOfPoints 9 ; }
}
}
}
}
}
FunctionSpace {
{ Name Hcurl_a ; Type Form1P ;
BasisFunction {
{ Name se ; NameOfCoef ae ; Function BF_PerpendicularEdge ;
Support Domain ; Entity NodesOf[ All ] ; }
}
Constraint {
{ NameOfCoef ae ; EntityType NodesOf ; NameOfConstraint a ; }
}
}
{ Name Hgrad_phi; Type Form0;
BasisFunction {
{ Name sn; NameOfCoef phin; Function BF_Node;
Support Domain; Entity NodesOf[ All ]; }
}
Constraint {
{ NameOfCoef phin ; EntityType NodesOf ; NameOfConstraint phi ; }
}
}
}
Formulation {
{ Name MagSta_phi_pic; Type FemEquation;
Quantity {
{ Name phi; Type Local; NameOfSpace Hgrad_phi; }
}
Equation {
Galerkin { [ - mu[ {d phi} ] * Dof{d phi} , {d phi} ];
In Domain; Jacobian MyJac; Integration MyInt; }
Galerkin { [ - mu[] * hc[] , {d phi} ];
In Magnet; Jacobian MyJac; Integration MyInt; }
}
}
}
Resolution {
{ Name MagSta_phi_pic;
System {
{ Name A; NameOfFormulation MagSta_phi_pic; }
}
Operation {
InitSolution [A];
IterativeLoop[NL_NbrMaxIter, NL_Eps, NL_Relax] {
GenerateJac[A]; SolveJac[A];
}
SaveSolution[A];
}
}
}
PostProcessing {
{ Name MagSta_phi_pic; NameOfFormulation MagSta_phi_pic;
Quantity {
//{ Name phi; Value { Local { [ {phi} ] ; In Domain; Jacobian MyJac;} } }
//{ Name h; Value { Local { [ - {d phi} ] ; In Domain; Jacobian MyJac;} } }
{ Name b; Value
{
//Local { [ - mu[] * {d phi} ] ; In NonSteel ; Jacobian MyJac; }
Local { [ - mu[ {d phi} ] * {d phi} ] ; In Domain ; Jacobian MyJac; }
Local { [ - mu[] * hc[] ] ; In Magnet ; Jacobian MyJac; }
//Local { [ - mu[] * {d phi} ] ; In Magnet ; Jacobian MyJac; }
}
}
//{ Name mu; Value { Local { [mu[]] ; In Magnet; Jacobian MyJac;} } }
}
}
}
PostOperation {
{ Name phi_pic; NameOfPostProcessing MagSta_phi_pic;
Operation {
// Basic values
//Print[ phi, OnElementsOf Domain, File "phi_pic.pos"] ;
Print[ b, OnElementsOf Domain, File "b_phi_pic.pos"] ;
//Print[ h, OnElementsOf Domain, File "h_phi_pic.pos"] ;
//{ Name mu; Value { Local { [{-mu[]} ] ; In Magnet; Jacobian MyJac;} } }
//Print[ mu, OnElementsOf Magnet, File "mu_phi_pic.pos"] ;
}
}
}
solver.par
Matrix_Format 1
Matrix_Printing 0
Matrix_Storage 0
Scaling 0
Renumbering_Technique 1
Preconditioner 2
Preconditioner_Position 2
Nb_Fill 20
Permutation_Tolerance 0.05
Dropping_Tolerance 0
Diagonal_Compensation 0
Re_Use_ILU 0
Algorithm 8
Krylov_Size 40
IC_Acceleration 1
Re_Use_LU 0
Iterative_Improvement 0
Nb_Iter_Max 500
Stopping_Test 1e-010