[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] r4854 - in /trunk/getfem: ./ doc/sphinx/source/userdoc/
From: |
Yves . Renard |
Subject: |
[Getfem-commits] r4854 - in /trunk/getfem: ./ doc/sphinx/source/userdoc/ interface/tests/matlab/ src/ src/gmm/ |
Date: |
Mon, 09 Feb 2015 16:59:23 -0000 |
Author: renard
Date: Mon Feb 9 17:59:22 2015
New Revision: 4854
URL: http://svn.gna.org/viewcvs/getfem?rev=4854&view=rev
Log:
adding element_size to the generic assembly and some other small fixes
Modified:
trunk/getfem/configure.ac
trunk/getfem/doc/sphinx/source/userdoc/gasm_high.rst
trunk/getfem/interface/tests/matlab/demo_dynamic_plasticity.m
trunk/getfem/interface/tests/matlab/demo_static_contact.m
trunk/getfem/src/getfem_generic_assembly.cc
trunk/getfem/src/gmm/gmm_lapack_interface.h
Modified: trunk/getfem/configure.ac
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/configure.ac?rev=4854&r1=4853&r2=4854&view=diff
==============================================================================
--- trunk/getfem/configure.ac (original)
+++ trunk/getfem/configure.ac Mon Feb 9 17:59:22 2015
@@ -8,10 +8,10 @@
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl
-AC_INIT(getfem, 4.3.1)
+AC_INIT(getfem, 4.3.2)
MAJOR_VERSION="4"
MINOR_VERSION="3"
-PATCH_VERSION="1"
+PATCH_VERSION="2"
AC_CONFIG_SRCDIR([install-sh])
AC_CONFIG_MACRO_DIR([m4])
Modified: trunk/getfem/doc/sphinx/source/userdoc/gasm_high.rst
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/doc/sphinx/source/userdoc/gasm_high.rst?rev=4854&r1=4853&r2=4854&view=diff
==============================================================================
--- trunk/getfem/doc/sphinx/source/userdoc/gasm_high.rst (original)
+++ trunk/getfem/doc/sphinx/source/userdoc/gasm_high.rst Mon Feb 9
17:59:22 2015
@@ -524,6 +524,8 @@
- ``Normal`` the outward unit normal vector to a boundary when integration
on a boundary is performed.
+ - ``element_size`` gives an estimate of the current element diameter (using
getfem::convex_radius_estimate).
+
Print command
*************
Modified: trunk/getfem/interface/tests/matlab/demo_dynamic_plasticity.m
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/tests/matlab/demo_dynamic_plasticity.m?rev=4854&r1=4853&r2=4854&view=diff
==============================================================================
--- trunk/getfem/interface/tests/matlab/demo_dynamic_plasticity.m
(original)
+++ trunk/getfem/interface/tests/matlab/demo_dynamic_plasticity.m Mon Feb
9 17:59:22 2015
@@ -46,7 +46,7 @@
% The choice alpha = 1/2 yields the mid point method and alpha = 1 leads to
% backward Euler integration
alpha_method = true;
-alpha = 1.0;
+alpha = 0.5;
f = [15000 0]';
Modified: trunk/getfem/interface/tests/matlab/demo_static_contact.m
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/tests/matlab/demo_static_contact.m?rev=4854&r1=4853&r2=4854&view=diff
==============================================================================
--- trunk/getfem/interface/tests/matlab/demo_static_contact.m (original)
+++ trunk/getfem/interface/tests/matlab/demo_static_contact.m Mon Feb 9
17:59:22 2015
@@ -26,10 +26,10 @@
clear all;
% Import the mesh : disc
-m=gf_mesh('load', '../../../tests/meshes/disc_P2_h4.mesh');
+% m=gf_mesh('load', '../../../tests/meshes/disc_P2_h4.mesh');
% m=gf_mesh('load', '../../../tests/meshes/disc_P2_h2.mesh');
% m=gf_mesh('load', '../../../tests/meshes/disc_P2_h1.mesh');
-% m=gf_mesh('load', '../../../tests/meshes/disc_P2_h0_5.mesh');
+m=gf_mesh('load', '../../../tests/meshes/disc_P2_h0_5.mesh');
% m=gf_mesh('load', '../../../tests/meshes/disc_P2_h0_3.mesh');
% Import the mesh : sphere
Modified: trunk/getfem/src/getfem_generic_assembly.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_generic_assembly.cc?rev=4854&r1=4853&r2=4854&view=diff
==============================================================================
--- trunk/getfem/src/getfem_generic_assembly.cc (original)
+++ trunk/getfem/src/getfem_generic_assembly.cc Mon Feb 9 17:59:22 2015
@@ -268,6 +268,7 @@
GA_NODE_ALLINDICES,
GA_NODE_C_MATRIX,
GA_NODE_X,
+ GA_NODE_ELT_SIZE,
GA_NODE_NORMAL,
GA_NODE_VAL,
GA_NODE_GRAD,
@@ -973,6 +974,7 @@
case GA_NODE_X:
if (pnode->nbc1) str << "X(" << pnode->nbc1 << ")"; else str << "X";
break;
+ case GA_NODE_ELT_SIZE: str << "element_size"; break;
case GA_NODE_NORMAL: str << "Normal"; break;
case GA_NODE_INTERPOLATE:
str << "Interpolate(" << pnode->name << ","
@@ -1420,6 +1422,9 @@
fem_interpolation_context ctx; // Current fem interpolation context.
base_small_vector Normal; // Outward unit normal vector to the
// boundary in case of boundary integration
+ scalar_type elt_size; // Estimate of the diameter of the element
+ // if needed.
+ bool need_elt_size;
scalar_type coeff; // Coefficient for the Gauss point
size_type nbpt, ipt; // Number and index of Gauss point
bgeot::geotrans_precomp_pool gp_pool;
@@ -1494,7 +1499,7 @@
instructions_set whole_instructions;
- ga_instruction_set(void) { max_dof = nb_dof = 0; }
+ ga_instruction_set(void) { max_dof = nb_dof = 0; need_elt_size = false; }
};
@@ -1993,7 +1998,6 @@
// Predefined special functions
SPEC_FUNCTIONS.insert("pi");
- SPEC_FUNCTIONS.insert("meshdim");
SPEC_FUNCTIONS.insert("qdim");
SPEC_FUNCTIONS.insert("qdims");
SPEC_FUNCTIONS.insert("Id");
@@ -2318,6 +2322,21 @@
ga_instruction_Normal(base_tensor &t_, base_small_vector &Normal_)
: t(t_), Normal(Normal_) {}
};
+
+ struct ga_instruction_element_size : public ga_instruction {
+ base_tensor &t;
+ scalar_type &es;
+
+ virtual int exec(void) {
+ GA_DEBUG_INFO("Instruction: element_size");
+ GMM_ASSERT1(t.size() == 1, "Invalid element size.");
+ t[0] = es;
+ return 0;
+ }
+ ga_instruction_element_size(base_tensor &t_, scalar_type &es_)
+ : t(t_), es(es_) {}
+ };
+
struct ga_instruction_base : public ga_instruction {
@@ -4635,7 +4654,7 @@
switch (pnode->node_type) {
case GA_NODE_PREDEF_FUNC: case GA_NODE_OPERATOR: case GA_NODE_SPEC_FUNC :
- case GA_NODE_CONSTANT: case GA_NODE_X: case GA_NODE_NORMAL:
+ case GA_NODE_CONSTANT: case GA_NODE_X: case GA_NODE_ELT_SIZE: case
GA_NODE_NORMAL:
case GA_NODE_INTERPOLATE_X: case GA_NODE_INTERPOLATE_NORMAL:
case GA_NODE_RESHAPE:
pnode->test_function_type = 0; break;
@@ -5535,6 +5554,11 @@
pnode->node_type = GA_NODE_X;
pnode->nbc1 = 0;
pnode->init_vector_tensor(meshdim);
+ break;
+ }
+ if (!(name.compare("element_size"))) {
+ pnode->node_type = GA_NODE_ELT_SIZE;
+ pnode->init_scalar_tensor(0);
break;
}
if (!(name.compare("Normal"))) {
@@ -7228,6 +7252,15 @@
rmi.instructions.push_back(pgai);
break;
+ case GA_NODE_ELT_SIZE:
+ GMM_ASSERT1(!function_case,
+ "No use of element_size is allowed in functions");
+ if (pnode->t.size() != 1) pnode->init_scalar_tensor(0);
+ pgai = new ga_instruction_element_size(pnode->t, gis.elt_size);
+ gis.need_elt_size = true;
+ rmi.instructions.push_back(pgai);
+ break;
+
case GA_NODE_NORMAL:
GMM_ASSERT1(!function_case,
"No use of Normal is allowed in functions");
@@ -8280,6 +8313,9 @@
v.cv(), v.f());
}
}
+
+ if (gis.need_elt_size)
+ gis.elt_size = m.convex_radius_estimate(v.cv()) * scalar_type(2);
// iterations on interpolation points
gis.nbpt = spt.size();
@@ -8385,7 +8421,8 @@
}
}
gis.pai = pim->approx_method();
-
+ if (gis.need_elt_size)
+ gis.elt_size = m.convex_radius_estimate(v.cv()) * scalar_type(2);
// iterations on Gauss points
gis.nbpt = gis.pai->nb_points_on_convex();
size_type first_ind = 0;
Modified: trunk/getfem/src/gmm/gmm_lapack_interface.h
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/gmm/gmm_lapack_interface.h?rev=4854&r1=4853&r2=4854&view=diff
==============================================================================
--- trunk/getfem/src/gmm/gmm_lapack_interface.h (original)
+++ trunk/getfem/src/gmm/gmm_lapack_interface.h Mon Feb 9 17:59:22 2015
@@ -468,6 +468,6 @@
}// namespace gmm
-#endif // GMM_USES_LAPACK\
+#endif // GMM_USES_LAPACK
#endif // GMM_LAPACK_INTERFACE_H
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] r4854 - in /trunk/getfem: ./ doc/sphinx/source/userdoc/ interface/tests/matlab/ src/ src/gmm/,
Yves . Renard <=