Main Page | Directories | File List | File Members

electron_density.h

Go to the documentation of this file.
00001 /*
00002    This file belongs to Aeneas. Aeneas is a GNU package released under GPL 3.
00003    This code is a simulator for Submicron 3D Semiconductor Devices. 
00004    It implements the Monte Carlo transport in 3D tetrahedra meshes
00005    for the simulation of the semiclassical Boltzmann equation for both electrons.
00006    It also includes all the relevant quantum effects for nanodevices.
00007 
00008    Copyright (C) 2007 Jean Michel Sellier <sellier@dmi.unict.it>
00009  
00010    This program is free software; you can redistribute it and/or modify
00011    it under the terms of the GNU General Public License as published by
00012    the Free Software Foundation; either version 3, or (at your option)
00013    any later version.
00014 
00015    This program is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019 
00020    You should have received a copy of the GNU General Public License
00021    along with this program. If not, see <http://www.gnu.org/licenses/>.
00022 */
00023 
00024 // Created on : 13 june 2007, Siracusa, Jean Michel Sellier
00025 // Last modified : 16 september 2007, Siracusa, Jean Michel Sellier
00026 
00027 // calculate the electron density by means of a modified
00028 // version of the well-known cloud in cell algorithm.
00029 
00030 void electron_density(void)
00031 {
00032 // NOELEC[i] is the number of electrons in the i-th element
00033  int i;
00034  int *vertex;
00035  
00036  for(i=0;i<Ng;i++) NE[i]=0.; // just in case...
00037 
00038 // modified cloud-in-cell method for 3D unstructured meshes
00039 
00040 // it is a bit affected by statistical noise, but this is
00041 // definitely normal.
00042  
00043  vertex=malloc((Ng+1)*sizeof(int));
00044  if(vertex==NULL){
00045    printf("electron_density error : not enough memory for vertex array!\n");
00046    exit(0);
00047  }
00048  for(i=0;i<Ng;i++) vertex[i]=0; // just in case...
00049 
00050    for(i=0;i<Ne;i++){
00051     if(i_dom[i]!=SIO2){
00052       NE[noeud_geo[0][i]-1]+=(double)(NOELEC[i])*EPP[i]/VOLUME[i];
00053       NE[noeud_geo[1][i]-1]+=(double)(NOELEC[i])*EPP[i]/VOLUME[i];
00054       NE[noeud_geo[2][i]-1]+=(double)(NOELEC[i])*EPP[i]/VOLUME[i];
00055       NE[noeud_geo[3][i]-1]+=(double)(NOELEC[i])*EPP[i]/VOLUME[i];
00056       vertex[noeud_geo[0][i]-1]++;
00057       vertex[noeud_geo[1][i]-1]++;
00058       vertex[noeud_geo[2][i]-1]++;
00059       vertex[noeud_geo[3][i]-1]++;
00060     }
00061    }
00062  for(i=0;i<Ng;i++) NE[i]/=(double)vertex[i];
00063 
00064  free(vertex);
00065 }

© sourcejam.com 2005-2008