Main Page | File List | File Members

myroutines.c File Reference

Class myroutines methods. More...

#include "mypde.h"
#include "mysolv.c"
#include "tsolve.c"
#include "mygrid.c"

Defines

#define COULOM_COEF(TEMP, CHG, RAD, COEF)   COEF = 1.67149e+5*CHG/(80*TEMP*RAD)
#define len_w   15
 define a brief formula for analytical calculations. swtich for debug . swtich for analytical calculation .

Functions

VPUBLIC void MY_assemR (AM *thee, Bvec *u)
VPUBLIC void MY_assem (AM *thee, int evalKey, Bvec *u, Bvec *f, int ip[], double rp[], double energies[], int ekeytol)
VPUBLIC int MY_Solve (AM *am, Bvec *u, Bvec *w[], Vlparam *lparam)
VPUBLIC void MY_lSolve (AM *thee, Vlparam *lparam)
VPUBLIC void MY_write (AM *thee, Vlparam *lparam)
VPRIVATE void PDE_readMesh (AM *am, char path[])
VPRIVATE Vatom * Valist_getAtomStorage (Valist *thee, Vatom **plist, int *pnlist, int *pnatoms)
VPRIVATE int Valist_setAtomArray (Valist *thee, Vatom **plist, int nlist, int natoms)
VPUBLIC int PQR_input (AM *am, Valist *thee, const char *iodev, const char *iofmt, const char *thost, const char *fname)
 Input the PQR file of a molecule.
VPUBLIC int dPMF_input (AM *am, const char *iofil, const char *iofor, const char *thost, const char *filnam)
VPUBLIC void dPMF_mapping (AM *am)
VPUBLIC int PDE_input (AM *am, Vgrid *grid[], Vlparam *lparam)
VPUBLIC Vlparam * lparam_ctor ()
VPUBLIC void lparam_dtor (Vlparam *thee)

Variables

VPRIVATE Bvec * w [len_w]
 the number of the temporary vectors for solving Au=f.
VPRIVATE int winuse


Detailed Description

Class myroutines methods.

Problem type: time-dependent, Diffusion-reaction Spatial dimension: 2 or 3 Product dimension: 1 Differential operator: Linear or nonlinear potential equation with symmetric or nonsymmetric linear part Boundary conditions: zero or nonzero Dirichlet conditions nonzero or zero Neumann/Robin conditions

Note: Equation for component i is defined as

sum(del(A_ij del(u_j))) = B_i in omega -n dot sum(A_ij del(u_j)) = C_i along natural boundaries

_____ \ ____ ____ \ \ /. A_ij \ / u_j = B_i in omega / \/ \/ /____ j

____ \ ____ \ -n . A_ij \ / u_j = C_i along natural boundaries / \/ /___ j

Author:
Yuhui Cheng, modified after Michael Holst, Nathan Baker, Kaihsu Tai & Jason Suen.
Version:
Id
myroutines.c 1046 2007-07-10 16:58:40Z sobolevnrm
Attention:
 *
 * SMOL -- Adaptive Smoluchowski Solver
 *
 * Yuhui Cheng (ycheng@mccammon.ucsd.edu)
 * Dept. of Chemistry and Biochemistry
 * University of California, San Diego
 *
 * Additional contributing authors listed in the code documentation.
 *
 * Copyright (c) 2006-2007.  University of California, San Diego
 * All Rights Reserved.
 * Portions Copyright (c) 1995.  Michael Holst.
 *
 * This file is part of SMOL.
 *
 * SMOL 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.
 *
 * SMOL is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with SMOL; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 *
 * Linking SMOL statically or dynamically with other modules is making a
 * combined work based on SMOL. Thus, the terms and conditions of the
 * GNU
 * General Public License cover the whole combination.
 *
 * SPECIAL GPL EXCEPTION
 * In addition, as a special exception, the copyright holders of SMOL
 * give you permission to combine the SMOL program with free software
 * programs and libraries that are released under the GNU LGPL or with
 * code included in releases of ISIM, Ion Simulator Interface, PMV,
 * PyMOL
 * VMD, and Vision. Such combined software may be linked with SMOL
 * and
 * redistributed together in original or modified form as mere
 * aggregation
 * without requirement that the entire work be under the scope of the
 * GNU
 * General Public License. This special exception permission is also
 * extended
 * to any software listed in the SPECIAL GPL EXCEPTION clauses by the
 * FEtk, MC, or MALOC libraries.
 *
 * Note that people who make modified versions of SMOL are not obligated
 * to grant this special exception for their modified versions; it is
 * their choice whether to do so. The GNU General Public License gives
 * permission to release a modified version without this exception; this
 * exception also makes it possible to release a modified version which
 * carries forward this exception.
 *
 * 

Function Documentation

VPUBLIC void MY_assemR AM *  thee,
Bvec *  u
 

User-provided surface and volume integrals.

VPUBLIC void MY_lSolve AM *  thee,
Vlparam *  lparam
 

*************************************************************************** Routine: MY_lSolve

Purpose: Modified linear solver.

Author: Jason Suen, followed Michael Holst ***************************************************************************

assembly parameters

some i/o

make sure we have structure

setup for assembling either primal or dual problem

< forward (primal) problem (linearized about 0)

< backward (dual) problem (linearized about 0)

initial guess

clear the matrix, rhs, residual

assemble the stiffness matrix and load vector

return with no errors

VPUBLIC int MY_Solve AM *  am,
Bvec *  u,
Bvec *  w[],
Vlparam *  lparam
 

the subroutine to solve Au=f.

method choice (0=slu,1=mg,2=cg,3=bcg,4=bcg,5=bcgstab,6=continuation)

primary methods

VPUBLIC void MY_write AM *  thee,
Vlparam *  lparam
 

output control which allows the use to write the vector u(x) in the desired format.

format choice (1=GV,2=GMV,3=DX,4=UCD,5=TEC)

VPUBLIC int PQR_input AM *  am,
Valist *  thee,
const char *  iodev,
const char *  iofmt,
const char *  thost,
const char *  fname
 

Input the PQR file of a molecule.

Author:
Yuhui Cheng

< PQR file pointer

< To hold lines from the PQR file

Counters

Information to be gleaned from PQR file

Make sure we're reading in an ASCII file

Open data files

Now we read some lines and count the atoms.

Check to see if we got an ATOM line

Allocate the necessary space for the atom array

Rewind the file pointer (use rewind to clear the error indicator, too)

Check to see if we got an ATOM line

Try to parse a line without chain IDs and with a string residue ID

Get pointer to next available atom position

Put it in the atom list

Have we gotten all the entries?

Assign charges and radii to atom vertices

VPRIVATE Vatom* Valist_getAtomStorage Valist *  thee,
Vatom **  plist,
int *  pnlist,
int *  pnatoms
 

See if we need more space

Double the storage space

Check the allocation

Copy the atoms over

Get the next available spot and increment counters

Parameters:
plist  Pointer to existing list of atoms
pnlist  Size of existing list, may be changed
pnatoms  Existing number of atoms in list; incremented before exit

VPRIVATE int Valist_setAtomArray Valist *  thee,
Vatom **  plist,
int  nlist,
int  natoms
 

Copy over data

Free old array

Parameters:
plist  Pointer to list of atoms to store
nlist  Length of list
natoms  Number of real atom entries in list


Generated on Thu Jul 26 15:56:33 2007 by  doxygen 1.3.9.1