Allink  v0.1
Public Types | Public Member Functions | Public Attributes
VarData Class Reference

Reads and elaborates a system of chains. More...

#include <VarData.h>

Inheritance diagram for VarData:
ElPoly Forces

List of all members.

Public Types

typedef double(VarData::* NANO_DIST )(double *Pos, int n)
 Data type for distance/field functions.

Public Member Functions

 VarData ()
 Set the constants.
 ~VarData ()
 Destructor.
void VarMessage (const char *s,...)
 If enabled call the function position.
bool Open (char *InFile, int BF)
 Open the.
bool OpenRisk (char *InFile, int BF)
 Opens a file without reallocationg.
bool OpenTrust (char *InFile, int BF)
 Opens a file checking if the information are correct.
void AllocPart ()
 Alloc the structures.
void AllocChain ()
 Alloc the structures.
Properties SysProperties ()
 Calculate some basis properties.
void SysInfo (char *cSystem)
 Print a string with the system information.
void SysDef (char *cSystem)
 Print a string with the system definitions.
char * SysState ()
 Calculates fundamental quantities.
void SetCoeff ()
 Set the virial coefficients from the known values of density coex...
void SetCoeff (double *v2, double *v3)
 Set and normalize the virial coefficients from the arrays v2 and v3.
double TwoPartDist (int p1, int p2, double *RelDist)
 Return the relative distance between two particles (wrapped)
double TwoPartDist (double *Pos, int p2, double *RelDist)
 Return the relative distance between two particles (wrapped)
double TwoPartDist2 (int p1, int p2, double *RelDist)
 Return the relative distance between two particles (wrapped)
double TwoPartDist2 (double *Pos, int p2, double *RelDist)
 Return the relative distance between two particles (wrapped)
int TwoPartDist (int p1, int p2, double *RelDist, double CutOff)
 Return the relative distance between two particles (wrapped) if the particles are within the cut off.
int TwoPartDist (double *Pos, int p2, double *RelDist, double CutOff)
 Return the relative distance between two particles (wrapped) if the particles are within the cut off.
bool Write (char *OutFile)
 Writes a "system-file" or a "x y z" file".
bool WriteTxvl (char *OutFile)
 Writes a "system-file" or a "x y z" file".
bool WriteXvt (char *OutFile)
 Writes a "system-file" or a "x y z" file".
bool WriteXyz (char *OutFile)
 Writes a "system-file" or a "x y z" file".
void HeaderInteraction (FILE *FileToWrite)
 Header interactions.
void StringNano (char *NString, int n)
 String for the rigid inclusion in the header file.
int HeaderNano (FILE *FileToWrite)
 Write the nano section of the header to the file.
int HeaderSoft (char *Line)
 Header soft.
void WriteLinkedSurf (FILE *FWrite, double *Plot, int NSample, int NType, double *Bound, int *PId)
 Write the positions of the egdes of the rectangles.
void WriteSurf (FILE *F2Write, double **Plot, int NSample, int OffSet)
 Write the particle position as linked edges of squares.
void ShapeId (int iShape, char *Shape)
 Identifier of the shape.
bool BackFold (int How)
 Backfold the particle position.
int BfDefChain ()
 Definition of the chain.
int BfEdge ()
 Find the box size if missing.
void DistFromNp ()
 Define the distance form the nanoparticle.
void ShiftRef (int BackFold)
 Backfold the system wrt the reference position.
int StalkPos (double *OldPos)
 Find the position of the stalk.
void BfPep ()
 Backfold the nano described as a cluster of monomers.
void BackBone (double *Line, int NBin)
 Describe the backbone of a filament.
void StalkLineProf (double *Line, int NBin)
 Describe the line for a linear stalk.
void StalkPos2 (double *OldPos, double *CmStalk)
 Find the position of the stalk second method.
void StalkPos3 (double *OldPos, double *CmStalk)
 Find the position of the stalk third method.
int StalkPos4 (double *OldPos, double *CmStalk)
 Find the position of the stalk forth method.
double NormalWeight (VAR_TRIANGLE *Triang, double *Weight, int NGrid, int NTri)
 Weight of the neighblorung normal on a vertex.
void ConnectLineChain (VAR_LINE *Triang, int NGrid, int NTri)
 Connect the lines in a chain.
