InitField¶
Note
Note that the field names must match the model used. E.g. mu_minus and mu_plus should be used for MeltChiAB, but mu_1 and mu_+ would be used for MeltMeltChiMultiSpecies with incompressibility
- class openfts.init_field.Gaussian(ngaussian=None, centers=[], height=None, width=None)¶
Used by Model to initialize a field using Gaussians
- Parameters:
ngaussian (int) – TODO variable not in documentation
centers (list[list[float]]) – TODO variable not in documentation
height (float) – TODO variable not in documentation
width (float) – TODO variable not in documentation
(python):
# for ChiAB fts.model = openfts.model.ChiAB( ...) fts.model.init_fields['mu_minus'] = openfts.init_field.Gaussian(height=1.0,ngaussian=2,width=0.1, centers=[[0,0],[0.5,0.5]])
json:
"model": { "type": "MeltChiAB" ... "initfields": { "mu_minus": { "center0": [ 0,0 ], "center1": [ 0.5,0.5 ], "height": 1.0, "ngaussian": 2, "type": "gaussians", "width": 0.1 } ... }, ... }
- class openfts.init_field.Random(mean=None, stdev=None)¶
Used by Model to initialize a field randomly
- Parameters:
mean (float) – Mean of the randomly generated field
stdev (float) – Standard deviation of the randomly generated field
(python):
# for ChiMultiSpecies # exchange fields fts.model.init_fields['mu_1'] = openfts.init_field.Random(mean=0.0,stdev=1.0) fts.model.init_fields['mu_2'] = openfts.init_field.Random(mean=0.0,stdev=1.0) fts.model.init_fields['mu_3'] = openfts.init_field.Random(mean=0.0,stdev=1.0) # species fields fts.model.init_fields['mu_A'] = openfts.init_field.Random(mean=0.0,stdev=1.0) fts.model.init_fields['mu_B'] = openfts.init_field.Random(mean=0.0,stdev=1.0) fts.model.init_fields['mu_C'] = openfts.init_field.Random(mean=0.0,stdev=1.0)
json:
"model": { "type": "MeltChiAB" ... "initfields": { "mu_plus": { "type": "random", "mean": 0.0, "stdev": 1.0 } ... },
- class openfts.init_field.FromFile(filename, field_type='exchange')¶
Initializes a set of fields from a file for Model
- Parameters:
filename (string) – Initialize fields by reading from filename
field_type (string) – Types of fields to read from the file, species or exchange. Default is exchange
python
import openfts fts = openfts.OpenFTS() ... field_filename="exchange_fields.in" fts.model.init_fields = openfts.init_field.FromFile(filename=field_filename,field_type='exchange') ...
json
"model": { "type": ... ... "initfields": { "field_type": "exchange", "file":"exchange_fields.in" }, ... },