← Back to team overview

dolfin team mailing list archive

Re: MixedElement in ffc

 

Thanks Andy. That worked!

Andy Ray Terrel wrote:
> On Mon, Mar 16, 2009 at 7:32 PM, Andy Ray Terrel  wrote:
> > 2009/3/16 Hatef Monajemi :
> >> Hi,
> >>
> >> I would assume more than 2 elemnts should be O.K for ffc. However, 
I am
> >> getting some error while trying the following code:
> >>
> >> -----------------------------------
> >>
> >> P2 = VectorElement("Lagrange", "triangle", 1)
> >> P1 = FiniteElement("Lagrange", "triangle", 1)
> >> P3 = FiniteElement("Discontinuous Lagrange", "triangle", 0)
> >> TH = (P2 + P1)+ P3
> > ^^^^^^^^^^^^^^^^^^^^^
> >
> > To fix the trace back replace the above line with
> > TH = MixedElement(P2,P1,P3)
> 
> opps copied the wrong line =D, use:
> 
> TH = MixedElement([P2,P1,P3])
> 
> 
> >
> > The above code creates a Mixed element like so ((v,w), q)
> >
> > -- Andy
> >
> >>
> >> (v,w,q) = TestFunctions(TH)
> >> (U,P,Tau) = TrialFunctions(TH)
> >>
> >>
> >>
> >> a1 =a1(U,P;v)
> >> a2 = a2(U,P;w)
> >> a3 = a3(Tau;q)
> >>
> >> a=a1+a2+a3
> >> ----------------------------------------------
> >>
> >> does anyone know what is wrong here?
> >>
> >> This is the error I am geting:
> >>
> >>  ****need more than 2 values to unpack
> >>
> >> I want to basically add a constant number on every element besides 
velocity
> >> and pressure on nodal points , That's why I used the P3 type of
> >> FiniteElement.
> >>
> >>
> >>
> >>
> >> Thanks ,
> >>
> >> H! at! ! ef
> >>
> >> _______________________________________________
> >> DOLFIN-dev mailing list
> >> DOLFIN-dev@xxxxxxxxxx
> >> http://www.fenics.org/mailman/listinfo/dolfin-dev
> >>
> >>
> >

--------------------------------------
Hatef Monajemi
Graduate Student
Dept of Civil and Environmental Eng
2032 MC Building, Carleton University 
1125 Colonel By Drive, Ottawa 
Ontario, Canada, K1S 5B6