Continuum Membrane 719025a62b1e384a6ff80e2f2a223ef4012153dc
Loading...
Searching...
No Matches
Parameters.hpp
Go to the documentation of this file.
1
16#pragma once
17
18#include <math.h>
19#include <cmath>
20#include <vector>
21#include <string>
22#include <iostream>
23#include <gsl/gsl_matrix.h>
24#include <gsl/gsl_blas.h>
25#include <gsl/gsl_linalg.h>
26
29
31
32
36enum class BoundaryType
37{
39 Fixed,
40
43
45 Free
46};
47
65
84
94{
95public:
96 int index;
98 Matrix vwu = Matrix(3, 1);
100 double D = 0.0;
101};
102
116struct Param
117{
118 // developer options
119 bool VERBOSE_MODE = true;
120 int maxIterations = 1E5;
121 std::string restartInputFile = "";
122 std::string checkpointOutputFile = "slimed_restart.chk";
124
125 // physical constants
126 double kCurv = 83.4;
127 double uSurf = 250.0;
128 double uVol = 0.0;
129 double kReg = 83.4;
130 double kSpring;
132 double area0;
133 double area;
134 double vol0;
135 double vol;
136 double insertCurv;
137 double spontCurv;
138
139 // membrane size and axes division
140 double sideX = 100.0;
141 double sideY = 100.0;
142 double radius = 25.0;
143 double lFace = 5.0;
144 int nFaceX = -1;
145 int nFaceY = -1;
146 double dFaceX;
147 double dFaceY;
148 double meanL;
149 double sigma = 0.0;
152 bool isAdditiveScheme = false;
153 bool isGlobalConstraint = true;
155
156 // gauss quadrature
160
161 // shape function
162 std::vector<Matrix> shapeFunctions;
163
164 // irregular patch
166
167 // boundary conditions
169
170 // optimization methods
171 bool usingNCG = true;
172 bool isNCGstuck = false;
173
174 // convergence criteria
175 double deltaEnergyConverge = 1e-5;
177
178 // regularization
179 double gamaShape = 0.2;
180 double gamaArea = 0.2;
181 bool usingRpi = true;
182
183 // spline points
184 bool xyzOutput = true;
185 bool meshpointOutput = true;
187 std::vector<Matrix> scaffoldingPoints;
190 double springConst = 4.5;
191 double springConstScaler = 1.31607401;
196 double splinePointsZcoordScaling = 0.0; // for z scaling
197 double lbond = 9.0;
200 std::string scaffoldingFileName = "";
202 std::string gagReferenceStateFileName = "";
203 std::string gagReactionFileName = "";
206 double gagKsigma = 0.0;
207 double gagKtheta = 0.0;
208 double gagKphi = 0.0;
209 double gagKomega = 0.0;
210 double gagFiniteDifferenceStep = 1.0e-4;
211 double gagPropagationStepSize = 1.0e-6;
213
214
215 // dynamics
216 double timeStep = 0.1; // us
217 double diffConst = 0.01; // um^2/us
218 double KBT = 4.17; // 1KbT = 4.17 pN.nm
219 unsigned int randomSeed = 42;
220 bool surfacepointOutput = true;
221
222 // thermal fluctuation / annealing for equilibrium searches
230
231 // insertion
233 std::vector<std::vector<int>> insertionPatch;
234
238};
239
247std::ostream& operator<<(std::ostream& os, const Param& param);
This file defines the Energy class with scaffold extensions.
The Force class defines corresponding force terms type. Note that all the forces are gsl matrices wit...
std::ostream & operator<<(std::ostream &os, const Param &param)
Overloaded stream insertion operator to output the Param struct in a readable format.
BoundaryType
The type of boundary condition for the simulation.
Definition Parameters.hpp:37
This class includes components in calculating energy on vertrices including membrane bending energy,...
Definition Energy.hpp:26
Matrix used in continuum membrane model.
Definition Linear_algebra.hpp:65
Represents a single diffusing particle in a simulation.
Definition Parameters.hpp:94
double D
Diffusion constant of the particle in nm^2/us.
Definition Parameters.hpp:100
Matrix vwu
Velocity vector of the particle in nm/us.
Definition Parameters.hpp:98
Matrix coord
Coordinate vector of the particle in nm.
Definition Parameters.hpp:99
int faceIndex
Index of the face that the particle is located on.
Definition Parameters.hpp:97
int index
Index of the particle in the simulation.
Definition Parameters.hpp:96
Bookkeeps the shape and area deformation count of Mesh.
Definition Parameters.hpp:60
int noDeformCount
Number of triangles with no deformation.
Definition Parameters.hpp:63
int shapeDeformCount
Number of triangles with shape deformation.
Definition Parameters.hpp:61
int areaDeformCount
Number of triangles with area deformation.
Definition Parameters.hpp:62
Contains simulation parameters and physical constants.
Definition Parameters.hpp:117
bool isIdealizedProteinLatticeEnergyIncluded
Whether to include idealized per-instance protein lattice energy.
Definition Parameters.hpp:204
int springConstScalingInterv
Iteration interval for spring constant scaling.
Definition Parameters.hpp:192
double thermalFluctuationTemperatureKelvin
Effective thermodynamic temperature in Kelvin.
Definition Parameters.hpp:226
bool isGlobalConstraint
Whether to apply global constraint across entire membrane.
Definition Parameters.hpp:153
Energy energy
Definition Parameters.hpp:235
bool thermalFluctuationPureMMC
Run pure Metropolis Monte Carlo trial moves without NCG.
Definition Parameters.hpp:224
int nFaceX
Number of faces (edges) along X axis for flat membrane.
Definition Parameters.hpp:144
double dFaceX
Initial actual face side length along X axis for flat membrane.
Definition Parameters.hpp:146
double kSpring
Spring constant for insertion zones (K)
Definition Parameters.hpp:130
std::vector< int > scaffoldingPoints_correspondingVertexIndex
Corresponding vertex indices for spline points.
Definition Parameters.hpp:188
std::string restartInputFile
Optional checkpoint file to restart from.
Definition Parameters.hpp:121
int propagateScaffoldingNstep
Number of steps every time propagating scaffolding.
Definition Parameters.hpp:195
int checkpointOutputInterval
Iteration interval for checkpoint writes; <=0 disables checkpointing.
Definition Parameters.hpp:123
int nFaceY
Number of faces (edges) along Y axis for flat membrane.
Definition Parameters.hpp:145
double springConstScaler
Spring constant scaler per iteration interval.
Definition Parameters.hpp:191
std::string idealizedProteinLatticeFileName
JSON / .dat file containing the initialized idealized lattice state.
Definition Parameters.hpp:205
int subDivideTimes
Number of times to subdivide each edge.
Definition Parameters.hpp:150
double gagPropagationStepSize
Step size used when propagating the scaffold with Gag forces.
Definition Parameters.hpp:211
bool surfacepointOutput
whether to output surface point file
Definition Parameters.hpp:220
double dFaceY
Initial actual face side length along Y axis for flat membrane.
Definition Parameters.hpp:147
double lFace
lFace
Definition Parameters.hpp:143
bool isAdditiveScheme
Whether to use additive scheme for constraints.
Definition Parameters.hpp:152
unsigned int randomSeed
random seed used in normal distribution
Definition Parameters.hpp:219
double thermalFluctuationCoolingRate
Multiplicative cooling rate after each thermal trial.
Definition Parameters.hpp:228
double radius
Radius for spherical membrane.
Definition Parameters.hpp:142
double sigma
Noise level for vertex positions.
Definition Parameters.hpp:149
double vol
Total volume of the membrane (V)
Definition Parameters.hpp:135
double spontCurv
Spontaneous curvature of membrane (c0)
Definition Parameters.hpp:137
double deltaForceScaleConverge
Convergence criteria for max force scale.
Definition Parameters.hpp:176
std::vector< Matrix > scaffoldingPoints
List of spline points.
Definition Parameters.hpp:187
int gagPreRelaxSteps
Number of Gag-only pre-relaxation steps before membrane coupling.
Definition Parameters.hpp:212
bool isGagScaffoldingEnergyIncluded
Whether to include Gag-specific internal scaffold energy.
Definition Parameters.hpp:201
Matrix VWU
(N,3) matrix of vertex coordinates and weights
Definition Parameters.hpp:158
std::vector< std::vector< int > > insertionPatch
Definition Parameters.hpp:233
std::string gagReactionFileName
NERDSS .inp file used to identify Gag reaction blocks.
Definition Parameters.hpp:203
double springConst
Spring constant for harmonic bond potential.
Definition Parameters.hpp:190
BoundaryType boundaryCondition
Type of boundary condition ("Fixed", "Periodic", "Free")
Definition Parameters.hpp:168
double gagKomega
Spring constant for COM-graph torsion term mapped from omega.
Definition Parameters.hpp:209
double gagKsigma
Spring constant for COM-COM bond length term.
Definition Parameters.hpp:206
double deltaEnergyConverge
Convergence criteria for total energy.
Definition Parameters.hpp:175
double thermalFluctuationMinTemperatureKelvin
Lower bound for annealed temperature in Kelvin.
Definition Parameters.hpp:227
double lbond
Harminc bond length in nm.
Definition Parameters.hpp:197
int thermalFluctuationInterval
Iteration interval between thermal trial moves.
Definition Parameters.hpp:225
double gamaArea
Area deformation coefficient.
Definition Parameters.hpp:180
double kCurv
Bending modulus i.e. curvature constant (kc)
Definition Parameters.hpp:126
double timeStep
Definition Parameters.hpp:216
bool isInsertionAreaConstraint
Whether to apply area constraint to insertions.
Definition Parameters.hpp:151
double diffConst
Definition Parameters.hpp:217
double gagFiniteDifferenceStep
Step size used for scaffold finite-difference gradients.
Definition Parameters.hpp:210
std::string scaffoldingFileName
Definition Parameters.hpp:200
double area
Total area of the membrane (S)
Definition Parameters.hpp:133
bool isInsertionIncluded
Definition Parameters.hpp:232
bool thermalFluctuationEnabled
Enable Metropolis thermal trial moves during minimization.
Definition Parameters.hpp:223
bool meshpointOutput
Whether to output meshpoints.
Definition Parameters.hpp:185
double scaffoldingSphereRaidus
spherical radius of the scaffolding lattice cap
Definition Parameters.hpp:189
int maxIterations
Max number of iteration.
Definition Parameters.hpp:120
bool xyzOutput
Whether to output XYZ coordinates of vertices.
Definition Parameters.hpp:184
bool usingRpi
Whether to use R-pi adaptive method for regularization energy;.
Definition Parameters.hpp:181
double elementTriangleArea0
Target area for individual triangles.
Definition Parameters.hpp:154
double gagKtheta
Spring constant for COM-COM bond angle term.
Definition Parameters.hpp:207
double meanL
Mean length of edges after subdivision.
Definition Parameters.hpp:148
double gamaShape
Shape deformation coefficient.
Definition Parameters.hpp:179
Energy energyPrev
Definition Parameters.hpp:236
double relaxLengthRatioApproximation
ratio of relax length to cap length approximation
Definition Parameters.hpp:198
double insertCurv
Spontaneous curvature of insertions (C0)
Definition Parameters.hpp:136
bool isNCGstuck
Whether NCG method has gotten stuck.
Definition Parameters.hpp:172
double KBT
Definition Parameters.hpp:218
DeformationCount deformationCount
Definition Parameters.hpp:237
double splinePointsZcoordScaling
Definition Parameters.hpp:196
double area0
Target area for membrane (S0)
Definition Parameters.hpp:132
Matrix gaussQuadratureCoeff
(N,1) matrix of Gaussian quadrature coefficients
Definition Parameters.hpp:159
double thermalFluctuationStepScale
Gaussian displacement std. dev. as a fraction of lFace.
Definition Parameters.hpp:229
int springConstUpperBound
Max spring constant to stop scaling of spring constant.
Definition Parameters.hpp:193
int gaussQuadratureN
Number of Gaussian quadrature points to use.
Definition Parameters.hpp:157
double sideY
Y-axis length for flat membrane.
Definition Parameters.hpp:141
std::vector< Matrix > shapeFunctions
List of shape functions for each triangle.
Definition Parameters.hpp:162
double uSurf
Surface area constraint i.e. surface constant (us)
Definition Parameters.hpp:127
SubdivisionMatrix subMatrix
Subdivision matrix for irregular patches.
Definition Parameters.hpp:165
int propagateScaffoldingInterv
Iteration interval for repositioning scaffolding based on energy and force.
Definition Parameters.hpp:194
bool VERBOSE_MODE
Whether to print verbose output during simulation.
Definition Parameters.hpp:119
double vol0
Target volume for membrane (V0)
Definition Parameters.hpp:134
double scaffoldingZeroPlaneZ
Height of the flat membrane plane around the Gag cap.
Definition Parameters.hpp:199
double gagKphi
Spring constant for COM-graph torsion term mapped from phi.
Definition Parameters.hpp:208
bool setRelaxAreaToDefault
true to set area0 equal to area of starting config
Definition Parameters.hpp:131
double uVol
Volume constraint i.e. volume constant (uv)
Definition Parameters.hpp:128
double kReg
Coefficient of the regularization constraint (k)
Definition Parameters.hpp:129
std::string checkpointOutputFile
Checkpoint file written during minimization.
Definition Parameters.hpp:122
std::string gagReferenceStateFileName
Extracted selected/json/*.dat file used as Gag reference geometry.
Definition Parameters.hpp:202
bool usingNCG
Whether to use nonlinear conjugate gradient method.
Definition Parameters.hpp:171
bool isEnergyHarmonicBondIncluded
Whether to include energy of spline points.
Definition Parameters.hpp:186
double sideX
X-axis length for flat membrane.
Definition Parameters.hpp:140
5 Subdivison matrices for irregular mesh.
Definition Parameters.hpp:77
Matrix irregM
Definition Parameters.hpp:78
Matrix irregM4
Definition Parameters.hpp:82
Matrix irregM1
Definition Parameters.hpp:79
Matrix irregM3
Definition Parameters.hpp:81
Matrix irregM2
Definition Parameters.hpp:80