gimme-alpha 0.1

nextnano_material_conversion.c

Go to the documentation of this file.
00001 /*
00002 ** nextnano_material_conversion.c
00003 ** Login : <solarion@nathan>
00004 ** Started on  Sat Mar 28 11:55:28 2009 Johnny Q. Hacker
00005 ** $Id$
00006 ** 
00007     Copyright (C) 2009 Joseph Pingenot
00008 
00009     This program is free software: you can redistribute it and/or modify
00010     it under the terms of the GNU Affero General Public License as published by
00011     the Free Software Foundation, either version 3 of the License, or
00012     (at your option) any later version.
00013 
00014     This program is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU Affero General Public License for more details.
00018 
00019     You should have received a copy of the GNU Affero General Public License
00020     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00021 
00022 */
00023 
00024 #include <stdio.h>
00025 #include <libnextnano/nextnano_material_conversion.h>
00026 #include <libnextnano/read_nextnano_inputfile.h>
00027 #include <libcommon/gcc_hints.h>
00028 
00029 struct parameter_translator {
00030   char* from;             /*The property in the nextnano material file*/
00031   int item;               /*If an array of values, the value index (0
00032          *is first) */
00033   char* to;               /*The matdb property to assign it to.*/
00034   void*(*value_translator)(void*);
00035 };
00036 
00037 struct parameter_section {
00038   char *section;
00039   struct parameter_translator xlators[1024];
00040 };
00041 
00042 static struct parameter_section sections[] = {
00043   {.section = "binary-zb-default",
00044    .xlators = {
00045      {.from = "binary-type",
00046       .item = 0,
00047       .to = "name",
00048       .value_translator = NULL
00049      },
00050      {.from="conduction-bands",
00051       .item=0,
00052       .to="num_bands",
00053       .value_translator = NULL
00054      }
00055     }
00056   }
00057 };
00058 
00059 struct matdb* convert_nextnano_db(GHashTable* nextnano_materials) {
00060   /*First, set up the materials*/
00061   GList* m;
00062   char* prefix;
00063   if(unlikely((m=g_hash_table_lookup(nextnano_materials, "binary-zb-default")) == NULL)) {
00064     fprintf(stderr, "convert_nextnano_db: INTERNAL ERROR: unable to find binary zincblende materials in nextnano database.\n");
00065     return NULL;
00066   }
00067   prefix="zb";
00068   return NULL;
00069 }
 All Classes Files Functions Variables Enumerations Enumerator Defines