|
gimme-alpha 0.1
|
#include <libmodeling/nanostructures.h>
Include dependency graph for nextnano_postprocessing.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | nextnano_region |
| struct | nextnano_region_d1 |
Enumerations | |
| enum | nextnano_region_type { NNR_D1 } |
| enum | nextnano_base_geometry { LINE } |
Functions | |
| struct nanostructure * | get_nanostructure (GHashTable *input_file, int *err) |
| void | nextnano_region_free (struct nextnano_region *r) |
| struct nextnano_region * | nextnano_region_new (enum nextnano_region_type type) |
| enum nextnano_region_type |
Definition at line 31 of file nextnano_postprocessing.h.
{
NNR_D1 /*Generic 1D structure*/
};
| struct nanostructure* get_nanostructure | ( | GHashTable * | input_file, |
| int * | err | ||
| ) | [read] |
Definition at line 79 of file nextnano_postprocessing.c.
References INT_TYPE, nanostructure_new(), nextnano_region_new(), NNR_D1, NS_D1, read_nextnano_extract_item_typed(), and unlikely.
{
int lerr;
char *val;
double *d;
int *i;
GList *regions = NULL;
*err = 0;
struct nanostructure *s;
if(unlikely((s=nanostructure_new(NS_D1)) == NULL)) {
*err = 2;
return NULL;
}
struct nextnano_region *r;
/*First, figure out what regions we have*/
i = read_nextnano_extract_item_typed(ifile, "simulation-dimension", 1, "dimension", &lerr, INT_TYPE);
if((*i) != 1) {
*err = 1;
}
for(int c=0; (i = read_nextnano_extract_item_typed(ifile, "regions", 1, "region-number", &lerr, INT_TYPE)) != NULL; c++) {
if(unlikely((r=nextnano_region_new(NNR_D1)) == NULL)) {
*err = 3;
/*Continue; we're going to be missing a region; let the caller
decide what to do*/
continue;
}
}
/*Any unclaimed sections of the overall nanostructure size are in
the default material.*/
return s;
}
Here is the call graph for this function:| void nextnano_region_free | ( | struct nextnano_region * | r | ) |
Definition at line 40 of file nextnano_postprocessing.c.
References nextnano_region_d1_free(), NNR_D1, nextnano_region::storage, and nextnano_region::type.
{
if(r->storage != NULL) {
switch(r->type){
case NNR_D1:
nextnano_region_d1_free(r->storage);
break;
}
}
free(r);
}
Here is the call graph for this function:| struct nextnano_region* nextnano_region_new | ( | enum nextnano_region_type | type | ) | [read] |
Definition at line 58 of file nextnano_postprocessing.c.
References nextnano_region_d1_new(), NNR_D1, nextnano_region::storage, nextnano_region::type, and unlikely.
Referenced by get_nanostructure().
{
struct nextnano_region *r;
if(unlikely((r = (struct nextnano_region*)malloc(sizeof(struct nextnano_region))) == NULL)) return NULL;
r->type = type;
switch(type){
case NNR_D1:
r->storage = nextnano_region_d1_new();
break;
}
if(unlikely((r->storage) == NULL)) {
free(r);
}
return r;
}
Here is the call graph for this function:
Here is the caller graph for this function: