/* See {salamic_section.h}. */ /* Last edited on 2015-10-02 16:40:13 by stolfilocal */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include /* ??? eps should be {double} ??? */ void salamic_section_write_section_header(FILE *wr, salamic_mesh_t *mesh, int32_t pZ, int32_t mf) { filefmt_write_header(wr, "salamic_section", salamic_section_VERSION); fprintf(wr, "eps = %23.15e\n", (double)mesh->eps); fprintf(wr, "planeZ = %+23.15e\n", ((double)pZ)*(double)mesh->eps); fprintf(wr, "planeQ = %+11d\n", pZ); fprintf(wr, "nSegs = %d\n", mf); fflush(wr); } void salamic_section_write_path_or_loop(FILE *wr, salamic_mesh_t *mesh, int32_t pZ, int32_t me, int32_t ixEdge[]) { fprintf(wr, "\n"); fprintf(wr, "path\n"); fprintf(wr, "nPoints = %d\n", me); int ie; for(ie = 0; ie < me; ie++) { int32_t ixe = ixEdge[ie]; r2_t vi = salamic_mesh_edge_plane_intersection(mesh, ixe, pZ); fprintf(wr, " %+.3f %+.3f\n", (float)vi.c[0], (float)vi.c[1]); } fprintf(wr, "endpath\n"); } void salamic_section_write_section_footer(FILE *wr) { filefmt_write_footer(wr, "salamic_section"); }