[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] r4622 - in /trunk/getfem: interface/src/gf_compute.cc s
From: |
Yves . Renard |
Subject: |
[Getfem-commits] r4622 - in /trunk/getfem: interface/src/gf_compute.cc src/getfem/getfem_error_estimate.h src/getfem_error_estimate.cc |
Date: |
Tue, 22 Apr 2014 12:50:50 -0000 |
Author: renard
Date: Tue Apr 22 14:50:49 2014
New Revision: 4622
URL: http://svn.gna.org/viewcvs/getfem?rev=4622&view=rev
Log:
little fixes
Modified:
trunk/getfem/interface/src/gf_compute.cc
trunk/getfem/src/getfem/getfem_error_estimate.h
trunk/getfem/src/getfem_error_estimate.cc
Modified: trunk/getfem/interface/src/gf_compute.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/src/gf_compute.cc?rev=4622&r1=4621&r2=4622&view=diff
==============================================================================
--- trunk/getfem/interface/src/gf_compute.cc (original)
+++ trunk/getfem/interface/src/gf_compute.cc Tue Apr 22 14:50:49 2014
@@ -523,7 +523,7 @@
Currently there is only one which is available: for each convex,
the jump of the normal derivative is integrated on its address@hidden/
sub_command
- ("error_estimate_nitsche", 5, 5, 0, 1,
+ ("error_estimate_nitsche", 7, 7, 0, 1,
const getfem::mesh_im &mim = *in.pop().to_const_mesh_im();
scalar_type GAMMAC = in.pop().to_scalar();
scalar_type GAMMAN = in.pop().to_scalar();
@@ -537,7 +537,7 @@
getfem::base_vector ERR(si);
getfem::base_vector UU(U.real().size());
gmm::copy(U.real(), UU);
- getfem::error_estimate_nitsche(mim, *mf, UU, GAMMAC, GAMMAN, lambda,
mu, ERR);
+ getfem::error_estimate_nitsche(mim, *mf, UU, GAMMAC, GAMMAN, lambda,
mu, gamma0, f_coeff, ERR);
gmm::copy(ERR, err);
);
Modified: trunk/getfem/src/getfem/getfem_error_estimate.h
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_error_estimate.h?rev=4622&r1=4621&r2=4622&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_error_estimate.h (original)
+++ trunk/getfem/src/getfem/getfem_error_estimate.h Tue Apr 22 14:50:49 2014
@@ -154,12 +154,12 @@
void error_estimate_nitsche(const mesh_im & mim,
const mesh_fem &mf_u,
const base_vector &U,
- scalar_type GAMMAC,
- scalar_type GAMMAN,
- scalar_type lambda,
- scalar_type mu,
- scalar_type gamma0,
- scalar_type f_coeff,
+ scalar_type GAMMAC,
+ scalar_type GAMMAN,
+ scalar_type lambda,
+ scalar_type mu,
+ scalar_type gamma0,
+ scalar_type f_coeff,
base_vector &ERR);
Modified: trunk/getfem/src/getfem_error_estimate.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_error_estimate.cc?rev=4622&r1=4621&r2=4622&view=diff
==============================================================================
--- trunk/getfem/src/getfem_error_estimate.cc (original)
+++ trunk/getfem/src/getfem_error_estimate.cc Tue Apr 22 14:50:49 2014
@@ -29,16 +29,15 @@
#ifdef EXPERIMENTAL_PURPOSE_ONLY
-
void error_estimate_nitsche(const mesh_im & mim,
const mesh_fem &mf_u,
const base_vector &U,
- scalar_type GAMMAC,
- scalar_type GAMMAN,
- scalar_type lambda,
- scalar_type mu,
- scalar_type gamma0,
- scalar_type f_coeff,
+ scalar_type GAMMAC,
+ scalar_type GAMMAN,
+ scalar_type lambda,
+ scalar_type mu,
+ scalar_type gamma0,
+ scalar_type f_coeff,
base_vector &ERR) {
@@ -55,10 +54,6 @@
base_node xref2(N);
base_small_vector up(N), jump(N), Pr(N), sig(N);
// scalar_type young_modulus = 4*mu*(lambda + mu)/(lambda+2*mu);
-
- // computation of h for gamma = gamma0*h
- scalar_type emax, emin; gmm::condition_number(ctx.K(),emax,emin);
- gamma = gamma0 * emax * sqrt(scalar_type(N));
GMM_ASSERT1(!mf_u.is_reduced(), "To be adapted");
@@ -304,12 +299,12 @@
};
-#if 0
+#if 1
int bnum = GAMMAC; // terme de nitsche + tangeant
getfem::mesh_region region = m.region(bnum);
- for (getfem::mr_visitor v(region,mesh); !v.finished(); ++v) {
+ for (getfem::mr_visitor v(region, m); !v.finished(); ++v) {
// getfem::mesher_level_set mmls = ls.mls_of_convex(v.cv(), 0);
bgeot::pgeometric_trans pgt1 = m.trans_of_convex(v.cv());
@@ -325,11 +320,15 @@
getfem::fem_interpolation_context ctx1(pgt1, pf1, base_node(N), G1,
v.cv());
-
-
- for (short_type f=0; f<m.structure_of_convex(v.cv())->nb_faces(); ++f)
- for (unsigned ii=0; ii < pai1->nb_points_on_face(f); ++ii) {
-
+ // computation of h for gamma = gamma0*h
+ scalar_type emax, emin, gamma;
+ gmm::condition_number(ctx1.K(),emax,emin);
+ gamma = gamma0 * emax * sqrt(scalar_type(N));
+
+ short_type f = v.f();
+
+ for (unsigned ii=0; ii < pai1->nb_points_on_face(f); ++ii) {
+
ctx1.set_xref(pai1->point_on_face(f, ii));
gmm::mult(ctx1.B(), pgt1->normals()[f], up);
scalar_type norm = gmm::vect_norm2(up);
@@ -345,21 +344,21 @@
gmm::mult(S1, up, sig);
gmm::copy(sig,jump);
- gmm::scaled(jump, -scalar_type(1)*gamma);
+ gmm::scaled(jump, -gamma);
gmm::add(U,jump);
- coupled_projection(jump, up, f_coeff, Pr); // Nitsche's terms
- gmm::scaled(Pr, 1/gamma);
+ // coupled_projection(jump, up, f_coeff, Pr); // Nitsche's terms
+ gmm::scaled(Pr, 1./gamma);
gmm::scaled(sig,gamma);
gmm::add(sig,Pr);
ERR[v.cv()] +=radius * coefficient * gmm::vect_norm2_sqr(Pr);
//
- }
-
-
- if (ERR[v.cv()] > 100)
- cout << "Erreur en résidu sur element " << v.cv() << " : " <<
ERR[v.cv()] << endl;
-
+ }
+
+
+ if (ERR[v.cv()] > 100)
+ cout << "Erreur en résidu sur element " << v.cv() << " : " <<
ERR[v.cv()] << endl;
+
};
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] r4622 - in /trunk/getfem: interface/src/gf_compute.cc src/getfem/getfem_error_estimate.h src/getfem_error_estimate.cc,
Yves . Renard <=