void ConnectLineChain2 (VAR_LINE *Triang, int NGrid, int NTri)
 Connect the lines in a chain.
void ConnectLineChain3 (VAR_LINE *Triang, int NGrid, int NTri)
 Connect the lines in a chain.
double PorePos ()
 Find the position of the pore.
int Fetch (char *str, char *mask, char *fmt,...)
 Retrive from a string the information concerning the mask.
int BraketPos (char *str, char *mask, int *sPos, int *sLen)
 Retrive from a string the position of the brakets.
int Fetch (char *str, char *mask, int NArg, double *Val)
 Retrive from a string the information concerning the mask.
bool ReadString (const char *String, char *cLine, double *Value)
 Copy the value in the.
bool ReadString (const char *String, double *Value, char *line)
 Copy the value in the.
bool ReadString (const char *String, char *cLine, int *Value)
 Copy the value in the.
int ReadVal (char *pLine, double *Value)
 Copy the value in the String to the Value referring to the position of pLine.
int ReadLineXvt (char *cLine, double *Pos, int *Type)
 Read a single line in format Xvt.
bool ReadConf (char *InFile)
 Reads a "configuration file".
void ReadHeader (FILE *FileToRead)
 Reads a header.
void ReadHeaderTxvl (FILE *FileToRead)
 Reads a header for a txvl file format.
void ReadHeaderXvt (FILE *FileToRead)
 Reads a header of xvl file format.
int ReadPart (FILE *FileToRead)
 Reads particle type and position.
int ReadPartTxvl (FILE *FileToRead)
 Reads a type-position-velocity-link file.
int ReadPartXvt (FILE *FileToRead)
 Reads a position-velocity-type file.
int ReadPartXyz (FILE *FileToRead)
 Reads a x y z file.
int ReadPartXyzt (FILE *FileToRead)
 Reads a x y z t file.
int ReadPassThru (FILE *FileToRead)
 Reads the information to alloc the structure.
int ReadSoft (FILE *ConfFile)
 Reads the specifications about the nano.
void ReadNano (FILE *ConfFile, int NCircle, int NHeight)
 Reads the specifications about the hard object.
int NanoString (char *cLine, int n)
 Reads and set the specifics of the nano.
void SubNanoHeader (char *cFile)
 Substitue the nano header.
int ShapeId (char *Shape)
 Identifier of the shape.
int DefSoft (char *nome2, char *ConfF)
 Define and write the system as described in the conf file.
int TrialSys ()
 Creates a trial system.
bool CreateSoft (int *arch, double Thickness, int s)
 Creates an initial system.
void CreateTube (int *arch, double Thickness, int s)
 Soft in a tube shape.
void CreatePlanar (int *arch, double Thickness, int s)
 planar membrane
void CreateVesicle (int *arch, double Thickness, int s)
 vesicle
void CreateCoating (int *arch, double Thickness, int s)
 coating around a cylindrical nanoparticle
void CreateObstacle (int *arch, double Thickness, int s)
 Creates obstacles.
int CheckNano (double *Pos, int s)
 No particle inside the nano.
void AddProtein (int NCircle, int NHeight, int nNano, char *filename)
 Defines the nanoparticle as a net of monomers.
void CreateProtein (int nNano, int nStart)
 Defines the nanoparticle as a net of monomers.
void AddStuffing (char *filename, int nStuffing, int nNano)
 Fill the protein with water.
void AddSolvent (char *filename, int nWater)
 Add phantom solvent at the bottom.
void AddChains (char *filename, double Thickness)
 Add homopolymer chains in the bilayer.
void AddCholesterol (char *filename, double Thickness, int s)
 Add cholesterol chains in the bilayer.
void DefBlock (int *NChStep, int How)
 Define four different blocks.
void DefRest (int *arch, int s)
 set the remaining information
int PutPart (int j, int p, int HalfLim, double sigma)
 return the number in the chain of the next particle put
void FindNeighbours (char *FileName)
 Find the couples of most neighbouring chains.
void SwapChain (int c1, int c2, int b)
 Swap two chains.
void SwapChain (int c1, int c2)
 Swap two cahins.
void SwapPart (int p1, int p2)
 Swap two particle.
