Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9367c320 authored by FELŠÖCI Marek's avatar FELŠÖCI Marek
Browse files

Add function for resetting cylinder

parent 0a07b8da
No related branches found
No related tags found
No related merge requests found
...@@ -49,6 +49,7 @@ int computeRelativeError(void *sol, void *ref, double *eps) ; ...@@ -49,6 +49,7 @@ int computeRelativeError(void *sol, void *ref, double *eps) ;
int computeVecNorm(void *ref, double *norm); int computeVecNorm(void *ref, double *norm);
int computeCoordCylinder(int i, double *coord) ; int computeCoordCylinder(int i, double *coord) ;
int initCylinder(int *argc, char ***argv) ; int initCylinder(int *argc, char ***argv) ;
void resetCylinder();
int getMeshStep(double *m) ; int getMeshStep(double *m) ;
int main(int argc, char **argv) ; int main(int argc, char **argv) ;
int computeRhs(void) ; int computeRhs(void) ;
......
...@@ -9,10 +9,11 @@ double radius = 2.0 ; ...@@ -9,10 +9,11 @@ double radius = 2.0 ;
double height = 4.0 ; double height = 4.0 ;
/*! \brief Mesh step (average distance between two points) */ /*! \brief Mesh step (average distance between two points) */
double meshStep ; double meshStep;
/*! \brief Number of points per loops in the BEM mesh (main cylinder) */ static double angleStep=0.;
static int nbPtsLoop=0;
static double zStep=0.;
/*! \brief Computes coordinates of point number 'i' /*! \brief Computes coordinates of point number 'i'
...@@ -24,8 +25,6 @@ static int nbPtsLoop=0; ...@@ -24,8 +25,6 @@ static int nbPtsLoop=0;
\return 0 for success \return 0 for success
*/ */
int computeCoordCylinder(int i, double *coord) { int computeCoordCylinder(int i, double *coord) {
static double angleStep=0. ;
static double zStep=0. ;
double theta ; double theta ;
if (i<0 || i>=nbPts) { if (i<0 || i>=nbPts) {
...@@ -39,8 +38,6 @@ int computeCoordCylinder(int i, double *coord) { ...@@ -39,8 +38,6 @@ int computeCoordCylinder(int i, double *coord) {
zStep=height/(double)nbPts ; zStep=height/(double)nbPts ;
angleStep=sqrt(zStep*2.*M_PI/radius) ; angleStep=sqrt(zStep*2.*M_PI/radius) ;
meshStep=zStep*2.*M_PI/angleStep ; meshStep=zStep*2.*M_PI/angleStep ;
nbPtsLoop=floor(2.*M_PI/angleStep) ; // Used to write VTK file
} }
theta = (double)i * angleStep ; theta = (double)i * angleStep ;
...@@ -75,6 +72,11 @@ int initCylinder(int *argc, char ***argv) { ...@@ -75,6 +72,11 @@ int initCylinder(int *argc, char ***argv) {
return 0 ; return 0 ;
} }
void resetCylinder() {
angleStep=0.;
zStep=0.;
}
int getMeshStep(double *m) { int getMeshStep(double *m) {
if (meshStep==0.) if (meshStep==0.)
SETERRQ(1, "meshStep not yet initialized. Come back later.") ; SETERRQ(1, "meshStep not yet initialized. Come back later.") ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment