# Difficulty with PETSc in solving vectorized problem

Hi,
The problem is defined by:
//===========================Code====================================
macro dimension() 2//
include “macro_ddm.idp”
mesh omega=square(25,25);

fespace Uh(omega,[P2,P2]);
fespace S(omega,P2);

Uh [us,vs],[w1,w2],[u,v];
S US,VS,U,V;
real[int] xxSt1(Uh.ndof);

varf step1([us,vs],[w1,w2])=
int2d(omega)(1/0.02*[w1,w2]'*[us,vs])+ …
+on(1,2,4,us=0,vs=0)+on(3,vs=0,us=1);

Mat A;
real [int] Ar(Uh.ndof); // Right-hand-side vector
func Pk = [P2, P2];
createMat(omega,A,Pk);
A=step1(Uh,Uh);
Ar=step1(0,Uh);
xxSt1=A^-1*Ar;

``````for(int ii=0; ii<(0.5*Uh.ndof); ii++)
{
US[][ii]=xxSt1[2*ii];
VS[][ii]=xxSt1[2*ii+1];

}
``````

//===============================================================
When I run the code, I got error messages that mostly says “Error line number 434, in file macro: partitionPrivate in C:\Program Files (x86)\FreeFem++\idp\macro_ddm.idp, before token ;
Invalid array size for vectorial fespace function”.

Could you possibly help me to figure it out?

You are missing this macro definition before the call to `createMat()`: https://github.com/FreeFem/FreeFem-sources/blob/master/examples/hpddm/elasticity-2d-PETSc.edp#L7.