Select Git revision
MeshOptCommon.h
ABC_MonoDomain.pro 3.36 KiB
// Mono domain problem
Constraint {
{Name Dirichlet; Type Assign; Case{{Region dOmegaInt; Value -uInc[]; } } }
}
FunctionSpace{
{Name H_grad; Type Form0;
BasisFunction{
{Name u; NameOfCoef ui; Function BF_Node;
Support Region[{Omega, dOmegaExt, dOmegaInt}]; Entity NodesOf[All];}
}
Constraint{
{NameOfCoef ui; EntityType NodesOf; NameOfConstraint Dirichlet;}
}
}
For k In {0:(#ListGammaExt()-1)}
{Name H_phi~{k}; Type Form0;
BasisFunction{
{Name phi~{k}; NameOfCoef phik; Function BF_Node;
Support Region[{GammaExt~{k}, dGammaExt~{k}}]; Entity NodesOf[All];}
}
}
EndFor
}
Formulation {
// Formulation for a Dirichlet boundary condition
{ Name MonoDomain; Type FemEquation;
Quantity{
{ Name u ; Type Local; NameOfSpace H_grad;}
For k In {0:(#ListGammaExt()-1)}
{ Name phi~{k} ; Type Local; NameOfSpace H_phi~{k};}
EndFor
}
Equation{
//MonoDomain equation
Galerkin{[Dof{Grad u}, {Grad u}];
In Omega; Jacobian JVol; Integration I1;}
Galerkin{[-kap^2*Dof{u}, {u}];
In Omega; Jacobian JVol; Integration I1;}
// ABC
If(ABC_ORDER == 0)
Galerkin{[-I[]*kap*Dof{u}, {u}];
In dOmegaExt; Jacobian JSur; Integration I1;}
ElseIf(ABC_ORDER == 2)
For k In {0:(#ListGammaExt()-1)}
Galerkin{[-I[]*kap*Dof{phi~{k}}, {u}];
In GammaExt~{k}; Jacobian JSur; Integration I1;}
Galerkin{[Dof{phi~{k}}, {phi~{k}}];
In GammaExt~{k}; Jacobian JSur; Integration I1;}
Galerkin{[-Dof{u}, {phi~{k}}];
In GammaExt~{k}; Jacobian JSur; Integration I1;}
Galerkin{[1/(2*kap^2)*Dof{d phi~{k}}, {d phi~{k}}];
In GammaExt~{k}; Jacobian JSur; Integration I1;}
If(CORNER_CONDITION == 2)
For index In {0:#ListdGammaExt~{k}()-1}
// Loop on end-point
l=ListdGammaExt~{k}(index); // Index of ajacent segment
Galerkin{[-I[]/(4*kap)*(Cos[theta]/Cos[theta/2]+Cos[theta/2])*Dof{phi~{k}}, {phi~{k}}];
In Apt~{k}~{l}; Jacobian JLin; Integration I1;}
Galerkin{[-I[]/(4*kap)*(-Cos[theta]/Cos[theta/2]+Cos[theta/2])*Dof{phi~{l}}, {phi~{k}}];
In Apt~{k}~{l}; Jacobian JLin; Integration I1;}
EndFor
EndIf
EndFor
EndIf
}
}
}
Resolution{
{Name MonoDomain;
System{ {Name A; NameOfFormulation MonoDomain; Type Complex; } }
Operation{
CreateDir[ABC_DIR];
Generate[A];
Solve[A];
PostOperation[MonoDomain];
}
}
}
PostProcessing{
{Name MonoDomain; NameOfFormulation MonoDomain;
Quantity {
{Name u; Value {Local { [{u}] ; In Omega; Jacobian JVol; }}}
{Name uNorm; Value {Local { [Norm[{u}]] ; In Omega; Jacobian JVol; }}}
{Name err; Value {Local { [Norm[{u}-uex[]]] ; In Omega; Jacobian JVol; }}}
}
}
}
PostOperation{
{Name MonoDomain; NameOfPostProcessing MonoDomain;
Operation {
Print [u, OnElementsOf Omega, Name "Scattered_Field", File StrCat[ABC_DIR, StrCat[ABC_PREFIX, "u_mono.pos"]]];
Print [uNorm, OnElementsOf Omega, Name "Scattered_Field_(abs._value)", File StrCat[ABC_DIR,StrCat[ABC_PREFIX, "u_mono_abs.pos"]]];
Print [err, OnElementsOf Omega, Name "Error_numeric_vs_analytic", File StrCat[ABC_DIR,StrCat[ABC_PREFIX, "u_mono_err.pos"]]];
}
}
}