void ChangeNChain (int NChain, int b)
 Update the new number of chains.
bool ShiftSys (int How)
 Shift the system accordin to the SHIFT_ definitions.
void SampleSurface (double *Plot, int NSample, int Type)
 Define a normal coordinate for every patch.
MOMENTI SampleSurfacePart (double *Plot, int NSample, int Type)
 Define a normal coordinate for every patch.
MOMENTI SampleSurface (Matrice *Plot, int NSample, int Type)
 Define a normal coordinate for every patch.
MOMENTI SampleSurfaceMem (int NSample)
 Allocate and fill PlotMem with the particle average position.
void LoadDensFile (double **Plot, int NBin)
 Load in the array Plot the density of the system.
int SpatialDerivative (Matrice *Surface, Matrice *Resp, SPLINE Weight, int NSample)
 Perform a spatial derivative on a surface.
void ShiftBlock (Vettore *Shift, int b)
 Shift a block wrt to Shift.
void RotateBlock (Vettore *Axis, Vettore *Origin, int b)
 Rotate a block wrt to the Axis from the Origin.
void MirrorBlock (Vettore *Px1, Vettore *Px2, Vettore *Px3, int b)
 Mirror the position wrt to a plane.
void Transform (int block)
 Transform a block.
void Point2Shape (int iShape)
 Point to the shape function.
double NanoDist2 (double *Pos, int n)
 Pointer to a generic function.
double NanoDist2 (double x, double y, double z, int n)
 Distance from the nanoparticle.
double FieldNo (double *Pos, int n)
 No field.
double FieldSphere (double *Pos, int n)
 Scalar field of a sphere.
double FieldElips (double *Pos, int n)
 Scalar field of a elipsoid.
double FieldParab (double *Pos, int n)
 Scalar field of a elipsoid.
double FieldCyl (double *Pos, int n)
 Scalar field of a cylinder.
double FieldTransMem (double *Pos, int n)
 Scalar field of a transmembrane protein.
double FieldJanus (double *Pos, int n)
 Scalar field of a janus peptide.
double FieldTorus (double *Pos, int n)
 Scalar field of a janus peptide.
double FieldTilt (double *Pos, int n)
 Scalar field of a tilted cylinder.
double FieldBound (double *Pos, int n)
 Scalar field of a hard wall at the box edges.
double FieldTiltWall (double *Pos, int n)
 Scalar field of a tilted cylinder.
int PairCorrelation (double *Point, int NSample, int How, int Type)
 1-d pair correlation
int PairCorrelationRound (double **Point, int NSample, int Type)
 Circular 2-d pair correlation.
int PairCorrelationSquare (double **Point, int NSample, int Type)
 2-d pair correlation on a square
int PairCorrelationPep (double **Point, int NSample, int Type)
 2-d pair correlation on a square fererring to the pep position
int Scattering2d (double **Point, int NSample, int Type)
 2-d Scattering
int Scattering2D (double **Point, int NSample, int Type)
 2-d scattering
void Spettro2d (double *Points, int NSample, int Type)
 1-d spectrum of a surface
void Spettro2d (double *Plot, int NSample)
 2-d spectrum of a sirface
int DensityProfile (int coord, int NSample, int NType, double *dDensity)
 Calculate the density profile for the x, y, z, r coordinate.
int Core (double ***Plot, int NSample, double Border[3][2])
 Sampled three dimentional weighted shape of the system.
int RadDistr (int NSample, double *Plot, double Border[2], int How)
 rzd representation of the system referring to
int Worm (int Partition, int NSample, double *Border, double *dPoint)
 Density profile along a worm like micelle.
void VolumeCircSlab (double *VolContr, int NSample)
 Fill an array of.
void Stalk (int NSample, int NLevel, double **Plot, double Threshold)
 Following the contour of a stalk.
int Arrange (int **Triangle, int Vertex)
 The naerest.
int Folding ()
 Boh...
int OrderPos ()
 A cell list to be fixed.
int CalcnPos (double *Pos)
 return a univocal index of the chain position
int Neighbour (double *Pos)
 Boh.
int NChainPSquare (double *Plot)
 Distribution of number of chain per patch.
int LateralFluctuation (double *Plot, int LatValue)
 Boh.
