From 24a51ac6348c6f53186cf9efbfa486ff842dc79d Mon Sep 17 00:00:00 2001 From: lindahl Date: Tue, 5 Nov 2002 01:25:47 +0000 Subject: [PATCH] Removed deprecated files. --- src/gmxlib/sfac.c | 424 ------------------------------------------------------ 1 file changed, 424 deletions(-) delete mode 100644 src/gmxlib/sfac.c diff --git a/src/gmxlib/sfac.c b/src/gmxlib/sfac.c deleted file mode 100644 index 9359489b93..0000000000 --- a/src/gmxlib/sfac.c +++ /dev/null @@ -1,424 +0,0 @@ -/* - * $Id$ - * - * This source code is part of - * - * G R O M A C S - * - * GROningen MAchine for Chemical Simulations - * - * VERSION 3.1 - * Copyright (c) 1991-2001, University of Groningen, The Netherlands - * 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. - * - * If you want to redistribute modifications, please consider that - * scientific software is very special. Version control is crucial - - * bugs must be traceable. We will be happy to consider code for - * inclusion in the official distribution, but derived work must not - * be called official GROMACS. Details are found in the README & COPYING - * files - if they are missing, get the official version at www.gromacs.org. - * - * To help us fund GROMACS development, we humbly ask that you cite - * the papers on the package - you can find them in the top README file. - * - * For more info, check our website at http://www.gromacs.org - * - * And Hey: - * Gnomes, ROck Monsters And Chili Sauce - */ -static char *SRCID_sfac_c = "$Id$"; -#include -#include -#include "assert.h" -#include "typedefs.h" -#include "complex.h" -#include "smalloc.h" -#include "network.h" -#include "txtdump.h" -#include "random.h" -#include "sfac.h" -#include "vec.h" -#include "futil.h" -#include "matio.h" - -void print_hkl(char *hklfn,int nh,int nk,int nl,int l0,real Intensity[], - int nlevels) -{ - FILE *out; - real *t_x,*t_y,**matrix; - real lo,hi,val; - t_rgb rlo = { 1.0, 1.0, 0.0 }; - t_rgb rhi = { 0.0, 0.0, 1.0 }; - int n_x,n_y; - int i,j,k,hkl; - - fprintf(stderr,"nh=%d, nk=%d, nl=%d\n",nh,nk,nl); - n_x = (2*nh+1); - n_y = (2*nk+1); - - assert ((l0>= -nl) && (l0<=nl)); - out=ffopen(hklfn,"w"); - snew(t_x,n_x); - snew(t_y,n_y); - for(i=-nh; (i<=nh); i++) - t_x[i+nh] = i; - for(i=-nk; (i<=nk); i++) - t_y[i+nk] = i; - lo = 1000; - hi = -1000; - snew(matrix,n_x); - hkl = 0; - for(i=-nh; (i<=nh); i++) { - snew(matrix[i+nh],n_y); - for(j=-nk; (j<=nk); j++) { - if ((i == 0) && (j == 0) && (l0 == 0)) - val = 0.0; - else - val = Intensity[hkl+nl+l0]; - lo = min(lo,val); - hi = max(hi,val); - matrix[i+nh][j+nk] = val; - hkl += (2*nl+1); - } - } - write_xpm(out,"HKL l=0","electrons","h","k",n_x,n_y,t_x,t_y, - matrix,lo,hi,rlo,rhi,&nlevels); - for(i=0; (i<=n_x); i++) - sfree(matrix[i]); - sfree(matrix); - sfree(t_x); - sfree(t_y); - fclose(out); -} - -void sum_Fhkl(t_commrec *cr,int nhkl,t_complex Fhkl[]) -{ - if (PAR(cr)) - gmx_sum(nhkl*2,(real *)Fhkl,cr); -} - -void calc_Fhkl(FILE *log,int nh,int nk,int nl, - t_complex Fhkl[],int start,int homenr,rvec x[], - real fatom[]) -{ - /* Calculate the structure factor F(hkl) from the coordinates - * x[start] .. x[start+homenr-1] - * Fhkl is a linear array of length (2*nh+1)*(2*nk+1)*(2*nl+1) - */ - int h,k,l,n,n0,nhkl; - real rh,rk,rl,inproduct,fatomn,F000,F000_1; - const real twopi=2.0*M_PI; - t_complex shkl; - - /* Counter into structure factor array */ - nhkl = 0; - - for(h=-nh; (h<=nh); h++) { - rh = h; - for(k=-nk; (k<=nk); k++) { - rk = k; - for(l=-nl; (l<=nl); l++) { - rl = l; - shkl = cnul; - for(n=0; (nnr); - - nel = 0; - for(i=0; (inr); i++) { - c=toupper((*(atoms->atomname[i]))[0]); - switch (c) { - case 'C': - fatom[i] = 6; - break; - case 'N': - fatom[i] = 7; - break; - case 'O': - fatom[i] = 8; - break; - case 'P': - fatom[i] = 15; - break; - case 'S': - fatom[i] = 16; - break; - case 'D': - fatom[i] = 2; - break; - case 'H': - fatom[i] = 1; - break; - default: - fprintf(stderr,"Atom: %s, first char %c\n",*(atoms->atomname[0]),c); - fatom[i] = 1; - } - nel+=fatom[i]; - } - nel_1 = 1.0/nel; - for(i=0; (inr); i++) - fatom[i] *= nel_1; - - return fatom; -} - -real lo_calc_sfac(FILE *log,int start,int homenr,rvec x[], - int nh,int nk,int nl, - real kI,real I0[],real *n_elec, - rvec f[],t_commrec *cr) -{ - static bool bFirst = TRUE,bDump=FALSE; - static t_complex *Fhkl=NULL; - static rvec *f_xray=NULL; - char *ptr; - rvec f_xraysum; - int n,nhkl; - real VVV,mass; - - if (Fhkl == NULL) { - fprintf(log,"Initiating data (%s,%d)\n",__FILE__,__LINE__); - nhkl = (2*nh+1)*(2*nk+1)*(2*nl+1); - - fprintf(log,"Going to malloc %d bytes for F(hkl)\n", - nhkl*sizeof(Fhkl[0])); - snew(Fhkl,nhkl); - snew(f_xray,homenr); - bDump = (getenv("DUMP") != NULL); - } - - /* First calculate the structure factor F(hkl) */ - calc_Fhkl(log,nh,nk,nl,Fhkl,start,homenr,x,n_elec); - - /* Now do global summing of F(hkl) if we are in parallel */ - sum_Fhkl(cr,nhkl,Fhkl); - - if (bFirst) { - if (getenv("RANDOM") != NULL) - rand_coords(start,homenr,x); - bFirst = FALSE; - } - - /* Reset imaginary forces */ - for(n=0; (n