← Back to team overview

ffc team mailing list archive

Re: ffc compile problem

 

Quoting Patrick Riesen <priesen@xxxxxxxxxxxxxxx>:

> >> can i do something like this:
> >> if i have an operator yielding actually a constant as
> >>
> >> def V(v):
> >>      return dot(grad(v),grad(v))*dot(grad(v),grad(v))
> 
> > If you use 'V' (and similar functions) in many places of your form I'm not
> > surprised that it runs out of memory. It's not an 'error' on your account
> it's
> > just due to the way things work currently which means that premultiplying
> terms
> > with derivatives of functions makes the compile time blow up or in some
> cases
> > even prevent compilation as it did in your case.
> 
> aha, so it is better to write out full things in the forms for a,L, that 
> would mean i shouldn't use further terms à la V(v).

Defining functions using

def some_function(v)

in the form file is part of what makes the language so flexible. So in some
cases it is a good idea. The problem in your case is that multiplying the terms
with derivatives of functions rapidly increases the form complexity.

> due to the powerlaw behavior if have dot-products which have the form as 
> (here v=test,u=trial,u0=func)
> 
> dot(|grad(u0)|*|grad(u0)| * grad(u), grad(v))
> 
> where |grad(u0)| is dot(grad(u0),grad(u0))
> 
> so using
> 
> M=dot(grad(u0),grad(u0))*dot(grad(u0),grad(u0))*dx
> 
> in another form-file should may work?

Yes, it should work, and the compilation and runtime performance of your code
will benefit from it. The downside of course is that the user will have to
handle the additional forms etc.

Kristian
 
> patrick
> >> can i use
> >>
> >> vv=Constant("triangle")
> >>
> >> for this term and implement the above term in another form file as
> >>
> >> M=dot(grad(v),grad(v))*dot(grad(v),grad(v))*dx ?
> > 
> > That would be an excellent idea.
> >  
> >> or does it help when i define the (other) possible terms in the way of 
> >> V(v) in the same form file so that the bilinear & linear forms are
> reduced?
> > 
> > I'm not sure I understand this.
> > 
> > Kristian
> >  
> >> thanks for the help,
> >> patrick
> >>
> >>
> >>
> >>
> >>
> > 
> > 
> 




Follow ups

References