int Voronoi ()
 Voronoi tassellation.
int PosVectInt (double *Pos)
 Return the integer index with respect to the partition NSquare.
int InterParab (PART *PmIn, PART *PmOut, int NIn, int nOut)
 Discontinous parabolas.
int InterParab2 (PART *PmIn, PART *PmOut, int NIn, int NOut)
 Discontinous parabolas.
int InterCubica (PART *PmIn, PART *PmOut, int NIn, int NOut)
 Discontinous cubic.
int InterForth (PART *PmIn, PART *PmOut, int NIn, int NOut)
 Discontinous forth degree.
int InterSpline3 (PART *PmIn, PART *PmOut, int NIn, int NOut)
 third order spline
int InterSpline4 (PART *PmIn, PART *PmOut, int NIn, int NOut)
 forth order spline
int InterBSpline (PART *PmIn, PART *PmOut, int NIn, int NOut)
 BSpline.
int InterBSpline2D (double **PlIn, double **PmOut, int NIn, int NOut)
 2-d BSpline
int InterBSpline2D (double *PlIn, double *PmOut, int NIn, int NOut)
 2-d BSpline
int InterBSpline1D (double *PlIn, double *PmOut, int NIn, int NOut)
 1-d BSpline
int InterPoly (PART *PmIn, PART *PmOut, int NIn, int nOut)
 NIn-polynomian.
int InterDerMatrix (PART *Pm, int NMass, SPLINE Weight, double Offset)
 Boh.
void SmoothGrid (int NSample, char *FWrite)
 Smooth a grid with BSplines.
void SmoothGrid (int NSample)
 Smooth a grid with BSplines and update the particle positions.
void ConvoluteMatrix (double *Plot, int NGrid, Matrice *Mask, int NDim)
 Convolute a matrix.
void ConvoluteMatrix1 (double *Plot, int NGrid, Matrice *Mask)
 Convolute a matrix 1d.
void ConvoluteMatrix2 (double *Plot, int NGrid, Matrice *Mask)
 Convolute a matrix 2d.
void ConvoluteMatrix3 (double *Plot, int NGrid, Matrice *Mask)
 Convolute a matrix 3d.
int SetNPart (int NewNPart)
 Set and reallocate the number of particles.
int SetNChain (int NewNCh)
 Set and reallocate the number of chains.
int SetNLink (int NewNCh)
 Set and reallocate the number of links.
void SetNPCh (int NewNCh)
 Set and reallocate the number of particles per chains.
void SetNType (int NewNType)
 Set the number of species.
int AllocLinks (int NewNCh)
 (re)allocate the links
int SetNBlock (int Val)
 Set NBlock.
int SetNNano (int Val)
 Set NNano.
void Copy (PART *P1, PART *P2, int NPartOld)
 Copy the part P2 on part P1.
void Copy (CHAIN *C1, CHAIN *C2, int NChainOld)
 Copy the chain C2 on chain C1.
VAR_TRIANGLEMarchingCubes (double *Plot, int NSample, double IsoLevel, int *NTri)
 Defines the triangles close to the IsoLevel of the 3d density Plot.
VAR_LINEMarchingSquares (double *Plot, int NSample, double IsoLevel, int *NTri)
 Defines the triangles close to the IsoLevel of the 3d density Plot.
void AreaDistr (double *Distr, double *RadDistr, int NSample)
 Calculate the (temporal/radial) area distribution.
double pTime ()
 Total time.
double pDeltat ()
 Delta t.
double pTemp ()
 Temperature.
double pBeta ()
 Beta factor 1/kTB.
double pEnergy (int d)
 Pot, kinetik, free.
double pEdge (int d)
 xyzr edges of the simulation box
double pInvEdge (int d)
 Inverted xyzr edges of the simulation box.
double pVol ()
 xyzr edges of the simulation box
double pCm (int d)
 Center of mass of the system.
double pVelMax (int d)
 Maximum velocity.
double pchiN ()
 Incompatibility.
double pkappaN ()
 Incompressibility.
double pkBen ()
 Bending coupling.
double pkSpr ()
 Spring coupling.
void SetkBen (double Val)
 Bending coupling.
void SetkSpr (double Val)
 Spring coupling.
