Open ahojukka5 opened 9 months ago
This is now partially implemented:
{
// ...
"fields": [
{
"name": "psi",
"data": "/data/pfc/tungsten/psi_%d.bin"
},
{
"name": "psiMF",
"data": "/data/pfc/tungsten/psimf_%d.bin"
}
],
"initial_conditions": [
{
"target": "psi", // <-- target
"type": "constant",
"n0": -0.4
},
{
"target": "psi", // <-- target
"type": "single_seed",
"amp_eq": 0.215936,
"rho_seed": -0.047
}
],
"boundary_conditions": [
{
"target": "psi", // <-- target
"type": "fixed",
"rho_low": -0.464,
"rho_high": -0.100
}
]
}
It however defaults to real fields as shown e..g here.
At the moment, support for multiple fields works only partially. They can be defined in model, but it's not possible to define any initial or boundary condition to other fields than
default
. Some modifications is needed, probably backward incompatible ones.Description
Currently, we define initial and boundary conditions to fields in json file in this way:
Like can seen, there is no any way to give option to which field these should be affected. Historically, we started with a field
phi
which was given byget_field
, and later on it was extended that we can get any field by giving it's name, likeget_field("myfield")
. To preserve backward compatibility, we default to a field calleddefault
. For example, here we get the field inside boundary condition:There is no information on boundary condition / initial condition (a.k.a. "field modifier") to which field it should operate, and this needs to be changed. Perhaps introduce
std::string m_field_name
, some getterconst std::string &get_field_name() const
and things like that. So we can still add default field namedefault
to member variable in order to maintain backward compatibility. Those need to be implemented toFieldModifier
.Then, in json file, we might have something like
target
orfield_name
which determines what field to operate on, and if not given,default
: