fctst.c
Go to the documentation of this file.
126 static struct fclib_global* random_global_problem (int global_dofs, int contact_points, int neq)
142 if (rand () % 2) problem->info = problem_info ("A random global problem", "With random matrices", "And fake math");
176 problem->W = random_matrix (problem->spacedim*contact_points, problem->spacedim*contact_points);
190 if (rand () % 2) problem->info = problem_info ("A random local problem", "With random matrices", "And fake math");
398 static int compare_solutions (struct fclib_solution *a, struct fclib_solution *b, int nv, int nr, int nl)
439 ASSERT (compare_solutions (solution, s, p->M->n, p->H->n, (p->G ? p->G->n : 0)), "ERROR: written/read solution comparison failed");
443 ASSERT (compare_solutions (guesses+i, g+i, p->M->n, p->H->n, (p->G ? p->G->n : 0)), "ERROR: written/read guess comparison failed");
484 ASSERT (compare_solutions (solution, s, 0, p->W->m, (p->R ? p->R->n : 0)), "ERROR: written/read solution comparison failed");
497 ASSERT (compare_solutions (guesses+i, g+i, 0, p->W->n, (p->R ? p->R->n : 0)), "ERROR: written/read guess comparison failed");
static struct fclib_info * problem_info(char *title, char *desc, char *math)
Definition: fctst.c:110
static int compare_local_problems(struct fclib_local *a, struct fclib_local *b)
Definition: fctst.c:383
char * math_info
known properties of the problem (existence, uniqueness, ...)
Definition: fclib.h:117
FCLIB_STATIC struct fclib_global * fclib_read_global(const char *path)
read global problem; return problem on success; NULL on failure
Definition: fclib.h:1011
FCLIB_STATIC void fclib_delete_solutions(struct fclib_solution *data, int count)
delete solutions or guesses
Definition: fclib.h:1210
static int compare_global_problems(struct fclib_global *a, struct fclib_global *b)
Definition: fctst.c:367
FCLIB_STATIC int fclib_write_local(struct fclib_local *problem, const char *path)
write local problem; return 1 on success, 0 on failure
Definition: fclib.h:853
static int compare_solutions(struct fclib_solution *a, struct fclib_solution *b, int nv, int nr, int nl)
Definition: fctst.c:398
static int compare_matrices(char *name, struct fclib_matrix *a, struct fclib_matrix *b)
Definition: fctst.c:230
double * mu
the vector of coefficient of friction (see mathematical description below)
Definition: fclib.h:204
static struct fclib_solution * random_local_solutions(struct fclib_local *problem, int count)
Definition: fctst.c:197
FCLIB_STATIC struct fclib_solution * fclib_read_solution(const char *path)
read solution; return solution on success; NULL on failure
Definition: fclib.h:1117
FCLIB_STATIC struct fclib_solution * fclib_read_guesses(const char *path, int *number_of_guesses)
read initial guesses; return vector of guesses on success; NULL on failure; output number of guesses ...
Definition: fclib.h:1145
int * p
compressed: row (size m+1) or column (size n+1) pointers; triplet: row indices (size nz) ...
Definition: fclib.h:149
int * i
compressed: column or row indices, size nzmax; triplet: column indices (size nz)
Definition: fclib.h:151
int spacedim
the dimension , 2 or 3, of the local space at contact (2d or 3d friction contact laws) ...
Definition: fclib.h:264
int nz
of entries in triplet matrix, -1 for compressed columns, -2 for compressed rows
Definition: fclib.h:155
static struct fclib_local * random_local_problem(int contact_points, int neq)
Definition: fctst.c:169
static struct fclib_matrix_info * matrix_info(struct fclib_matrix *mat, char *comment)
Definition: fctst.c:41
FCLIB_STATIC void fclib_delete_local(struct fclib_local *problem)
delete local problem
Definition: fclib.h:1198
This structure allows the user to enter a description for a given matrix (comment, conditionning, determinant, rank.) if they are known.
Definition: fclib.h:125
static struct fclib_solution * random_global_solutions(struct fclib_global *problem, int count)
Definition: fctst.c:149
double * u
local velocity (or position/displacement for quasi-static problems) solution vector ...
Definition: fclib.h:280
static int compare_infos(struct fclib_info *a, struct fclib_info *b)
Definition: fctst.c:355
FCLIB_STATIC void fclib_delete_global(struct fclib_global *problem)
delete global problem
Definition: fclib.h:1185
FCLIB_STATIC struct fclib_local * fclib_read_local(const char *path)
read local problem; return problem on success; NULL on failure
Definition: fclib.h:1061
static int compare_matrix_infos(struct fclib_matrix_info *a, struct fclib_matrix_info *b)
Definition: fctst.c:217
static int compare_vectors(char *name, int n, double *a, double *b)
Definition: fctst.c:335
double * v
global velocity (or position/displacement for quasi-static problems) solution vector ...
Definition: fclib.h:278
FCLIB_STATIC int fclib_write_guesses(int number_of_guesses, struct fclib_solution *guesses, const char *path)
write initial guesses; return 1 on success, 0 on failure
Definition: fclib.h:961
double * mu
the vector of coefficient of friction (see mathematical description below)
Definition: fclib.h:258
int spacedim
the dimension , 2 or 3, of the local space at contact (2d or 3d friction contact laws) ...
Definition: fclib.h:212
FCLIB_STATIC int fclib_write_global(struct fclib_global *problem, const char *path)
write global problem; return 1 on success, 0 on failure
Definition: fclib.h:781
static struct fclib_global * random_global_problem(int global_dofs, int contact_points, int neq)
Definition: fctst.c:126
This structure allows the user to enter a problem information as a title, a short description and kno...
Definition: fclib.h:110
FCLIB_STATIC int fclib_write_solution(struct fclib_solution *solution, const char *path)
write solution; return 1 on success, 0 on failure
Definition: fclib.h:921