[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-users] Data for piecewise constant coefficients
From: |
Jehanzeb Hameed |
Subject: |
[Getfem-users] Data for piecewise constant coefficients |
Date: |
Mon, 6 Jul 2009 20:00:27 -0500 |
Hello,
In laplacian.cc "getfem::classical_fem(pgt,0))" is used to represent
the fem space for coefficient function (mf_coef). This coefficient
function is constant on each convex. It is not used in laplacian.cc,
and is set to one by creating a vector ones (
std::vector<scalar_type>(mf_coef.nb_dof(), 1.0) ).
Now say, I want to this coefficient to be piecewise constant, that is
constant on each of (say two) subdomains. It seems I cant use
interpolation for it, as interpolation functions use coordinates of
points, and dont seem to indicate which convex they come from. One way
I can think of doing it, is to loop for mesh convexes, look up which
region the convex belongs to, and then set the corresponding entry in
the coefficient vector. However I am not sure if this is the way to
go, as numbering of convexes in the mesh may not correspond to
numbering of dof's of the vector passed as data for assembly.
Is the above method the one to use, or is there a more elegant way around this?
Thanks,
-Jehanzeb
- [Getfem-users] Data for piecewise constant coefficients,
Jehanzeb Hameed <=