Commits

Mustafa Abdul Jabbar committed faaf1ca

Facilitated things so that each boundary could have a different user System optionally

Comments (0)

Files changed (1)

   if (IEJacCtx)   iga->userops->IEJacCtx   = IEJacCtx;
   PetscFunctionReturn(0);
 }
+
+#undef  __FUNCT__
+#define __FUNCT__ "IGASetUserSystem"
+/*@
+   IGASetUserSystem - Set the user callback to form the matrix and vector
+   which represents the discretized a(w,u) = L(w).
+   
+   Logically collective on IGA
+
+   Input Parameters:
++  iga - the IGA context
+.  System - the function which evaluates a(w,u) and L(w)
+-  ctx - user-defined context for evaluation routine (may be PETSC_NULL)
+
+   Details of System:
+$  PetscErrorCode System(IGAPoint p,PetscScalar *K,PetscScalar *F,void *ctx);
+
++  p - point at which to evaluate a(w,u)=L(w)
+.  K - contribution to a(w,u)
+.  F - contribution to L(w)
+-  ctx - user-defined context for evaluation routine
+
+   Level: normal
+
+.keywords: IGA, setup linear system, matrix assembly, vector assembly
+@*/
+PetscErrorCode IGABoundarySetUserSystem(IGA iga,IGAUserSystem* System,void **SysCtx)
+{
+  PetscFunctionBegin;
+  PetscValidHeaderSpecific(iga,IGA_CLASSID,1);
+  PetscInt dir, side;
+  
+  if (System) 
+		{
+			for(dir=0;dir<iga->dim;dir++)
+				for(side=0;side<2;side++)
+					iga->userops->BndSystem[dir][side] = System[dir][side];
+		}
+  if (SysCtx) 
+		{
+			for(dir=0;dir<iga->dim;dir++)
+				for(side=0;side<2;side++)
+					iga->userops->BndSystem[dir][side] = SysCtx[dir][side];
+		}
+  PetscFunctionReturn(0);
+}