void SetSprRest (double Val)
 Rest distance of the harmonic potential.
double pSprRest ()
 Rest distance of the harmonic potential.
double prho ()
 Density coexistence.
double pReOverCutOff ()
 Re/CutOff.
double pWei2Par ()
 Parameter of the second order weighting function.
double pWei3Par ()
 Parameter of the third order weighting function.
int pStep ()
 Number of steps.
int pNPart ()
 Number of particle.
int pNChain ()
 Number of chain.
int pNChain (int b)
 Number of chain.
int pNPCh ()
 Number of particle per chain.
int pNPCh (int c)
 Number of particle per chain.
int pNType ()
 # of types of the particle
int pNLink ()
 Maximum number of bonds.
int pNNano ()
 Number of nanoparticles.
int pNBlock ()
 Number of blocks.
int pNAllocP ()
 Allocated number of particles.
int pNAllocC ()
 Allocated number of chains.
void SetEdge (double Val, int d)
 Set Edge.
void SetCNorm (int d)
 Set Edge.
void SetScaleF (double *Scale)
 Set scale factor.
void SetShiftPos (double *RefPos)
 Set reference pos.
void SetIfNormalize (int If)
void SetDeltat (double Val)
 Set DeltaT.
void SetStep (int Val)
 Set Step.
void SetTemp (double Val)
 Set Temperature.
void SetTime (double Val)
 Set Time.
void IncrStep ()
 Increment Step.
double pPos (int p, int d)
 Return back folded position.
double pChPos (int p, int d)
 Return back folded position.
void pPos (int p, double *Pos)
 Return back folded position.
double * pPos (int p)
 Print the particle position.
double pPosNoBkf (int p, int d)
 Return the velocity.
double pVel (int p, int d)
 Return the velocity.
void SetPos (int p, double *Pos)
 Set the particle position.
void SetPos (int p, int d, double Pos)
 Set the particle position.
void SetVel (int p, double *Vel)
 Set the particle velocity.
void SetType (int p, int t)
 Set the particle type.
int pType (int p)
 Return the type.
int pChain (int p)
 Return the chain.
double pNanoPos (int n, int d)
 Return back folded nano position.
void SetBkf (int p)
 Set the back folded array for the particle p.
void SetNanoBkf (int n)
 Set the back folded array for the nano n.
void pPos (double *Pos)
 Print a position.

Public Attributes

MatematicaMat
 Implementation of all usefull algorythms.
MatIntMInt
 Matrix of the prefactor of the interactions.
NANO_DIST Nano_Dist
 Pointer to a distance/field function.
char cWhat2Draw [STRSIZE]
 What to draw.
NANONano
 Extra particle.
PARTPm
 Particle information of all particle.
LINKSLn
 Array of linking between the particles.
CHAINCh
 Information on all chains.
SOFTSoft
 Soft bodies.
BLOCKBlock
 Information for every block.
double * PlotMem
 Particle position/density on the square lattice.
double ShiftPos [3]
 Reference position.
double ScaleF [3]
 Scale factor.
int NSoft
 Number of soft bodies.
int NPartNearSphere
 Number of particle to be considered in the radial density profile.
int NAddChain
 Additional homopolymer chains into the membrane.
int NAddChol
 Additional cholesterol chains into the membrane.
int NSolvent
 Solvent molecules.
int NStuffing
 Stuffing for the cylinder.
int CNorm
 Normal coordinate.
int CLat1
 lateral coordinate
int CLat2
 lateral coordinate
int NChType
 Type of chain selected.
int NPType
 Type of particle selected.
int NEdge
 Number of particles per edge.
int SysType
 Contains the definition of the system.
int SysFormat
 Contains the definition of the file format.
int SysCreate
 Contains the information for the creation.
int IfNormalize
 If normalize the lateral dimensions to one.
int IfPlotMem
 If PlotMem is allocated and filled.

Detailed Description

Reads and elaborates a system of chains.

Definition at line 521 of file VarData.h.


Member Function Documentation

bool Open ( char *  InFile,
int  BF 
)
void ConnectLineChain ( VAR_LINE Triang,
int  NGrid,
int  NTri 
)

Connect the lines in a chain.

Algorithm to connect al the vertices in a single chain, many weird cases are not covered.

