view src/fem_init_env.cc @ 80:16ccfaf1476a

The function DEFINE_OCTAVE_ALLOCATOR and DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA are now implemented in the header file. * Makefile.in: the link between different .o file is no longer needed. * *.h: now implement the method described above. * fem_init_env.cc: include the *.h and use the function defined here instead of linking them at compile time
author gedeone-octave <marcovass89@hotmail.it>
date Sat, 03 Aug 2013 14:37:09 +0200
parents a64e195d0611
children
line wrap: on
line source

/*
 Copyright (C) 2013 Marco Vassallo

 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation; either version 2 of the License, or (at your option) any later
 version.

 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 details.

 You should have received a copy of the GNU General Public License along with
 this program; if not, see <http://www.gnu.org/licenses/>.
*/


#include "mesh.h"
#include "functionspace.h"
#include "boundarycondition.h"
#include "coefficient.h"
#include "function.h"

DEFUN_DLD (fem_init_env, args, , "-*- texinfo -*-\n\
@deftypefn {Function File} {[]} = \
fem_init_env ( ) \n\
Initialize the environment for fem-fenics\n\
@end deftypefn")
{
  int nargin = args.length ();
  octave_value retval;

  if (nargin < 0 || nargin > 0)
    print_usage ();
  else
    {
      mesh::register_type ();
      mesh_type_loaded = true;
      std::cout << "mesh_type_loaded" << std::endl;
      functionspace::register_type ();
      functionspace_type_loaded = true;
      std::cout << "functionspace_type_loaded" << std::endl;
      boundarycondition::register_type ();
      boundarycondition_type_loaded = true;
      std::cout << "boundarycondition_type_loaded" << std::endl;
      coefficient::register_type ();
      coefficient_type_loaded = true;
      std::cout << "coefficient_type_loaded" << std::endl;
      function::register_type ();
      function_type_loaded = true;
      std::cout << "function_type_loaded" << std::endl;
      mlock ();
    }
  return retval;
}