← Back to team overview

dolfin team mailing list archive

Re: [PETSC #13198] Re: trouble with FeNiCS

 

  When PETSc is configured to compile with the C compiler then this
flag allows you to us PETSc with C++ compilers (and it does no harm
if you are using a C compiler). If PETSc is configured to compile with
the C++ compiler --with-clanguage=c++ then this flag should NOT
be used (because the PETSc functions in the PETSc libraries are not
extern C functions but already C++ functions.

  Hope this clears it up,

   Barry


On Tue, 14 Jun 2005, Anders Logg wrote:

> I think we added a
> 
> PETSC_CFLAGS="$PETSC_CFLAGS -DPETSC_USE_EXTERN_CXX"
> 
> just below the definition of PETSC_CFLAGS in configure.ac.  You need
> to add this, then run scripts/preconfigure and then ./configure again.
> 
> We get PETSC_CFLAGS by
> 
> PETSC_CFLAGS=`make -s -C $PETSC_DIR getincludedirs PETSC_DIR=$PETSC_DIR BOPT=$BOPT`
> 
> which I think should be enough. I don't know why the extra
> -DPETSC_USE_EXTERN_CXX helps on some systems or why it's not included
> with getincludedirs.
> 
> /Anders
> 
> On Tue, Jun 14, 2005 at 01:38:05PM -0500, Andy Ray Terrel wrote:
> > Sorry to bother you again.  But when I tried to run some things with 
> > dolfin I just got a PETSc Error.  So I tried to rebuild but remembered 
> > that when I built the first time I had to add some linker to PETSc 
> > somewhere.  Well I have forgotten what it was we added to get PETSc to 
> > link.  Do you remember?
> > 
> > Andy
> > 
> > Anders Logg wrote:
> > 
> > >You need to do A and B separately, as two different forms in two
> > >different files.
> > >
> > >In the first file, do something like
> > >
> > >   vector = FiniteElement("Vector Lagrange", "triangle", 1)
> > >
> > >   v = BasisFunction(vector)
> > >   u = BasisFunction(vector)
> > >
> > >   a = v.dx(i)*u.dx(i)*dx
> > >
> > >In the second file, do something like
> > >
> > >   vector = FiniteElement("Vector Lagrange", "triangle", 1)
> > >   scalar = FiniteElement("Lagrange", "triangle", 1)
> > >   
> > >   q = BasisFunction(scalar)
> > >   u = BasisFunction(vector)
> > >
> > >   a = q*u[i].dx(i)*dx
> > >
> > >Compile each form and then assemble separately in DOLFIN to get A and B.
> > >You can then either combine A and B to get the full matrix, or you can
> > >do fixed-point iteration, or you can create something called a
> > >"VirtualMatrix" in DOLFIN which implements the matrix-vector product
> > >for the full matrix in terms of A and B.
> > >
> > >Hope this helps. Ask me again when you need more help.
> > >
> > >/Anders
> > >
> > >On Tue, Jun 14, 2005 at 09:48:43AM -0500, Andy Terrel wrote:
> > > 
> > >
> > >>Hey Anders,
> > >>
> > >>I am having some trouble figuring out how to write some stokes equations 
> > >>up for my project.  So I have the forms:
> > >>
> > >>a = v.dx(j) *u.dy(j)
> > >>b= q*r*dx
> > >>
> > >>and I want to construct the matrix C s.t.
> > >>   [ A   B^t  ]
> > >>C=[ B    0     ]
> > >>
> > >>This is so I can call some mixed methods for the solving of the problem 
> > >>to get the benchmarking results.
> > >>
> > >>If you have time can you help me?
> > >>
> > >>Andy
> > >>
> > >>PS This is to solve (grad(u), grad(v)) - (p, div(v)) = 0,
> > >>                           (div(u), w) = 0.
> > >>
> > >>   
> > >>
> > >
> > > 
> > >
> > 
> 
> 



References