mesh.h 1.01 KB
Newer Older
1
2
3
#ifndef MESH_H
#define MESH_H

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
4
5
#include <stdio.h>

6
7
8
9
10
11
12
typedef struct {
  int n_nodes;
  double *x;
  int n_triangles;
  int *triangles;
  int n_phys;
  char **phys_name;
Matthieu Constant's avatar
Matthieu Constant committed
13
  int *phys_n_nodes;
14
15
16
17
18
19
20
  int **phys_nodes;
  int *phys_dimension;
  int *phys_id;
} Mesh;

Mesh *mesh_load_msh(const char *filename);
void mesh_free(Mesh *m);
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
21
22
23
24
25
26
int mesh_write_msh(Mesh *mesh, FILE *f);
int mesh_write_msh_scalar(const Mesh *mesh, FILE *f, const char *field_name, double t, int iter, const double *solution, int n_fields, int field_id);
int mesh_write_msh_vector(const Mesh *mesh, FILE *f, const char *field_name, double t, int iter, const double *solution, int n_fields, int field_id_0, int field_id_1);

int mesh_write_pos_scalar(const Mesh *mesh, const char *dir_name, const char *field_name, double t, int iter, const double *solution, int n_fields, int field_id);
int mesh_write_pos_vector(const Mesh *mesh, const char *dir_name, const char *field_name, double t, int iter, const double *solution, int n_fields, int field_id_0, int field_id_1);
27
28
29

#endif