[Getdp] Problem with description of magnetisation - attachment

Christophe Geuzaine Christophe.Geuzaine at ulg.ac.be
Wed Oct 3 09:17:16 CEST 2001


Oups, I should be more careful with attachments. Here is t5.pro:

Group {
  Magnet = Region[ 1 ];
  Domain = Region[ {Magnet, 2, 3, 4, 10} ];
}

Function {
  mu[] = 4.e-7 * Pi;
  hc[ Magnet ] = Vector[0., 920000., 0.];
}

Jacobian {
  { Name MyJac;
    Case { 
      { Region All; Jacobian Vol; }
    }
  }
}

Integration {
  { Name MyInt;
    Case { 
      { Type Gauss;
        Case { 
	  { GeoElement Tetrahedron; NumberOfPoints 5; }
	}
      }
    }
  }
}

FunctionSpace {
  { Name Hgrad_phi; Type Form0;
    BasisFunction {
      { Name sn; NameOfCoef phin; Function BF_Node;
        Support Domain; Entity NodesOf[ All ]; }
      // uncomment the following for 2nd order interpolation:
      //{ Name sn2; NameOfCoef phin2; Function BF_Node_2E;
      //  Support Domain; Entity EdgesOf[ All ]; }
    }
  }
}

Formulation {
  { Name MagSta_phi; Type FemEquation;
    Quantity { 
      { Name phi; Type Local; NameOfSpace Hgrad_phi; }
    }
    Equation {
      Galerkin { [ - mu[] * 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;
    System {
      { Name A; NameOfFormulation MagSta_phi; }
    }
    Operation { 
      Generate[A]; Solve[A]; SaveSolution[A]; 
    }
  }
}

PostProcessing {
  { Name MagSta_phi; NameOfFormulation MagSta_phi;
    Quantity {
      { Name phi; Value { Local { [ {phi} ]; In Domain; Jacobian MyJac;
} } }
      { Name b; Value { Local { [ - mu[] * {d phi} ]; In Domain;
Jacobian MyJac; } 
                        Local { [ - mu[] * hc[] ]; In Magnet; Jacobian
MyJac; } } }
      { Name hn; Value { Local { [ Norm[{d phi}] ]; In Domain; Jacobian
MyJac; } } }
      { Name fct; Value { Local { [ Sin[X[]]*Sin[3*Y[]]*Sin[1.5*Z[]] ];
In Domain; Jacobian MyJac; } } }
    }
  }
}

PostOperation {
  { Name phi; NameOfPostProcessing MagSta_phi;
    Operation {
      Print[ fct, OnElementsOf Domain, File "fct.pos"];
      Print[ phi, OnElementsOf Domain, File "phi.pos"];
      Print[ b, OnCut {{0,0,1}{1,0,0}{1,1,0}}, File "b.pos" ];
      Print[ hn, OnCut {{0,0,1}{1,0,0}{1,1,0}}, File "hn.pos" ];
    }
  }
}



-- 
Christophe Geuzaine

Tel: 32 (0) 4 366 37 10    http://geuz.org
Fax: 32 (0) 4 366 29 10    mailto:Christophe.Geuzaine at ulg.ac.be