Mercurial > fem-fenics-eugenio
changeset 24:632d6a9b907d
Add constructor for class derived from dolfin::Expression
author | gedeone-octave <marco.vassallo@outlook.com> |
---|---|
date | Mon, 15 Jul 2013 16:29:28 +0200 |
parents | aaf7644c7f89 |
children | 588064275843 |
files | test/test_bc.cpp test/test_bc.m |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/test/test_bc.cpp Mon Jul 15 14:42:18 2013 +0200 +++ b/test/test_bc.cpp Mon Jul 15 16:29:28 2013 +0200 @@ -6,6 +6,9 @@ class Source : public dolfin::Expression { + public: + Source() : dolfin::Expression() {} + void eval(dolfin::Array<double>& values, const dolfin::Array<double>& x) const { double dx = x[0] - 0.5; @@ -16,6 +19,9 @@ class dUdN : public dolfin::Expression { + public: + dUdN() : dolfin::Expression() {} + void eval(dolfin::Array<double>& values, const dolfin::Array<double>& x) const { values[0] = sin(5*x[0]);
--- a/test/test_bc.m Mon Jul 15 14:42:18 2013 +0200 +++ b/test/test_bc.m Mon Jul 15 16:29:28 2013 +0200 @@ -16,6 +16,9 @@ addpath ("../src/") # create a unit square mesh using msh: labels for the boundary sides are 1,2,3,4 +# we can use only 2D mesh for the moment +# if you want to try with a 3D mesh, you need to use tetrahedron instead of +# triangle inside Laplace.ufl and recompile fem_fs.cpp msho = msh2m_structured_mesh (0:0.05:1, 0:0.05:1, 1, 1:4); mshd = fem_init_mesh (msho); @@ -29,7 +32,7 @@ # the eval method available inside expression.h # if a side is not specified, Neumann conditions are applied # with g = sin(5*x) -bc = fem_bc (V, f, [2,4]); +bc = fem_bc (V, f, [2, 4]); # test_bc take as input the functionspace V, and the # boundarycondition bc and solve the Poisson problem with