fctst.c File Reference
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "fclib.h"
Include dependency graph for fctst.c:

Go to the source code of this file.

Macros

#define ASSERT(Test, ...)
 
#define IO(Call)   ASSERT ((Call) >= 0, "ERROR: HDF5 call failed")
 
#define MM(Call)   ASSERT ((Call), "ERROR: out of memory")
 

Functions

static struct fclib_matrix_infomatrix_info (struct fclib_matrix *mat, char *comment)
 
static struct fclib_matrixrandom_matrix (int m, int n)
 
static double * random_vector (int n)
 
static struct fclib_infoproblem_info (char *title, char *desc, char *math)
 
static struct fclib_globalrandom_global_problem (int global_dofs, int contact_points, int neq)
 
static struct fclib_solutionrandom_global_solutions (struct fclib_global *problem, int count)
 
static struct fclib_localrandom_local_problem (int contact_points, int neq)
 
static struct fclib_solutionrandom_local_solutions (struct fclib_local *problem, int count)
 
static int compare_matrix_infos (struct fclib_matrix_info *a, struct fclib_matrix_info *b)
 
static int compare_matrices (char *name, struct fclib_matrix *a, struct fclib_matrix *b)
 
static int compare_vectors (char *name, int n, double *a, double *b)
 
static int compare_infos (struct fclib_info *a, struct fclib_info *b)
 
static int compare_global_problems (struct fclib_global *a, struct fclib_global *b)
 
static int compare_local_problems (struct fclib_local *a, struct fclib_local *b)
 
static int compare_solutions (struct fclib_solution *a, struct fclib_solution *b, int nv, int nr, int nl)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   Test,
  ... 
)
Value:
do {\
if (! (Test)) { fprintf (stderr, "%s: %d => ", __FILE__, __LINE__);\
fprintf (stderr, __VA_ARGS__);\
fprintf (stderr, "\n"); exit (1); } } while (0)

Definition at line 31 of file fctst.c.

Referenced by main().

◆ IO

#define IO (   Call)    ASSERT ((Call) >= 0, "ERROR: HDF5 call failed")

Definition at line 37 of file fctst.c.

◆ MM

#define MM (   Call)    ASSERT ((Call), "ERROR: out of memory")

Function Documentation

◆ matrix_info()

static struct fclib_matrix_info* matrix_info ( struct fclib_matrix mat,
char *  comment 
)
static

◆ random_matrix()

static struct fclib_matrix* random_matrix ( int  m,
int  n 
)
static

◆ random_vector()

static double* random_vector ( int  n)
static

◆ problem_info()

static struct fclib_info* problem_info ( char *  title,
char *  desc,
char *  math 
)
static

◆ random_global_problem()

static struct fclib_global* random_global_problem ( int  global_dofs,
int  contact_points,
int  neq 
)
static

◆ random_global_solutions()

static struct fclib_solution* random_global_solutions ( struct fclib_global problem,
int  count 
)
static

Definition at line 149 of file fctst.c.

References fclib_global::G, fclib_global::H, fclib_solution::l, fclib_global::M, MM, fclib_matrix::n, fclib_solution::r, random_vector(), fclib_solution::u, and fclib_solution::v.

Referenced by main().

Here is the call graph for this function:

◆ random_local_problem()

static struct fclib_local* random_local_problem ( int  contact_points,
int  neq 
)
static

Definition at line 169 of file fctst.c.

References fclib_local::info, MM, fclib_local::mu, problem_info(), fclib_local::q, fclib_local::R, random_matrix(), random_vector(), fclib_local::s, fclib_local::spacedim, fclib_local::V, and fclib_local::W.

Referenced by main().

Here is the call graph for this function:

◆ random_local_solutions()

static struct fclib_solution* random_local_solutions ( struct fclib_local problem,
int  count 
)
static

Definition at line 197 of file fctst.c.

References fclib_solution::l, MM, fclib_matrix::n, fclib_local::R, fclib_solution::r, random_vector(), fclib_solution::u, fclib_solution::v, and fclib_local::W.

Referenced by main().

Here is the call graph for this function:

◆ compare_matrix_infos()

static int compare_matrix_infos ( struct fclib_matrix_info a,
struct fclib_matrix_info b 
)
static

◆ compare_matrices()

static int compare_matrices ( char *  name,
struct fclib_matrix a,
struct fclib_matrix b 
)
static

◆ compare_vectors()

static int compare_vectors ( char *  name,
int  n,
double *  a,
double *  b 
)
static

Definition at line 335 of file fctst.c.

Referenced by compare_global_problems(), compare_local_problems(), and compare_solutions().

◆ compare_infos()

static int compare_infos ( struct fclib_info a,
struct fclib_info b 
)
static

◆ compare_global_problems()

static int compare_global_problems ( struct fclib_global a,
struct fclib_global b 
)
static

◆ compare_local_problems()

static int compare_local_problems ( struct fclib_local a,
struct fclib_local b 
)
static

◆ compare_solutions()

static int compare_solutions ( struct fclib_solution a,
struct fclib_solution b,
int  nv,
int  nr,
int  nl 
)
static

Definition at line 398 of file fctst.c.

References compare_vectors(), fclib_solution::l, fclib_solution::r, fclib_solution::u, and fclib_solution::v.

Referenced by main().

Here is the call graph for this function:

◆ main()