view src/fem_init_env.cc @ 31:74cbe97f55af

New class for treatment of BC * boundarycondition.h: publicly derives from octave_base_value and the private member is a vector of pointer to dolfin::DirichletBC * fem_bc.cc: DLD functions which creates a boundarycondition object taking as input a functionspace, a function_handler and the label of the sides where the BC has to be applied * fem_init_env.cc: load also the boundarycondition type
author gedeone-octave <marco.vassallo@outlook.com>
date Mon, 15 Jul 2013 17:07:28 +0200
parents c725b4be09e3
children f992cee90bd6
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"


DEFINE_OCTAVE_ALLOCATOR (mesh);
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (mesh, "mesh", "mesh");

DEFINE_OCTAVE_ALLOCATOR (functionspace);
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (functionspace, "functionspace", "functionspace");

DEFINE_OCTAVE_ALLOCATOR (boundarycondition);
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (boundarycondition, "boundarycondition", "boundarycondition");

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 ();
       std::cout << "mesh_type_loaded" << std::endl;
       functionspace::register_type ();
       std::cout << "functionspace_type_loaded" << std::endl;
       boundarycondition::register_type ();
       std::cout << "boundarycondition_type_loaded" << std::endl;
       mlock ();
    }
  return retval;
}