← Back to team overview

ffc team mailing list archive

Re: ffc compiler error

 

Hello again!

Now I have another issue.
I created a small project in order to use FFC and Dolfin:

1) ChorinTemamFenics.form (this is a part of evolution
Navier - Stokes equations solver, in cylindrical coordinates
with axial symmetry) 
2) main.cpp (this is only the sample to check how compiler
will work with generated .h file and Dolfin headers)
3) Makefile and dolfin.conf (standard from Dolfin installation
directory)

The result is following:
1) Generated with “ffc -l dolfin ChorinTemamFenics.form” .h file
has size 26Mb and there are some lines in the code with length 290Kb.
2) Compilation with “make” of main.cpp and .h takes more then 3 hours
and then gcc finishes with “out of memory” message.

Best regards,
Andrey

Attachment: ChorinTemamFenics.form
Description: Binary data

#include <dolfin.h>
#include "ChorinTemamFenics.h"
	
using namespace dolfin;

	class Source : public Function {
		public:
		Source(Mesh& mesh) : Function(mesh) {}

		real eval(const real* x) const {
			real dx = x[0];
			real dy = x[1];
			return exp(-(dx*dx + dy*dy));
		}

	};

	class Source3D : public Function {
		public:
		Source3D(Mesh& mesh) : Function(mesh) {}

		void eval(real* values, const real* x) const {
			values[0] = 0.0;
			values[1] = 0.0;
			values[2] = 0.0;
		}
	};

	class DirichletBoundary : public SubDomain {
		bool inside(const real* x, bool on_boundary) const {
			return x[1] < DOLFIN_EPS || x[1] > (1.0 - DOLFIN_EPS) && on_boundary;
		}
	};

int main () {
	UnitSquare mesh(32, 32);

	Source f(mesh);

	Source urk(mesh);
	Source upk(mesh);
	Source uzk(mesh);

	Source urm(mesh);
	Source upm(mesh);
	Source uzm(mesh);

	Source f0k(mesh);
	Source f1k(mesh);
	Source f2k(mesh);

	Source pk(mesh);

	Source rr(mesh);
	Source r(mesh);

	Source tau1(mesh);
	Source Re(mesh);

	Source3D u0(mesh);

	DirichletBoundary d_boundary;
	DirichletBC bc0(u0, mesh, d_boundary);

	Array<BoundaryCondition*> bcs;
	bcs.push_back(&bc0);

	ChorinTemamFenicsBilinearForm a(
		urk, upk, uzk, 
		urm, upm, uzm,
		rr, r,
		tau1, Re);

	ChorinTemamFenicsLinearForm L(
		urk, upk, uzk, 
		urm, upm, uzm,
		f0k, f1k, f2k,
		pk,
		rr, r,
		tau1, Re);

	LinearPDE pde(a, L, mesh, bcs);

	Function u;
	pde.solve(u);

	plot(u);

	File file("navier-stokes.pvd");
	file << u;

	return 0;
}

Follow ups