[Getdp] Nonlinear time-dependent problem

Vladimir Vrabel vv at cage.UGent.be
Mon Apr 19 11:11:42 CEST 2010


Hello everybody,

My name is Vladimir Vrabel and I'm PhD student at Ghent University. 
I want to use GetDP to solve a nonlinear time-dependent problem with Robin-like boundary condition, 
but I have a mistake in my program that I can't find (probably something with JacNL  term in Formulation or maybe something else).
Could anyone help me?

The problem is to find H such that

                   \partial_t H + rot(rot H) = -F	in Omega x [0,T]
    n x rot(H)  = n x \partial_t a(H x n) + n x G	on Gam x [0,T]
			                   H(0) = Ho	

The function a(x)= b(x)*x is nonlinear and Der_a[] is its Jacobi matrix ( for Newton method in Formulation).
The variational formulation is

(\partial_t H,\phi) + (dH,d\phi) + (F, \phi) + (\partial_t a(Hxn),\phixn)_Gam + (G,phi)_Gam = 0 
										H(0) = Ho

for all \phi from H(curl).

Here is my Constraint, FunctionSpace, Formulation and Resolution 

Constraint {
  { Name InitialCon;
    Case {
      { Region Region[{Omega,Gam}];
	Type InitFromResolution; NameOfResolution setInitC ;
      }
    }
  }
}

FunctionSpace {
  { Name Hcurl; Type Form1;
    BasisFunction {
      { Name phi; NameOfCoef U; Function BF_Edge;
	Support Region[{Omega,Gam}]; Entity EdgesOf[All]; }
    }

    Constraint {
      { NameOfCoef U; EntityType EdgesOf;
        NameOfConstraint InitialCon; }
    }
  }
}

Formulation {
  
  { Name setInitC; Type FemEquation;
    Quantity {
      { Name H; Type Local; NameOfSpace Hcurl; }
    }
    Equation {
      Galerkin { [ Dof{H}, {H} ]; In Omega;
                 Jacobian Jac; Integration CurlCurl; }
      Galerkin { [ -Ho[], {H} ]; In Omega;
                 Jacobian Jac; Integration CurlCurl; }
      Galerkin { [Dof{H}, {H} ]; In Gam;
                 Jacobian Jac; Integration CurlCurl; }
      Galerkin { [-Ho[], {H} ]; In Gam;
                 Jacobian Jac; Integration CurlCurl; }
    }
  }
  
  { Name EqCurl; Type FemEquation;
    Quantity{
      { Name H; Type Local; NameOfSpace Hcurl; }
    }
    Equation {
      Galerkin { DtDof[ Dof{H}, {H} ]; In Omega; 
                 Jacobian Jac; Integration CurlCurl; }
    
      Galerkin { [ Dof{d H},{d H} ]; In Omega;
                 Jacobian Jac; Integration CurlCurl; }
		 
      Galerkin { DtDof[ b[{H}]*Dof{H}, {H} ]; In Gam;	
                 Jacobian Jac; Integration CurlCurl; }
      
      Galerkin { JacNL[ Der_a[{H}]*Dof{H}, {H} ]; In Gam;
                 Jacobian Jac; Integration CurlCurl; }
       
      Galerkin { [ F[], {H} ]; In Omega;				
                 Jacobian Jac; Integration CurlCurl; }	 		 
      
      Galerkin { [ G[], {H} ]; In Gam;		
	         Jacobian Jac; Integration CurlCurl; }
    }   
  }
}

Resolution {

  { Name main ;
    System {
      { Name S2 ; NameOfFormulation EqCurl ; }
    }
    Operation {
      InitSolution S2; SaveSolution S2;
      TimeLoopTheta[0.,Tmax, dT, 1] {
        IterativeLoop[100, 1.e-10 , 1.]{GenerateJac S2; SolveJac S2;}     
      	SaveSolution S2;
      }
    }
  }
  
  
  { Name setInitC ;
    System {
      { Name S1 ; NameOfFormulation setInitC ; DestinationSystem S2 ; }
      { Name S2 ; NameOfFormulation EqCurl ; }
    }
    Operation {   
      Generate S1 ; Solve S1 ; TransferSolution S1 ;
    }
  }
}


I chose the functions F and G such that, let's say, the function H=(t^2+1)*(y-z,z-x,x-y) is the exact solution. 
However the error between this prescribed solution and the GetDP solution was quite big. 
Then I tried to do the time loop outside of GetDP. 
I wrote a program in Octave and I called GetDP just to solve the problem on the every time step. 
In this case everything worked fine and I got much better results.

I'd like to ask where I did a mistake. Is my formulation right?


Thank you,
Vladimir