scontact.h 3.76 KB
Newer Older
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
1
/*
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
2
 * MigFlow - Copyright (C) <2010-2018>
3
4
 * <Universite catholique de Louvain (UCL), Belgium
 *  Universite de Montpellier, France>
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
5
 * 	
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
6
 * List of the contributors to the development of MigFlow: see AUTHORS file.
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
7
8
 * Description and complete License: see LICENSE file.
 * 	
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
9
 * This program (MigFlow) is free software: 
10
 * you can redistribute it and/or modify it under the terms of the GNU Lesser General 
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
11
12
13
14
15
16
 * Public License as published by the Free Software Foundation, either version
 * 3 of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU Lesser General Public License for more details.
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
18
 * 
19
20
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program (see COPYING and COPYING.LESSER files).  If not, 
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
21
22
23
 * see <http://www.gnu.org/licenses/>.
 */

Matthieu Constant's avatar
Matthieu Constant committed
24
25
26
27
28
29
30
31
32
33
#ifndef _SCONTACT_H_
#define _SCONTACT_H_
#include <stdlib.h>

typedef struct _ParticleProblem ParticleProblem;

ParticleProblem *particleProblemNew();
void particleProblemDelete(ParticleProblem *p);
void particleProblemLoad(ParticleProblem *p, const char *filename);
void particleProblemWrite(const ParticleProblem *p, const char *filename);
34
35
void particleProblemIterate(ParticleProblem *p, double alert, double dt, double tol, int maxit);
void particleProblemSolve(ParticleProblem *p, double alert, double dt, double tol, int maxit);
Matthieu Constant's avatar
Matthieu Constant committed
36
double particleProblemMaxDt(const ParticleProblem *p, double alert);
37
38
39
void particleProblemAddParticle(ParticleProblem *p, const double x[DIMENSION], double r, double m, const char *material);
size_t particleProblemAddBoundaryDisk(ParticleProblem *p, const double x0[DIMENSION], double r, const char *tag, const char *material);
size_t particleProblemAddBoundarySegment(ParticleProblem *p, const double x0[DIMENSION], const double x1[DIMENSION], const char *tag, const char *material);
Matthieu Constant's avatar
Matthieu Constant committed
40
size_t particleProblemGetTagId(ParticleProblem *p, const char *tag);
41
size_t particleProblemGetMaterialTagId(ParticleProblem *p, const char *tag);
Matthieu Constant's avatar
Matthieu Constant committed
42
const char* particleProblemGetTagName(ParticleProblem *p, size_t tag);
43
const char* particleProblemGetMaterialTagName(ParticleProblem *p, size_t tag);
Matthieu Constant's avatar
Matthieu Constant committed
44
#if DIMENSION==3
45
void particleProblemAddBoundaryTriangle(ParticleProblem *p, const double x0[DIMENSION], const double x1[DIMENSION], const double x2[DIMENSION], const char *tag, const char *material);
Matthieu Constant's avatar
Matthieu Constant committed
46
47
48
49
50
51
52
#endif
double *particleProblemDisk(ParticleProblem *p);
double *particleProblemSegment(ParticleProblem *p);
double *particleProblemParticle(ParticleProblem *p);
double *particleProblemVelocity(ParticleProblem *p);
double *particleProblemPosition(ParticleProblem *p);
double *particleProblemExternalForces(ParticleProblem *p);
53
void particleProblemSetUseQueue(ParticleProblem *p, int use_queue);
Matthieu Constant's avatar
Matthieu Constant committed
54
55
56
57
unsigned long int particleProblemNParticle(ParticleProblem *p);
double *particleProblemRadius(ParticleProblem *p);
int *particleProblemDiskTag(ParticleProblem *p);
int *particleProblemSegmentTag(ParticleProblem *p);
58
59
int *particleProblemDiskMaterial(ParticleProblem *p);
int *particleProblemSegmentMaterial(ParticleProblem *p);
Matthieu Constant's avatar
Matthieu Constant committed
60
61
#if DIMENSION == 3
int *particleProblemTriangleTag(ParticleProblem *p);
62
int *particleProblemTriangleMaterial(ParticleProblem *p);
Matthieu Constant's avatar
Matthieu Constant committed
63
64
65
66
double *particleProblemTriangle(ParticleProblem *p);
#endif
void ParticleToMesh(size_t nParticles, double *particles, int nElements, double *elements, int *elid, double *xi);
#endif
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
67
68

#ifdef FRICTION_ENABLED
69
void particleProblemSetFrictionCoefficient(ParticleProblem *p, double mu, const char *mat0, const char *mat1);
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
70
71
double *particleProblemOmega(ParticleProblem *p);
#endif
72
73
74

int particleProblemNTag(const ParticleProblem *p);
int particleProblemNMaterial(const ParticleProblem *p);