--- Begin Message ---
------------------------------------------------------------
revno: 5621
committer: Johan Hake <hake.dev@xxxxxxxxx>
branch nick: dolfin
timestamp: Mon 2011-01-31 17:23:30 -0800
message:
Added VariationalProblem, Function and Form as shared_ptr
stored objects in the Python interface.
-- A small issue with limitations in SWIG < 2.0 to have a class
inherite two shared_ptr stored classes that Function now do
It results in an warning when the swig interface is generated
Should be ok
modified:
dolfin/swig/fem_pre.i
dolfin/swig/function_pre.i
dolfin/swig/shared_ptr_classes.i
--
lp:dolfin
https://code.launchpad.net/~dolfin-core/dolfin/main
Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription
=== modified file 'dolfin/swig/fem_pre.i'
--- dolfin/swig/fem_pre.i 2010-12-01 18:23:33 +0000
+++ dolfin/swig/fem_pre.i 2011-02-01 01:23:30 +0000
@@ -67,3 +67,15 @@
//-----------------------------------------------------------------------------
%ignore dolfin::BoundaryCondition::function_space;
%rename (_function_space) dolfin::BoundaryCondition::function_space_ptr;
+
+//-----------------------------------------------------------------------------
+// Instantiate Hierarchical Form
+//-----------------------------------------------------------------------------
+namespace dolfin {
+ class Form;
+ class VariationalProblem;
+}
+
+%template (HierarchicalForm) dolfin::Hierarchical<dolfin::Form>;
+%template (HierarchicalVariationalProblem) \
+ dolfin::Hierarchical<dolfin::VariationalProblem>;
=== modified file 'dolfin/swig/function_pre.i'
--- dolfin/swig/function_pre.i 2011-01-31 17:20:27 +0000
+++ dolfin/swig/function_pre.i 2011-02-01 01:23:30 +0000
@@ -4,7 +4,7 @@
//
// Modified by Ola Skavhaug, 2008
// Modified by Martin Sandve Alnaes, 2008
-// Modified by Johan Hake, 2008-2009
+// Modified by Johan Hake, 2008-2011
// Modified by Garth Wells, 2008-2010
// Modified by Kent-Andre Mardal, 2009
//
@@ -82,10 +82,12 @@
%feature("nodirector") dolfin::Expression::compute_vertex_values;
//-----------------------------------------------------------------------------
-// Instantiate Hierarchical FunctionSpace template class
+// Instantiate Hierarchical FunctionSpace, Function template class
//-----------------------------------------------------------------------------
namespace dolfin {
class FunctionSpace;
+ class Function;
}
%template (HierarchicalFunctionSpace) dolfin::Hierarchical<dolfin::FunctionSpace>;
+%template (HierarchicalFunction) dolfin::Hierarchical<dolfin::Function>;
=== modified file 'dolfin/swig/shared_ptr_classes.i'
--- dolfin/swig/shared_ptr_classes.i 2011-01-31 17:33:12 +0000
+++ dolfin/swig/shared_ptr_classes.i 2011-02-01 01:23:30 +0000
@@ -40,17 +40,22 @@
// Declare shared_ptr stored types in PyDOLFIN
//-----------------------------------------------------------------------------
#if SWIG_VERSION >= 0x020000
+%shared_ptr(dolfin::Hierarchical<dolfin::Form>)
%shared_ptr(dolfin::GenericDofMap)
%shared_ptr(dolfin::DofMap)
%shared_ptr(dolfin::Form)
%shared_ptr(dolfin::FiniteElement)
+%shared_ptr(dolfin::Hierarchical<dolfin::VariationalProblem>)
+%shared_ptr(dolfin::VariationalProblem)
+
%shared_ptr(dolfin::Hierarchical<dolfin::FunctionSpace>)
%shared_ptr(dolfin::FunctionSpace)
%shared_ptr(dolfin::SubSpace)
%shared_ptr(dolfin::GenericFunction)
+%shared_ptr(dolfin::Hierarchical<dolfin::Function>)
%shared_ptr(dolfin::Function)
%shared_ptr(dolfin::Expression)
%shared_ptr(dolfin::FacetArea)
@@ -106,18 +111,28 @@
#else
+SWIG_SHARED_PTR(HierarchicalForm, dolfin::Hierarchical<dolfin::Form>)
SWIG_SHARED_PTR(GenericDofMap, dolfin::GenericDofMap)
SWIG_SHARED_PTR_DERIVED(DofMap, dolfin::GenericDofMap, dolfin::DofMap)
SWIG_SHARED_PTR(FiniteElement, dolfin::FiniteElement)
SWIG_SHARED_PTR(Form, dolfin::Form)
+SWIG_SHARED_PTR(HierarchicalVariationalProblem, \
+ dolfin::Hierarchical<dolfin::VariationalProblem>)
+SWIG_SHARED_PTR_DERIVED(VariationalProblem, \
+ dolfin::Hierarchical<dolfin::VariationalProblem>, \
+ dolfin::VariationalProblem)
+
SWIG_SHARED_PTR(HierarchicalFunctionSpace, dolfin::Hierarchical<dolfin::FunctionSpace>)
SWIG_SHARED_PTR_DERIVED(FunctionSpace, dolfin::Hierarchical<dolfin::FunctionSpace>,\
dolfin::FunctionSpace)
SWIG_SHARED_PTR_DERIVED(SubSpace, dolfin::FunctionSpace, dolfin::SubSpace)
+SWIG_SHARED_PTR(HierarchicalFunction, dolfin::Hierarchical<dolfin::Function>)
SWIG_SHARED_PTR(GenericFunction, dolfin::GenericFunction)
SWIG_SHARED_PTR_DERIVED(Function, dolfin::GenericFunction, dolfin::Function)
+SWIG_SHARED_PTR_DERIVED(Function, dolfin::Hierarchical<dolfin::Function>,\
+ dolfin::Function)
SWIG_SHARED_PTR_DERIVED(Expression, dolfin::GenericFunction, dolfin::Expression)
SWIG_SHARED_PTR_DERIVED(FacetArea, dolfin::Expression, dolfin::FacetArea)
SWIG_SHARED_PTR_DERIVED(Constant, dolfin::Expression, dolfin::Constant)
--- End Message ---