@@ -73,11 +73,15 @@ public:
7373 FCITransform () = delete ;
7474 FCITransform (Mesh& mesh, const Coordinates::FieldMetric& dy, bool zperiodic = true ,
7575 Options* opt = nullptr )
76- : ParallelTransform(mesh, opt) {
76+ : ParallelTransform(mesh, opt), R{&mesh}, Z{&mesh} {
7777
7878 // check the coordinate system used for the grid data source
7979 FCITransform::checkInputGrid ();
8080
81+ // Real-space coordinates of grid cells
82+ mesh.get (R, " R" , 0.0 , false );
83+ mesh.get (Z, " Z" , 0.0 , false );
84+
8185 auto forward_boundary_xin =
8286 std::make_shared<BoundaryRegionPar>(" FCI_forward" , BNDRY_PAR_FWD_XIN, +1 , &mesh);
8387 auto backward_boundary_xin = std::make_shared<BoundaryRegionPar>(
@@ -142,6 +146,10 @@ public:
142146
143147 bool canToFromFieldAligned () const override { return false ; }
144148
149+ // / Save mesh variables to output
150+ // / If R and Z(x,y,z) coordinates are in the input then these are saved to output.
151+ void outputVars (Options& output_options) override ;
152+
145153 bool requiresTwistShift (bool UNUSED (twist_shift_enabled),
146154 [[maybe_unused]] YDirectionType ytype) override {
147155 // No Field3Ds require twist-shift, because they cannot be field-aligned
@@ -156,6 +164,9 @@ protected:
156164private:
157165 // / FCI maps for each of the parallel slices
158166 std::vector<FCIMap> field_line_maps;
167+
168+ // / Real-space coordinates of grid points
169+ Field3D R, Z;
159170};
160171
161172#endif // BOUT_FCITRANSFORM_H
0 commit comments