[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] r5257 - in /trunk/getfem: interface/src/ src/ src/getfe
From: |
logari81 |
Subject: |
[Getfem-commits] r5257 - in /trunk/getfem: interface/src/ src/ src/getfem/ |
Date: |
Tue, 22 Mar 2016 23:37:41 -0000 |
Author: logari81
Date: Wed Mar 23 00:37:40 2016
New Revision: 5257
URL: http://svn.gna.org/viewcvs/getfem?rev=5257&view=rev
Log:
add constness, add class destructors, increase maximum mesh region id accepted
through the scripting interface
Modified:
trunk/getfem/interface/src/getfemint_gsparse.h
trunk/getfem/interface/src/gf_mesh_set.cc
trunk/getfem/src/getfem/getfem_contact_and_friction_large_sliding.h
trunk/getfem/src/getfem/getfem_global_function.h
trunk/getfem/src/getfem/getfem_mesh_region.h
trunk/getfem/src/getfem_contact_and_friction_common.cc
trunk/getfem/src/getfem_contact_and_friction_large_sliding.cc
trunk/getfem/src/getfem_generic_assembly.cc
trunk/getfem/src/getfem_mesh_region.cc
Modified: trunk/getfem/interface/src/getfemint_gsparse.h
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/src/getfemint_gsparse.h?rev=5257&r1=5256&r2=5257&view=diff
==============================================================================
--- trunk/getfem/interface/src/getfemint_gsparse.h (original)
+++ trunk/getfem/interface/src/getfemint_gsparse.h Wed Mar 23 00:37:40 2016
@@ -147,6 +147,7 @@
default: THROW_INTERNAL_ERROR;
}
}
+ virtual ~gsparse() { destroy(); }
};
void spmat_set_diag(gsparse &gsp, mexargs_in& in, bool create_matrix);
Modified: trunk/getfem/interface/src/gf_mesh_set.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/src/gf_mesh_set.cc?rev=5257&r1=5256&r2=5257&view=diff
==============================================================================
--- trunk/getfem/interface/src/gf_mesh_set.cc (original)
+++ trunk/getfem/interface/src/gf_mesh_set.cc Wed Mar 23 00:37:40 2016
@@ -59,24 +59,24 @@
}
static void intersect_regions(getfem::mesh &mesh, getfemint::mexargs_in& in) {
- unsigned ir1 = in.pop().to_integer(1,1000000);
- unsigned ir2 = in.pop().to_integer(1,1000000);
+ unsigned ir1 = in.pop().to_integer(1,100000000);
+ unsigned ir2 = in.pop().to_integer(1,100000000);
getfem::mesh_region &r1 = mesh.region(ir1);
getfem::mesh_region &r2 = mesh.region(ir2);
r1 = getfem::mesh_region::intersection(r1, r2);
}
static void merge_regions(getfem::mesh &mesh, getfemint::mexargs_in& in) {
- unsigned ir1 = in.pop().to_integer(1,1000000);
- unsigned ir2 = in.pop().to_integer(1,1000000);
+ unsigned ir1 = in.pop().to_integer(1,100000000);
+ unsigned ir2 = in.pop().to_integer(1,100000000);
getfem::mesh_region &r1 = mesh.region(ir1);
getfem::mesh_region &r2 = mesh.region(ir2);
r1 = getfem::mesh_region::merge(r1, r2);
}
static void subtract_regions(getfem::mesh &mesh, getfemint::mexargs_in& in) {
- unsigned ir1 = in.pop().to_integer(1,1000000);
- unsigned ir2 = in.pop().to_integer(1,1000000);
+ unsigned ir1 = in.pop().to_integer(1,100000000);
+ unsigned ir2 = in.pop().to_integer(1,100000000);
getfem::mesh_region &r1 = mesh.region(ir1);
getfem::mesh_region &r2 = mesh.region(ir2);
r1 = getfem::mesh_region::subtract(r1, r2);
Modified: trunk/getfem/src/getfem/getfem_contact_and_friction_large_sliding.h
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_contact_and_friction_large_sliding.h?rev=5257&r1=5256&r2=5257&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_contact_and_friction_large_sliding.h
(original)
+++ trunk/getfem/src/getfem/getfem_contact_and_friction_large_sliding.h Wed Mar
23 00:37:40 2016
@@ -81,7 +81,7 @@
`N` is the mesh dimension.
*/
void add_rigid_obstacle_to_large_sliding_contact_brick
- (model &md, size_type indbrick, std::string expr, size_type N);
+ (model &md, size_type indbrick, const std::string &expr, size_type N);
/** Gives the name of the group of variables corresponding to the
sliding data for an existing large sliding contact brick.
Modified: trunk/getfem/src/getfem/getfem_global_function.h
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_global_function.h?rev=5257&r1=5256&r2=5257&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_global_function.h (original)
+++ trunk/getfem/src/getfem/getfem_global_function.h Wed Mar 23 00:37:40 2016
@@ -106,6 +106,8 @@
const std::string &sval,
const std::string &sgrad="",
const std::string &shess="");
+ virtual ~global_function_parser()
+ { DAL_STORED_OBJECT_DEBUG_DESTROYED(this, "Global function parser"); }
};
@@ -212,6 +214,7 @@
parser_xy_function(const std::string &sval,
const std::string &sgrad="0;0;",
const std::string &shess="0;0;0;0;");
+ virtual ~parser_xy_function() {}
};
struct crack_singular_xy_function : public abstract_xy_function {
@@ -220,6 +223,7 @@
virtual base_small_vector grad(scalar_type x, scalar_type y) const;
virtual base_matrix hess(scalar_type x, scalar_type y) const;
crack_singular_xy_function(unsigned l_) : l(l_) {}
+ virtual ~crack_singular_xy_function() {}
};
struct cutoff_xy_function : public abstract_xy_function {
@@ -234,6 +238,7 @@
virtual base_matrix hess(scalar_type x, scalar_type y) const;
cutoff_xy_function(int fun_num, scalar_type r,
scalar_type r1, scalar_type r0);
+ virtual ~cutoff_xy_function() {}
};
struct interpolated_xy_function : public abstract_xy_function {
@@ -254,6 +259,7 @@
interpolated_xy_function(const pinterpolator_on_mesh_fem &itp_,
size_type c) :
itp(itp_), component(c) {}
+ virtual ~interpolated_xy_function() {}
};
struct product_of_xy_functions : public abstract_xy_function {
@@ -273,6 +279,7 @@
}
product_of_xy_functions(pxy_function &fn1_, pxy_function &fn2_)
: fn1(fn1_), fn2(fn2_) {}
+ virtual ~product_of_xy_functions() {}
};
struct add_of_xy_functions : public abstract_xy_function {
@@ -290,6 +297,7 @@
}
add_of_xy_functions(const pxy_function &fn1_, const pxy_function &fn2_)
: fn1(fn1_), fn2(fn2_) {}
+ virtual ~add_of_xy_functions() {}
};
Modified: trunk/getfem/src/getfem/getfem_mesh_region.h
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_mesh_region.h?rev=5257&r1=5256&r2=5257&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_mesh_region.h (original)
+++ trunk/getfem/src/getfem/getfem_mesh_region.h Wed Mar 23 00:37:40 2016
@@ -199,7 +199,7 @@
mesh_region& operator=(const mesh_region &mr);
- bool compare(const mesh &m1, const mesh_region &mr, const mesh &m2);
+ bool compare(const mesh &m1, const mesh_region &mr, const mesh &m2) const;
face_bitset operator[](size_t cv) const;
Modified: trunk/getfem/src/getfem_contact_and_friction_common.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_contact_and_friction_common.cc?rev=5257&r1=5256&r2=5257&view=diff
==============================================================================
--- trunk/getfem/src/getfem_contact_and_friction_common.cc (original)
+++ trunk/getfem/src/getfem_contact_and_friction_common.cc Wed Mar 23
00:37:40 2016
@@ -1329,7 +1329,7 @@
contact_boundary()
: region(-1), mfu(0), dispname(""), U(0), U_unred(0), slave(false) {}
- contact_boundary(size_type r, const mesh_fem *mf, const std::string dn,
+ contact_boundary(size_type r, const mesh_fem *mf, const std::string &dn,
bool sl)
: region(r), mfu(mf), dispname(dn), slave(sl) {}
};
Modified: trunk/getfem/src/getfem_contact_and_friction_large_sliding.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_contact_and_friction_large_sliding.cc?rev=5257&r1=5256&r2=5257&view=diff
==============================================================================
--- trunk/getfem/src/getfem_contact_and_friction_large_sliding.cc
(original)
+++ trunk/getfem/src/getfem_contact_and_friction_large_sliding.cc Wed Mar
23 00:37:40 2016
@@ -2514,7 +2514,7 @@
}
void add_rigid_obstacle_to_large_sliding_contact_brick
- (model &md, size_type indbrick, std::string expr, size_type N) {
+ (model &md, size_type indbrick, const std::string &expr, size_type N) {
pbrick pbr = md.brick_pointer(indbrick);
intergral_large_sliding_contact_brick_raytracing *p
= dynamic_cast<intergral_large_sliding_contact_brick_raytracing *>
Modified: trunk/getfem/src/getfem_generic_assembly.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_generic_assembly.cc?rev=5257&r1=5256&r2=5257&view=diff
==============================================================================
--- trunk/getfem/src/getfem_generic_assembly.cc (original)
+++ trunk/getfem/src/getfem_generic_assembly.cc Wed Mar 23 00:37:40 2016
@@ -3525,7 +3525,7 @@
struct ga_instruction_interpolate_filter : public ga_instruction {
base_tensor &t;
- ga_instruction_set::interpolate_info &inin;
+ const ga_instruction_set::interpolate_info &inin;
size_type pt_type;
int nb;
@@ -3545,7 +3545,7 @@
}
ga_instruction_interpolate_filter
- (base_tensor &t_, ga_instruction_set::interpolate_info &inin_,
+ (base_tensor &t_, const ga_instruction_set::interpolate_info &inin_,
size_type ind_, int nb_)
: t(t_), inin(inin_), pt_type(ind_), nb(nb_) {}
};
@@ -3559,7 +3559,7 @@
fem_interpolation_context &ctx;
base_vector coeff;
size_type qdim;
- size_type &ipt;
+ const size_type &ipt;
fem_precomp_pool &fp_pool;
ga_instruction_set::interpolate_info &inin;
@@ -3586,7 +3586,7 @@
ga_instruction_interpolate
(base_tensor &tt, const mesh **m_, const mesh_fem *mfn_,
const mesh_fem **mfg_, const base_vector *Un_, const base_vector **Ug_,
- fem_interpolation_context &ctx_, size_type q, size_type &ipt_,
+ fem_interpolation_context &ctx_, size_type q, const size_type &ipt_,
fem_precomp_pool &fp_pool_, ga_instruction_set::interpolate_info &inin_)
: t(tt), m(m_), mfn(mfn_), mfg(mfg_), Un(Un_), Ug(Ug_),
ctx(ctx_), qdim(q), ipt(ipt_), fp_pool(fp_pool_), inin(inin_) {}
@@ -3678,7 +3678,7 @@
const mesh **m;
const mesh_fem *mfn, **mfg;
fem_interpolation_context &ctx;
- size_type &ipt;
+ const size_type &ipt;
fem_precomp_pool &fp_pool;
ga_instruction_set::interpolate_info &inin;
@@ -3704,7 +3704,7 @@
ga_instruction_interpolate_base
(const mesh **m_, const mesh_fem *mfn_, const mesh_fem **mfg_,
- fem_interpolation_context &ctx_, size_type &ipt_,
+ fem_interpolation_context &ctx_, const size_type &ipt_,
fem_precomp_pool &fp_pool_, ga_instruction_set::interpolate_info &inin_)
: m(m_), mfn(mfn_), mfg(mfg_), ctx(ctx_), ipt(ipt_),
fp_pool(fp_pool_), inin(inin_) {}
@@ -3723,7 +3723,7 @@
ga_instruction_interpolate_val_base
(base_tensor &t_, const mesh **m_, const mesh_fem *mfn_,
const mesh_fem **mfg_, fem_interpolation_context &ctx_, size_type q,
- size_type &ipt_, fem_precomp_pool &fp_pool_,
+ const size_type &ipt_, fem_precomp_pool &fp_pool_,
ga_instruction_set::interpolate_info &inin_)
: ga_instruction_copy_val_base(t_, ZZ, q),
ga_instruction_interpolate_base(m_, mfn_, mfg_, ctx_, ipt_,
@@ -3743,7 +3743,7 @@
ga_instruction_interpolate_grad_base
(base_tensor &t_, const mesh **m_, const mesh_fem *mfn_,
const mesh_fem **mfg_, fem_interpolation_context &ctx_, size_type q,
- size_type &ipt_, fem_precomp_pool &fp_pool_,
+ const size_type &ipt_, fem_precomp_pool &fp_pool_,
ga_instruction_set::interpolate_info &inin_)
: ga_instruction_copy_grad_base(t_, ZZ, q),
ga_instruction_interpolate_base(m_, mfn_, mfg_, ctx_, ipt_,
@@ -3763,7 +3763,7 @@
ga_instruction_interpolate_hess_base
(base_tensor &t_, const mesh **m_, const mesh_fem *mfn_,
const mesh_fem **mfg_, fem_interpolation_context &ctx_, size_type q,
- size_type &ipt_, fem_precomp_pool &fp_pool_,
+ const size_type &ipt_, fem_precomp_pool &fp_pool_,
ga_instruction_set::interpolate_info &inin_)
: ga_instruction_copy_hess_base(t_, ZZ, q),
ga_instruction_interpolate_base(m_, mfn_, mfg_, ctx_, ipt_,
@@ -3783,7 +3783,7 @@
ga_instruction_interpolate_diverg_base
(base_tensor &t_, const mesh **m_, const mesh_fem *mfn_,
const mesh_fem **mfg_, fem_interpolation_context &ctx_, size_type q,
- size_type &ipt_, fem_precomp_pool &fp_pool_,
+ const size_type &ipt_, fem_precomp_pool &fp_pool_,
ga_instruction_set::interpolate_info &inin_)
: ga_instruction_copy_diverg_base(t_, ZZ, q),
ga_instruction_interpolate_base(m_, mfn_, mfg_, ctx_, ipt_,
@@ -4866,7 +4866,7 @@
ga_instruction_set::interpolate_info &inin;
pinterpolate_transformation trans;
fem_interpolation_context &ctx;
- base_small_vector &Normal;
+ const base_small_vector &Normal;
const mesh &m;
bool compute_der;
@@ -4908,7 +4908,7 @@
ga_instruction_transformation_call
(ga_workspace &w, ga_instruction_set::interpolate_info &i,
pinterpolate_transformation t, fem_interpolation_context &ctxx,
- base_small_vector &No, const mesh &mm, bool compute_der_)
+ const base_small_vector &No, const mesh &mm, bool compute_der_)
: workspace(w), inin(i), trans(t), ctx(ctxx), Normal(No), m(mm),
compute_der(compute_der_) {}
};
@@ -5129,7 +5129,7 @@
const mesh_fem *mfn1, *mfn2;
const mesh_fem **mfg1, **mfg2;
const scalar_type &coeff, &alpha1, &alpha2;
- size_type &nbpt, &ipt;
+ const size_type &nbpt, &ipt;
base_vector &elem;
bool interpolate;
virtual int exec(void) {
@@ -5194,8 +5194,9 @@
const scalar_type &coeff_,
const scalar_type &alpha2_,
const scalar_type &alpha1_,
- size_type &nbpt_,
- size_type &ipt_, base_vector &elem_,
+ const size_type &nbpt_,
+ const size_type &ipt_,
+ base_vector &elem_,
bool interpolate_)
: t(t_), Kr(Kr_), Kn(Kn_), ctx1(ctx1_), ctx2(ctx2_),
Ir1(Ir1_), Ir2(Ir2_), In1(In1_), In2(In2_),
Modified: trunk/getfem/src/getfem_mesh_region.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_mesh_region.cc?rev=5257&r1=5256&r2=5257&view=diff
==============================================================================
--- trunk/getfem/src/getfem_mesh_region.cc (original)
+++ trunk/getfem/src/getfem_mesh_region.cc Wed Mar 23 00:37:40 2016
@@ -126,7 +126,7 @@
}
bool mesh_region::compare(const mesh &m1, const mesh_region &mr,
- const mesh &m2) {
+ const mesh &m2) const {
if (&m1 != &m2) return false;
this->from_mesh(m1);
mr.from_mesh(m2);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] r5257 - in /trunk/getfem: interface/src/ src/ src/getfem/,
logari81 <=