1 /*
2  * nsvc.h
3  *
4  * Copyright 2012 Martin Robinson
5  *
6  * This file is part of Smoldyn.
7  *
8  * Smoldyn is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * Smoldyn is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with Smoldyn.  If not, see <http://www.gnu.org/licenses/>.
20  *
21  *  Created on: Apr 16, 2013
22  *      Author: mrobins
23  */
24 
25 #ifndef NSVC_H_
26 #define NSVC_H_
27 
28 
29 
30 
31 
32 //#ifdef __cplusplus
33 
34 #ifdef NSVC_CPP
35 	#include <string>
36 	#include "Kairos.h"
37 	using Kairos::NextSubvolumeMethod;
38 
39 	#if defined(HAVE_VTK)
40 		#include <vtkUnstructuredGrid.h>
41 	#else
42 		typedef struct vtkUnstructuredGrid vtkUnstructuredGrid;
43 	#endif
44 #else
45 	typedef struct vtkUnstructuredGrid vtkUnstructuredGrid;
46 	typedef struct NextSubvolumeMethod NextSubvolumeMethod;
47 #endif
48 
49 
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 struct portstruct;
56 struct rxnstruct;
57 struct surfacestruct;
58 struct latticestruct;
59 
60 
61 extern void nsv_init();
62 
63 extern NextSubvolumeMethod* nsv_new(double *min, double *max, double *dx, int dim);
64 extern void nsv_delete(NextSubvolumeMethod* nsv);
65 extern void nsv_print(NextSubvolumeMethod* nsv, char **bufferptr);
66 extern void nsv_add_interface(NextSubvolumeMethod* nsv,int id, double dt, double *start,double *end,double *norm,int dim);
67 extern void nsv_add_species(NextSubvolumeMethod* nsv,int id,double D,char *btype,int dim);
68 //extern void nsv_add_reaction(NextSubvolumeMethod* nsv,double rate,
69 //						int nreactants,int *reactant_ids,
70 //						int nproducts,int *product_ids);
71 extern void nsv_add_reaction(NextSubvolumeMethod* nsv,struct rxnstruct *reaction);
72 extern void nsv_add_surface(NextSubvolumeMethod* nsv,struct surfacestruct* surface);
73 
74 extern void nsv_integrate(NextSubvolumeMethod* nsv,double dt,struct portstruct *port,struct latticestruct *lattice);
75 extern void nsv_molcountspace(NextSubvolumeMethod* nsv,int id, double *low, double *high, int dim, int nbins, int axis, int *ret_array);
76 double nsv_concentration_point(NextSubvolumeMethod* nsv,int id, double *point, int dim);
77 void nsv_kill_molecule(NextSubvolumeMethod* nsv,int id, double *point, int dim);
78 extern void nsv_molcount(NextSubvolumeMethod* nsv, int *ret_array);
79 extern int nsv_get_species_copy_numbers(NextSubvolumeMethod* nsv, int id, const int** copy_numbers, const double** positions);
80 extern void nsv_add_mol(NextSubvolumeMethod* nsv,int id, double* pos, int dim);
81 
82 extern vtkUnstructuredGrid* nsv_get_grid(NextSubvolumeMethod* nsv);
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif /* NSVC_H_ */
89