Commit 0253319b authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files


parent c643f52b
Pipeline #9332 failed with stages
in 2 minutes and 24 seconds
This diff is collapsed.
This diff is collapsed.
......@@ -23,60 +23,4 @@
#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);
int particleProblemIterate(ParticleProblem *p, double alert, double dt, double tol, int maxit,int force_motion, double *externalForces);
int particleProblemSolve(ParticleProblem *p, double alert, double dt, double tol, int maxit);
void particleProblemAddParticle(ParticleProblem *p, const double x[DIMENSION], double r, int body);
void particleProblemAddBody(ParticleProblem *p, const double x[DIMENSION], double m, double I, const char *material, int forced);
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);
size_t particleProblemAddBoundaryPeriodicSegment(ParticleProblem *p, const double x0[DIMENSION], const double x1[DIMENSION], const int etag);
size_t particleProblemAddBoundaryPeriodicEntity(ParticleProblem *p, const int etag, int edim, const double transform[DIMENSION]);
size_t particleProblemGetTagId(ParticleProblem *p, const char *tag);
size_t particleProblemGetMaterialTagId(ParticleProblem *p, const char *tag);
const char* particleProblemGetTagName(ParticleProblem *p, size_t tag);
const char* particleProblemGetMaterialTagName(ParticleProblem *p, size_t tag);
void particleProblemAddBoundaryTriangle(ParticleProblem *p, const double x0[DIMENSION], const double x1[DIMENSION], const double x2[DIMENSION], const char *tag, const char *material);
double *particleProblemDisk(ParticleProblem *p);
double *particleProblemPeriodicEntity(ParticleProblem *p);
double *particleProblemTriangle(ParticleProblem *p);
double *particleProblemSegment(ParticleProblem *p);
double *particleProblemPeriodicSegment(ParticleProblem *p);
double *particleProblemParticle(ParticleProblem *p);
double *particleProblemBody(ParticleProblem *p);
double *particleProblemVelocity(ParticleProblem *p);
double *particleProblemPosition(ParticleProblem *p);
double *particleProblemContactForces(ParticleProblem *p);
void particleProblemSetUseQueue(ParticleProblem *p, int use_queue);
void particleProblemRemoveParticles(ParticleProblem *p, const int *remove_flag);
unsigned long int particleProblemNParticle(ParticleProblem *p);
double *particleProblemRadius(ParticleProblem *p);
int *particleProblemDiskTag(ParticleProblem *p);
int *particleProblemSegmentTag(ParticleProblem *p);
int *particleProblemDiskMaterial(ParticleProblem *p);
int *particleProblemSegmentMaterial(ParticleProblem *p);
int *particleProblemParticleMaterial(ParticleProblem *p);
int *particleProblemForcedFlag(ParticleProblem *p);
#if DIMENSION == 3
int *particleProblemTriangleTag(ParticleProblem *p);
int *particleProblemTriangleMaterial(ParticleProblem *p);
double *particleProblemTriangle(ParticleProblem *p);
double *particleProblemPeriodicTriangle(ParticleProblem *p);
double *particleProblemOmega(ParticleProblem *p);
void particleProblemSetFrictionCoefficient(ParticleProblem *p, double mu, const char *mat0, const char *mat1);
double *particleProblemMu(ParticleProblem *p);
int particleProblemNTag(const ParticleProblem *p);
int particleProblemNMaterial(const ParticleProblem *p);
......@@ -14,12 +14,12 @@ def add_piece(p, i):
if i>= pieces_coord.shape[0]: return
coord = pieces_coord[i]
R = np.repeat(0.05,4)
p.add_body(coord, R, np.pi*R**2*rho,material="Sand",forced=0)[-1,0] = pieces_omega[i]
p.add_particle_body(coord, R, np.pi*R**2*rho,material="Sand",forced=0)
p.body_omega()[-1,0] = pieces_omega[i]
#p.velocity()[-1,1] = -0.1
n_inserted_pieces = 0
p = scontact.ParticleProblem(2,friction_enabled=friction,rotation_enabled=True)
p = scontact.ParticleProblem(2)
a = 1
g = np.array([0,-9.81])
r = 0.05
......@@ -53,4 +53,5 @@ while t<tend :
if i %outf == 0 :
ioutput = int(i/outf) + 1
p.write_vtk(odir, ioutput, t)
p.read_vtk(odir, ioutput, t)
i += 1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment