[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-users] pb with ind_dof, nb_dof...
From: |
Clair Poignard |
Subject: |
[Getfem-users] pb with ind_dof, nb_dof... |
Date: |
Sun, 20 Sep 2009 15:56:04 +0200 |
User-agent: |
Thunderbird 2.0.0.23 (Macintosh/20090812) |
Dear All,
in the version getfem-3.1, I was using the following procedure (see the
end of the mail) to obtain a mass_matrix jump
\int_\Gamma (u^+-u^-)(\phi^+-\phi^-)\xdif \Gamma, where u is the unknown
(discontinuous across \Gamma), and \phi is the test-function in the
space of function piecewise H^1 (I used FEM_PK_DISCONTINUOUS elements to
solve this problem).
In the new version, when I compile I am said that "ind_dof_of_element'
is deprecated" and similarly for "'nb_dof_of_element'"and for
"point_of_dof'". In the file getfem_mesh_fem.h, it is mentioned that
ind_basic_dof_of_element has to be used (and similarly for nb_... and
point_...) instead of ind_dof_of_element
However if I replace in my program, the mass matrix jump identically
equals zero...
As you probably see, I am not an expert in computation, so if you have
an idea...
Best regards,
Clair
/class mass_matrix_jump : public getfem::compute_on_inter_element {
protected :
sparse_matrix &M;
double coeff_;
virtual void compute_on_gauss_point
(getfem::fem_interpolation_context ctx1, getfem::pfem pf1,
getfem::fem_interpolation_context ctx2, getfem::pfem pf2,
getfem::papprox_integration pai1) {
scalar_type w = pai1->integration_coefficients()[ctx1.ii()];
base_small_vector up(mf.linked_mesh().dim());
const base_matrix& B = ctx1.B();
gmm::mult(B, pgt1->normals()[f1], up);
scalar_type norm = gmm::vect_norm2(up);
scalar_type J = ctx1.J() * norm;
size_type cv1 = ctx1.convex_num();
size_type cv2 = ctx2.convex_num();
getfem::base_tensor t1, t2;
pf1->real_base_value(ctx1, t1);
pf2->real_base_value(ctx2, t2);
for (size_type i = 0; i < pf1->nb_dof(cv1); ++i)
for (size_type j = 0; j < pf1->nb_dof(cv1); ++j)
M(mf.ind_dof_of_element(cv1)[i],
mf.ind_dof_of_element(cv1)[j])
+= coeff_ * J * w * t1[i] * t1[j];
for (size_type i = 0; i < pf2->nb_dof(cv2); ++i)
for (size_type j = 0; j < pf2->nb_dof(cv2); ++j)
M(mf.ind_dof_of_element(cv2)[i],
mf.ind_dof_of_element(cv2)[j])
+= coeff_ * J * w * t2[i] * t2[j];
for (size_type i = 0; i < pf1->nb_dof(cv1); ++i)
for (size_type j = 0; j < pf2->nb_dof(cv2); ++j) {
M(mf.ind_dof_of_element(cv1)[i],
mf.ind_dof_of_element(cv2)[j])
-= coeff_ * J * w * t1[i] * t2[j];
M(mf.ind_dof_of_element(cv2)[j],
mf.ind_dof_of_element(cv1)[i])
-= coeff_ * J * w * t1[i] * t2[j];
}
}
public :
mass_matrix_jump(sparse_matrix &MM, const getfem::mesh_im &mmim,
const getfem::mesh_fem &mmf, double coeff = 1.)
: compute_on_inter_element(mmim, mmf), M(MM), coeff_(coeff) {
GMM_ASSERT1(mf.get_qdim() <= 1);
}
};
/
clair_poignard.vcf
Description: Vcard