InitField ========= It is possible to initialize either the **exchange fields** or **species fields** within a model. Initializing exchange fields ------------------------------ When initializing exchange fields, the names of the fields will depend on the Model you are using. For example, for ModelChiAB: :: fts.model = openfts.model.ChiAB( ...) # exchange fields fts.model.init_fields['mu_minus'] = openfts.init_field.Random(mean=0.0,stdev=1.0) fts.model.init_fields['mu_plus'] = openfts.init_field.Random(mean=0.0,stdev=1.0) Or for ModelChiMultiSpecies: :: fts.model = openfts.model.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) .. note:: If you are having trouble determining the names of the exchange fields for your current model, try removing the `fts.model.init_fields` lines from your input file and run OpenFTS. The names of the exchange fields for your current model will be output to the log. Initializing species fields ------------------------------ It is generally conceptually more clear to initialize the species fields of the model. . One advantage of this approach is that this initialization will be independent of Model. Another advantage is that the species fields are generally easier to understand physically: the density of a species will be large where the species field is low. To initialize the using a species field, you will specify the name of the field that is consistent with that species' label specified by `Species(label='A')`. For example:: # species fields fts.species.append(openfts.Species(label='A', ...)) fts.species.append(openfts.Species(label='B', ...)) fts.model.init_fields['mu_A'] = ... # 'mu_A' is consistent with Species(label='A') above fts.model.init_fields['mu_B'] = ... # 'mu_B' is consistent with Species(label='B') above Ways to initialize exchange/species fields ------------------------------------------- .. autoclass:: openfts.init_field.Gaussian :members: .. autoclass:: openfts.init_field.Random :members: .. autoclass:: openfts.init_field.FromFile :members: