-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.md.m4
314 lines (228 loc) · 7.02 KB
/
README.md.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
include(`co.m4')dnl
h_include(`m4/util.m4')dnl
r_geomview(dnl
<<-p 'co.q al img/rbc/ref.off <' -t -0.06 -0.013 0 -r -64 -32 9.5 -f 25 img/rbc/sde/Da-0.358.off>>,
<<img/rbc/sde/Da-0.358.png>>,
red cell)
<H1>Corpuscles</H1>
<H2>Introduction</H2>
Corpuscles is a C library to resolve the elastic energy and force of a
membrane surface, which is represented by an unstructured triangulated
mesh. It also simulates transformations between different
configurations/shapes of a closed membrane by a minimization procedure
under various constraints.
Various components can be switched on/off at will, such as<br>
<ol>
<li>Bending elasticity of lipip bilayer</li>
<li>Strain (both shear and strecth) elasticity of cytoskeleton</li>
<li>Viscosity of lipid membrane</li>
<li>Thermal fluctuations of lipid membrane</li>
<li>Constraint of reduced volume of a closed membrane surface</li>
<li>Constraint of total area of a closed membrane surface</li>
<li>Constratin of total volume of a closed membrane surface</li>
<li>Constratin of area difference between outer- and inner-surface</li>
</ol>
For different components, variations of model/law can be selected such
as Helfrich/spontaneous curvature model for bending elasticity and
Skalak law for strain elasticity.
For different models/laws, variations of schemes impelemented can also
be choosen such as Gompper and Kroll scheme and Juelicher scheme for
the bending model of spontaneous curvature. See more details in
[https://cselab.github.io/corpuscles](https://cselab.github.io/corpuscles)
<H2>Install</H2>
Minimal dependencies are C and Fortran 90 compilers,
<a href="https://www.gnu.org/software/gsl">GNU Scientific Library</a>,
and
<a href="https://www.freedesktop.org/wiki/Software/pkg-config">pkg-config</a>.
Optional dependencies
<a href="http://geomview.org">geomview</a>,
<a href="https://maxima.sourceforge.io">maxima</a>,
and
<a href="https://pandoc.org">pandoc</a>.
Adjust r_source(conf.mk) if you want to change defaults
<pre>
$ cat conf.mk
r_file(conf.mk)dnl
</pre>
<tt>PREFIX/bin</tt> should be on the path, for example
<pre>
$ cat $HOME/.bashrc
PATH="$HOME/.local/bin:$PATH"
</pre>
Library is installed under the path <tt>PREFIX</tt>. Run
<pre>
$ MAKEFLAGS=-j4 make
</pre>
If you have
<a href=https://github.io/slitvinov/atest>atest</a>
you can run
<pre>
$ make test
</pre>
You can also use a r_source2(Dockerfile,docker containter).
<H2>Examples</H2>
<H3>Hello world</H3>
A program in r_dir(example/hello) computes area of a triangle.
<pre>
$ cat main.c
r_file(example/hello/main.c)
</pre>
<pre>
$ cat Makefile
r_file(example/hello/Makefile)
</pre>
<pre>
$ ./main
r_cmd(<<cd example/hello && make main > /dev/null && ./main>>)dnl
</pre>
<H3>Read mesh file</H3>
Corpuscles reads
<a href="https://en.wikipedia.org/wiki/OFF_(file_format)">OFF files</a>.
Here is r_source2(data/regular/tetra.off,a file with triangular pyramid).
r_geomview(dnl
<<-r -45 -20 0 $(co.path)/regular/tetra.off>>,
<<img/tetra.png>>,
triangular pyramid)
This program reads an OFF file from an input stream:
<pre>
$ cat main.c
r_file(example/off/read/main.c)
</pre>
<pre>
$ make
$ ./main < `co.path`/regular/tetra.off
r_cmd(<<cd example/off/read && make main > /dev/null && ./main < $(co.path)/regular/tetra.off>>)
</pre>
<H3>Write mesh file</H3>
Read off, compute area of every triangle, and output off file with
colors (r_dir(example/off/write/area))
<pre>
$ cat main.c
r_file(example/off/write/area/main.c)
</pre>
<pre>
$ ./main < $(co.path)/rbc/laplace/0.off > out.off
</pre>
To see the results
<pre>
$ co.geomview -r 55.9195 -13.672 8.69021 -f 25.0389 out.off
</pre>
r_geomview(<<-r 55.9195 -13.672 8.69021 -f 25.0389 img/area.off>>,
<<img/area.png>>,
mesh colored by triangle area)
<H3>Refine mesh</H3>
Using sqrt(3)-subdivision scheme
<pre>
$ co.geomview -r 60 -40 10 -f 22 `co.path`/rbc/icosahedron/0.off
$ co.sqrt3 < `co.path`/rbc/icosahedron/0.off > a.off
$ co.geomview -r 60 -40 10 -f 22 a.off
</pre>
r_geomview(<<-r 60 -40 10 -f 22 $(co.path)/rbc/icosahedron/0.off>>,
<<img/0.png>>,
red cell with 1280 trianglles)
r_geomview(<<-r 60 -40 10 -f 22 img/1.off>>,
<<img/1.png>>,
red cell with 3840 trianglles)
<H2>Visualization</H2>
We use a wrapper to
<a href="http://geomview.org">geomview</a>.
<pre>
$ co.geomview -h
r_cmd(<<co.geomview -h | m4/cat>>)
</pre>
<H2>Library</H2>
<H3>Floating point precision</H3>
r_header(prec/s/real.h), r_header(prec/d/real.h), r_header(prec/l/real.h)
: single, double, long double
<H3>Math</H3>
r_header(vec.h), r_header(edg.h), r_header(tri.h), r_header(dih.h), r_header(ten.h)
: vector, edges, triangels, dihidrals, tensors
r_header(dvec.h), r_header(dedg.h), r_header(dtri.h), r_header(ddih.h)
: derivatives of vector edges, triagels, dihidrals
r_header(ring.h)
: operation on the first ring of neighbors
<H3>Utility</H3>
r_header(array.h)
: array related functions
r_header(argv.h)
: read from <tt>argv</tt> and shift
r_header(err.h)
: error handling
r_header(endian.h)
: deal with endianess
r_header(macro.h)
: macros
r_header(sum.h)
: [Kahan summation](en.wikipedia.org/wiki/Kahan_summation_algorithm)
r_header(memory.h)
: memory related
r_header(util.h)
: uncategorazed
<H3>Surface properties</H3>
r_header(area.h)
: area
r_header(volume.h)
: volume
r_header(laplace.h)
: Laplace operator of coordinates
r_header(normal.h)
: normal
<H3>"Forces"</H3>
r_header(bending.h)
: generic interface to several bending forces
r_header(forces.h)
: generic interface to forces
r_header(stretch.h)
: stretching force
<H3>Surface transformation</H3>
r_header(equiangulate.h)
: equlatirate triangles
r_header(orient.h)
: orient surface in a direction of eigen values of momentum tensor
r_header(restore.h)
: restore a volume of the surface
r_header(transformation.h)
: translate, rotate, and and scale surface
r_header(remesh.h)
: "edit" surfaces
<H3>Half-edg related</H3>
r_header(read.h)
: read half-edg to intermediate structure HeRead, used to initialize half-edg
r_header(he.h)
: half edg data structure (provides half-edg API)
r_header(hash.h)
: stores an integer for a pair of integers
<H3>IO</H3>
r_header(gts.h),
r_header(obj.h),
r_header(off.h),
r_header(ply.h),
r_header(punto.h),
r_header(stl.h),
r_header(stl.h),
r_header(xdmf.h)
: read/write GTS, OBJ, OFF, PLY, punto, STL, VTK, and XDMF files.
<H3>X and Y</H3>
r_header(x.h)
: simple interface for one surface
r_header(y.h)
: not so simple interface
<H2>Documentation</H2>
[git pages](https://cselab.github.io/corpuscles)
[docs/index.html](docs/index.html) is generated from
[README.md.m4](README.md.m4). To update run
<pre>
$ make html
</pre>
requires [pandoc](http://pandoc.org).
<H2>Hacking</H2>
After adding new files to r_dir(lib) update depdendencies:
<pre>
$ (cd lib && ./bootstrap)
</pre>
<H2>Publications</H2>
Bian, X., Litvinov, S., & Koumoutsakos, P. (2020). Bending models of
lipid bilayer membranes: Spontaneous curvature and area-difference
elasticity. Computer Methods in Applied Mechanics and Engineering,
359, 112758.
<a href="https://doi.org/10.1016/j.cma.2019.112758">doi:10.1016/j.cma.2019.112758</a>