misiekc / polygonRSA

Program to generate saturated random packings of arbitrary polygons according to random sequential adsorption protocol
6 stars 1 forks source link

How to set the parameters when the polymers bind to the substrate in a certain direction? #2

Closed lhxone closed 2 years ago

lhxone commented 2 years ago

How to set the parameters when the polymers bind to the substrate in a certain direction as shown in the figure below? Is there any parameter available?

@PKua007 @misiekc

PKua007 commented 2 years ago

Unfortunately, the package is intended only for various types of continuous random sequential adsorption and, as of now, we do not plan to support discrete RSA. If you know how to incorporate lattice RSA into the software, you are welcome to make a pull request, preferably into our primary, full RSA project.

All the best!

misiekc commented 2 years ago

Definitely, you should use our other project mentioned by PKua007 and use the following attributes:

particleType = OrientedCuboid
particleAttributes = 2 1

if the side length ratio is 2:1

The example result: packing_OrientedCuboid_2_1_100_0 bin

Note that the rectangles can be placed at any point of the plane (assuming infinite precision of double precision arithmetic) and their positions are not restricted to any lattice.

lhxone commented 2 years ago

I tried the rsa3d, and encountered an error while compiling. Here's what I have done.

cd rsa3d
mkdir build && cd build
cmake ..
make

here's erroe log

[gcc@DSserver build]$ make 
[  0%] Building CXX object statistics/CMakeFiles/statistics.dir/ArrayFunctio
n.cpp.o
[  0%] Building CXX object statistics/CMakeFiles/statistics.dir/ASFRegressi
on.cpp.o
[  1%] Building CXX object statistics/CMakeFiles/statistics.dir/LinearRegres
sion.cpp.o
[  1%] Building CXX object statistics/CMakeFiles/statistics.dir/LogPlot.cpp.
o
[  1%] Building CXX object statistics/CMakeFiles/statistics.dir/Plot.cpp.o
[  2%] Building CXX object statistics/CMakeFiles/statistics.dir/PowerRegres
sion.cpp.o
[  2%] Linking CXX static library libstatistics.a
[  2%] Built target statistics
[  3%] Building CXX object rsa3d/CMakeFiles/rsa_main.3.0.dir/analizator/A
nalyzer.cpp.o
[  3%] Building CXX object rsa3d/CMakeFiles/rsa_main.3.0.dir/analizator/E
xclusionZoneVisualizer.cpp.o
[  3%] Building CXX object rsa3d/CMakeFiles/rsa_main.3.0.dir/geometry/G
eometry.cpp.o
[  4%] Building CXX object rsa3d/CMakeFiles/rsa_main.3.0.dir/modes/Acc
uracySimulation.cpp.o
[  4%] Building CXX object rsa3d/CMakeFile

...
...
...

[ 61%] Building CXX object rsa3d/shape/CMakeFiles/shapes.2.1.dir/shapes
/RegularDiskopolygon.cpp.o
[ 61%] Building CXX object rsa3d/shape/CMakeFiles/shapes.2.1.dir/shapes
/polygon/RegularRoundedPolygon.cpp.o
[ 61%] Linking CXX static library libshapes.2.1.a
[ 61%] Built target shapes.2.1
[ 61%] Building CXX object rsa3d/CMakeFiles/rsa.2.1.dir/Main.cpp.o
[ 61%] Linking CXX executable rsa.2.1
shape/libshapes.2.1.a(ShapeFactory.cpp.o): In function `ShapeFactory::init
ShapeClass0(std::__cxx11::basic_string<char, std::char_traits<char>, std::
allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits
<char>, std::allocator<char> > const&)':
ShapeFactory.cpp:(.text+0x2cc): undefined reference to `AlignedRectangle::i
nitClass(std::__cxx11::basic_string<char, std::char_traits<char>, std::alloc
ator<char> > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [rsa3d/rsa.2.1] Error 1
make[1]: *** [rsa3d/CMakeFiles/rsa.2.1.dir/all] Error 2
make: *** [all] Error 2
[gcc@DSserver build]$ 

Although there are some errors, thersa.2.0 and rsa.2.0 executable file could be find in build/rsa3d.

But I had some trouble when running with povray:

$ /rsa.2.0 povray packing_OrientedCuboid_2_1_100000_0.bin 
terminate called after throwing an instance of 'std::runtime_error'
  what():  [ERROR] cannot restore Shape: incompatible dimensions: (136, 0) read 1 bytes.
Aborted (core dumped)

I only modified the two parameters you mentioned above,here's my input.txt

maxVoxels = 4000000                 # upper bound on number of voxels
requestedAngularVoxelSize = 0.3    # upper bound on voxel angular size (doesn't affect "initial voxels")
minDx = 0.0                        # lower bound on voxel spatial size
from = 0                           # first collector (packing) number <=> rnd seed
collectors = 1                     # number of collectors
#maxTime = 100000.0                # dimensionless time to stop after - for shapes not supporting saturation
split = 100000                     # number of failed RSA iterations to split voxels
#surfaceDimension = 1              # surface dimension - can be smaller than RSA_SPATIAL_DIMENSION
surfaceVolume = 1000000.0          # volume of a packing
storePackings = true               # true if packings are to be saved to packing_[...].bin files
seedOrigin = 0                     # the seed of packing = seedOrigin + collector id. seedOrigin can be set to "random"

#modifiedRSA = true                # no idea :/. Some kind of debugging?
#thresholdDistance = 25.0          # lower bound on shapes' neighbour grid size
boundaryConditions = periodic      # periodic or free

particleType = OrientedCuboid      # particle to pack - different ones available for different dimensions (here 2, 1)
particleAttributes = 2 1           # particle dependent attributes - here semiaxes ratio
#generatorProcesses = 1            # number of processes to fork
#ompThreads = 1                    # upper bound on number of OpenMP threads to spawn

Should I change some else parameters?

How can I get the image like you do?

lhxone commented 2 years ago

I think I know where the problem is. It doesn't work well when I was trying to input parameters as -f model. So I change the default parameters from the rsa3d/rsa3d/Parameters.h and it works!