Options to impose Dirichlet BC with "ON"

Hello all,

@prj, @frederichecht, where I could find all the options to impose dirichlet boundary conditions with “on” like this: on(1, u=g, tgv=xx) with xx=-1; -2; -10 ; …

Thank you for your help,

Best regards,

Loïc,

It’s all there: FreeFem-sources/HashMatrix.cpp at develop · FreeFem/FreeFem-sources · GitHub.

Thank you for your answer!

I will add a small example in tutorial to see

	load "msh3"
	meshL Th = segment(2);
	real [int] vtgv = [ -20,-10,-2,-1,0, tgv]; 
	varf va(u,v)= int1d(Th)(u*v*24.)+on(1,2,u=0);// mul by 12  to have integer coef ..
	// label : 1 on first DoF O 
	//         2 on last DoF  2 
	// tgv :  -20  put to zero of row and colnum  of Dof with label 1 or 2 
	fespace Vh(Th,P1);
	for [i,tgvi:vtgv]
	{
		matrix A= va(Vh,Vh,tgv=tgvi);
		real[int,int] F(3,3);
		F=0.;  
		for [i,j,aij:A]
		  F(i,j) = aij;
		cout << " tgv =  " << tgvi << "  matrix= " << F << "\n\n\n";
	}

the output is :

  -- FESpace: Nb of Nodes 3 Nb of DoF 3
 tgv =  -20  matrix= 3 3	
	   0   0   0
	   0   8   0
	   0   0   0
	


 tgv =  -10  matrix= 3 3	
	   0   0   0
	   2   8   2
	   0   0   0
	


 tgv =  -2  matrix= 3 3	
	   1   0   0
	   0   8   0
	   0   0   1
	


 tgv =  -1  matrix= 3 3	
	   1   0   0
	   2   8   2
	   0   0   1
	


 tgv =  0  matrix= 3 3	
	   0   2   0
	   2   8   2
	   0   2   0
	


 tgv =  1e+30  matrix= 3 3	
	 1e+30   2   0
	   2   8   2
	   0   2 1e+30
	


times: compile 0.007039s, execution 0.000266s,  mpirank:0
2 Likes

Thank you for this explanation !