help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using structures in OCT files


From: Andreas Stahel
Subject: Using structures in OCT files
Date: Thu, 14 Apr 2011 18:59:32 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

Dear Octave users

currently I am attempting to update a FEM package an with Octave 3.4
I have a hard time to implement a feature in an OCT file
On the Octave level I will have a structure Mesh of the type

Mesh.nodes = [0.0 0.5; 0.2,0.2;0.1,2.0]
Mesh. edge = [1 2; 2 3; 3 1]

Then in an C++ file I need to access those structures
in a command FEMEquation(Mesh, ...)

With older version of Octave I used codes like below

===================
DEFUN_DLD (FEMEquation, args, , "[...] = FEMEquation (...)\n ")
{
  octave_value_list retval;
  using namespace std;
  octave_value_list argin;
  octave_value_list res;
  int nargout;

  Octave_map arg0 = args(0).map_value ();

  Octave_map::const_iterator p1 = arg0.seek ("nodes");
  const Matrix nodes  =  arg0.contents(p1)(0).matrix_value();
  p1 = arg0.seek ("edge");
  const ColumnVector edge  =  arg0.contents(p1)(0).column_vector_value();
......
====================

Then I could use those matrices. Even with the help of section A.1.5 Structures in Oct-Files
in the manual I could not figure out how to adapt to the new method.
This failure is caused by my lack of knowledge of C++ and Octave programming.
I would really appreciate some help or a good pointer to a similar example.


--
Andreas Stahel       E-Mail: address@hidden
Mathematics, BFH-TI  Phone: ++41 +32 32 16 258
Quellgasse 21        Fax:   ++41 +32 321 500
CH-2501 Biel         WWW:   https://staff.ti.bfh.ch/sha1/
Switzerland



reply via email to

[Prev in Thread] Current Thread [Next in Thread]