Definition at line 981 of file VarDataBackFold.cpp.

References DdLinkedList::AddPart(), CLat1, CLat2, GENERAL::Edge, DdLinkedList::IfCurr(), LINKS::Link, Ln, DdLinkedList::NextCurr(), DomDecBasics::p2Curr, pCm(), pEdge(), Pm, pNPart(), PART::Pos, DdLinkedList::SetCurr(), and SetNPart().

Referenced by ElPoly::IsoLine().

void ConnectLineChain2 ( VAR_LINE Triang,
int  NGrid,
int  NTri 
)

Connect the lines in a chain.

Algorithm to connect al the vertices in a single chain, many weird cases are not coverd.

Definition at line 1180 of file VarDataBackFold.cpp.

References NeiVertex::Add(), Ch, PART::CId, CHAIN::EndBead, NeiVertex::IfItCell(), NeiVertex::IncrCurr(), CHAIN::InitBead, LINKS::Link, Ln, LINKS::NLink, CHAIN::NPCh, pEdge(), Pm, pNChain(), pNPart(), NeiVertex::Reorder(), NeiVertex::SetCounters(), SetNChain(), SetNPart(), NeiVertex::TriaCurr(), and VAR_LINE::v.

void ConnectLineChain3 ( VAR_LINE Triang,
int  NGrid,
int  NTri 
)
bool ReadString ( const char *  String,
char *  cLine,
double *  Value 
)

Copy the value in the.

Parameters:
Stringto the
Value

Definition at line 29 of file VarDataString.cpp.

Referenced by ReadConf().

bool ReadString ( const char *  String,
double *  Value,
char *  line 
)

Copy the value in the.

Parameters:
Stringto the
Value

Definition at line 77 of file VarDataString.cpp.

bool ReadString ( const char *  String,
char *  cLine,
int *  Value 
)

Copy the value in the.

Parameters:
Stringto the
Value
int DensityProfile ( int  coord,
int  NSample,
int  NType,
double *  dDensity 
)

Calculate the density profile for the x, y, z, r coordinate.

sum on small patches and shift the wrt the weighted average

Definition at line 24 of file VarDataContour.cpp.

References BfDefChain(), Block, Ch, CLat1, CLat2, CNorm, GENERAL::Edge, BLOCK::EndIdx, GENERAL::NBlock, Pm, and PART::Typ.

int RadDistr ( int  NSample,
double *  Plot,
double  Border[2],
int  How 
)

rzd representation of the system referring to

Parameters:
How

Definition at line 24 of file VarDataEl.cpp.

void VolumeCircSlab ( double *  VolContr,
int  NSample 
)

Fill an array of.

Parameters:
NSamplevalues with the volume contribution in a rectangular box

Definition at line 75 of file VarDataProfile.cpp.

References CLat1, CLat2, CNorm, GENERAL::Edge, and pEdge().

Referenced by ElPoly::AreaDistrF(), ElPoly::BondDistr(), ElPoly::DensProf(), ElPoly::DensProfNormalSlab(), ElPoly::NanoParticle(), ElPoly::PressRadial(), ElPoly::RadDistrF(), ElPoly::SplayDistr(), ElPoly::SurfTens(), and Forces::WriteTens2d().

int Arrange ( int **  Triangle,
int  Vertex 
)

The naerest.

Parameters:
Vertex-particle close to every chain

Definition at line 24 of file VarDataPos.cpp.

References BfDefChain(), Ch, CLat1, CLat2, GENERAL::Edge, GENERAL::NChain, NChType, and CHAIN::Pos.

int InterBSpline2D ( double *  PlIn,
double *  PmOut,
int  NIn,
int  NOut 
)

2-d BSpline

Perform a 2d BSpline interpolation on two square arrays.

Definition at line 424 of file VarDataInterp.cpp.

References Matematica::Blend(), CLat1, GENERAL::Edge, and Mat.

void SmoothGrid ( int  NSample)

Smooth a grid with BSplines and update the particle positions.

Call InterBSpline2d to update the particle position;.

Definition at line 401 of file VarDataInterp.cpp.

References InterBSpline2D(), Pm, PART::Pos, and pType().


The documentation for this class was generated from the following files: