Species Inventory🔗
Various species types that can be declared and define the system being simulated.
Classes🔗
Brush
🔗
Bases: object
Class to store the location of a brushed surface. The brush density denotes the density of the affixed end of the polymer in space.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Unique name. |
required |
density
|
ndarray
|
Density in space (of some corresponding grid) of the fixed segment of the polymer. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Unique name. |
density |
ndarray
|
Spatial density of the attached brush end |
Source code in polycomp/base.py
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 | |
Monomer
🔗
Bases: object
Class for the monomer of one species in the simulation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Monomer identifier to be displayed publicly. |
required |
charge
|
float
|
Monomer charge. |
0
|
identity
|
str
|
Monomer type (solvent or polymer). |
'solvent'
|
has_volume
|
bool
|
Whether the monomer occupies volume. |
True
|
Attributes:
| Name | Type | Description |
|---|---|---|
name |
string
|
Unique monomer name. |
charge |
float
|
Charge of the monomer. |
identity |
string
|
Identity of the monomer, usually {polymer, solvent, salt, Nanoparticle}. |
has_volume |
bool
|
Whether the monomer occupies volume. |
Source code in polycomp/base.py
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 | |
Nanoparticle
🔗
Bases: object
Defines an inert nanoparticle with a fixed spatial density.
The position of the nanoparticle is fixed unless manually changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Unique name. |
required |
monomer_type
|
Monomer
|
Monomer type associated with the nanoparticle in question (for FH interaction purposes). |
required |
density
|
ndarray
|
Density in space (of some corresponding grid) of the nanoparticle. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Unique name. |
density |
ndarray
|
Spatial density of the nanoparticle. |
type |
Monomer
|
Monomer identity (for FH interaction purposes) of the nanoparticle. |
Source code in polycomp/base.py
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 | |
Functions🔗
place_nps(positions: cp.ndarray) -> None
🔗
Updates the density of the nanoparticle position
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
positions
|
ndarray
|
Desired new density profile for the nanoparticles in the system. |
required |
Source code in polycomp/base.py
229 230 231 232 233 234 235 236 237 238 239 240 | |
Polymer
🔗
Bases: object
Class to store all the information for one type of polymer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Unique name. |
required |
total_length
|
float
|
Total length along the polymer. (Only accurate if sum of block lengths is 1) |
required |
block_structure
|
array - like
|
A list-like object of blocks defining the polymer architecture. Each
block should be a list-like object of length 2, in the format
Example for a diblock: |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
string
|
Unique name of a polymer. |
total_length |
float
|
Total length of the polymer for integration. |
block_structure |
array - like
|
A list-like object of blocks defining the polymer architecture. Format is
|
struct |
ndarray
|
Array of Monomer objects representing linear polymer structure. |
h_struct |
ndarray
|
Array of floats for the length of each section of the structure. |
fastener |
Brush
|
Brush object indicating where the sequence is fastened. Fastening always occurs on the leading end. |
Source code in polycomp/base.py
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 | |
Functions🔗
build_working_polymer(h: float, total_h: float) -> None
🔗
Build the polymer structure that will be used for integration.
Built-in method to construct a working polymer during integration according to parameters specific to the simulation run. Normally called automatically as part of system setup.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Maximum integration segment length \(\Delta s\). |
required |
total_h
|
float
|
Total length of the polymer \(s_P\). |
required |
Raises:
| Type | Description |
|---|---|
ValueError:
|
Raises an error if the polymer already has a built structure. At present, there is no reason that a polymer structure should be built more than once in a single simulation. |
Source code in polycomp/base.py
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 | |