discover the type of mesh, then call the corresponding downsizing base module
group DVdownsize {
Mesh_Struct+Node_Data+Iparam &in {
nnodes+req;
};
float+Iparam factor[in.ndim];
DVdownsize_struct DVdownsize_struct {
&factor => <-.factor;
};
DVdownsize_unif DVdownsize_unif {
&factor => <-.factor;
};
DVdownsize_rect DVdownsize_rect {
&factor => <-.factor;
};
DVfld_match DVfld_match {
Mesh_Struct+IPort2 &in=> <-.in;
links {
link0 => DVdownsize_unif.in;
link1 => DVdownsize_rect.in;
link2 => DVdownsize_struct.in;
};
};
DVswitch DVswitch {
in => {DVdownsize_unif.out, DVdownsize_rect.out,
DVdownsize_struct.out};
index => DVfld_match.index;
};
olink out => DVswitch.out;
};
DVdownsize is a utility base module. It discovers what type of mesh (Mesh_Struct, Mesh_Rect, or Mesh_Unif) its input field has, then passes control through DVswitch to the corresponding base module (DVdownsize_struct, DVdownsize_rect, or DVdownsize_unif).
A reference to a field containing any type of structured mesh, plus Node_Data.
The scaling factor. This is passed through to the selected base module.
The output is the same as the DVswitch selection.