82 FILE* finit = fopen(filename,
"r");
93 fscanf(finit,
"DebugLevel: %d\n", &
DebugLevel);
95 fscanf(finit,
"NewModel: %d\n", &
NewModel);
96 fscanf(finit,
"NewMesh: %d\n", &
NewMesh);
97 fscanf(finit,
"NewBC: %d\n", &
NewBC);
98 fscanf(finit,
"NewPP: %d\n", &
NewPP);
99 fscanf(finit,
"ModelCntr: %d\n", &
ModelCntr);
100 fscanf(finit,
"MeshCntr: %d\n", &
MeshCntr);
101 fscanf(finit,
"BCCntr: %d\n", &
BCCntr);
102 fscanf(finit,
"PPCntr: %d\n", &
PPCntr);
113 fscanf(finit,
"OptGnuplot: %d\n", &
OptGnuplot);
136 fscanf(finit,
"PrimAfter: %d\n", &
PrimAfter);
143 fprintf(stdout,
"LengthScale: %le\n",
LengthScale);
145 fprintf(stdout,
"NewModel: %d\n",
NewModel);
146 fprintf(stdout,
"NewMesh: %d\n",
NewMesh);
147 fprintf(stdout,
"NewBC: %d\n",
NewBC);
148 fprintf(stdout,
"NewPP: %d\n",
NewPP);
149 fprintf(stdout,
"ModelCntr: %d\n",
ModelCntr);
150 fprintf(stdout,
"MeshCntr: %d\n",
MeshCntr);
151 fprintf(stdout,
"BCCntr: %d\n",
BCCntr);
152 fprintf(stdout,
"PPCntr: %d\n",
PPCntr);
163 fprintf(stdout,
"OptGnuplot: %d\n",
OptGnuplot);
183 fprintf(stdout,
"PrimAfter: %d\n",
PrimAfter);
199 double zvert[],
double* xnorm,
double* ynorm,
200 double* znorm,
int* volref1,
int* volref2) {
203 if (prim < 1)
return -1;
204 double a = 0., b = 0., c = 0.;
205 std::vector<double> xv;
206 std::vector<double> yv;
207 std::vector<double> zv;
208 int vol1 = 0, vol2 = 0;
210 xv, yv, zv, vol1, vol2)) {
213 const size_t nv = xv.size();
215 for (
size_t i = 0; i < nv; ++i) {
217 xvert[i] = 0.01 * xv[i];
218 yvert[i] = 0.01 * yv[i];
219 zvert[i] = 0.01 * zv[i];
224 if (nv == 2) *xnorm *= 0.01;
238 int* jy,
double* sy,
int* iz,
int* jz,
double* sz) {
243 bool perx =
false, pery =
false, perz =
false;
265 if (*ix > 0 || *iy > 0 || *iz > 0) {
266 unsigned int nx = 0, ny = 0, nz = 0;
282 double* sy,
int* iz,
int* jz,
double* sz) {
286 bool perx =
false, pery =
false, perz =
false;
298 *sx = *sy = *sz = 0.;
309 double* cxmax,
double* vxmax,
int* iymin,
310 double* cymin,
double* vymin,
int* iymax,
311 double* cymax,
double* vymax,
int* izmin,
312 double* czmin,
double* vzmin,
int* izmax,
313 double* czmax,
double* vzmax) {
316 *vxmin = *vxmax = 0.;
317 *cxmin = *cxmax = 0.;
319 for (
unsigned int i = 0; i < nx; ++i) {
320 double x = 0., v = 0.;
333 *vymin = *vymax = 0.;
334 *cymin = *cymax = 0.;
336 for (
unsigned int i = 0; i < ny; ++i) {
337 double y = 0., v = 0.;
350 *vzmin = *vzmax = 0.;
351 *czmin = *czmax = 0.;
353 for (
unsigned int i = 0; i < nz; ++i) {
354 double z = 0., v = 0.;
379 double* epsilon,
double* potential,
double* charge,
384 *epsilon, *potential, *charge,
bool GetPlaneZ(const unsigned int i, double &z, double &v) const
Retrieve the parameters of a plane at constant z.
bool GetPlaneY(const unsigned int i, double &y, double &v) const
Retrieve the parameters of a plane at constant y.
bool GetPeriodicityX(double &s) const
Get the periodic length in the x-direction.
unsigned int GetNumberOfPrimitives() const
bool GetPeriodicityZ(double &s) const
Get the periodic length in the z-direction.
unsigned int GetNumberOfPlanesY() const
Get the number of equipotential planes at constant y.
bool GetPeriodicityY(double &s) const
Get the periodic length in the y-direction.
unsigned int GetNumberOfPlanesZ() const
Get the number of equipotential planes at constant z.
bool GetVolume(const unsigned int vol, int &shape, int &material, double &eps, double &potential, double &charge, int &bc)
unsigned int GetNumberOfPlanesX() const
Get the number of equipotential planes at constant x.
bool GetPlaneX(const unsigned int i, double &x, double &v) const
Retrieve the parameters of a plane at constant x.
void GetPeriodicCopies(unsigned int &nx, unsigned int &ny, unsigned int &nz) const
Retrieve the number of periodic copies used by neBEM.
void IsMirrorPeriodic(bool &perx, bool &pery, bool &perz)
Return mirror periodicity flags.
void IsPeriodic(bool &perx, bool &pery, bool &perz)
Return periodicity flags.
ComponentNeBem3d * gComponentNeBem3d
int neBEMVolumeDescription(int vol, int *shape, int *material, double *epsilon, double *potential, double *charge, int *boundarytype)
Return information about a volume.
int neBEMGetInputsFromFiles(void)
Do-nothing function (no file inputs).
int neBEMSetDefaults(void)
Assign default values to some of the important global variables.
int ReadInitFile(char filename[])
int neBEMVolumePoint(double x, double y, double z)
Return the volume in which a point is located.
int neBEMGetMirror(int, int *ix, int *jx, double *sx, int *iy, int *jy, double *sy, int *iz, int *jz, double *sz)
void neBEMVolumePrimitives(int, int *, int[])
int neBEMGetNbPrimitives()
Return the number of primitives.
int neBEMGetBoundingPlanes(int *ixmin, double *cxmin, double *vxmin, int *ixmax, double *cxmax, double *vxmax, int *iymin, double *cymin, double *vymin, int *iymax, double *cymax, double *vymax, int *izmin, double *czmin, double *vzmin, int *izmax, double *czmax, double *vzmax)
int neBEMGetPrimitive(int prim, int *nvertex, double xvert[], double yvert[], double zvert[], double *xnorm, double *ynorm, double *znorm, int *volref1, int *volref2)
Return one primitive at a time.
int neBEMGetPeriodicities(int, int *ix, int *jx, double *sx, int *iy, int *jy, double *sy, int *iz, int *jz, double *sz)
int neBEMMessage(const char *message)
INTFACEGLOBAL int OptPrimitiveFiles
INTFACEGLOBAL int neBEMState
INTFACEGLOBAL int OptPrintVolumeDetails
INTFACEGLOBAL char DeviceInputFile[256]
INTFACEGLOBAL int OptGnuplotPrimitives
INTFACEGLOBAL int OptDeviceFile
INTFACEGLOBAL int OptPrintPrimaryDetails
INTFACEGLOBAL int OptPrintVertexAndNormal
INTFACEGLOBAL int OptElementFiles
INTFACEGLOBAL int OptGnuplot
INTFACEGLOBAL int OptGnuplotElements
INTFACEGLOBAL int OptReuseDir
neBEMGLOBAL int DebugLevel
neBEMGLOBAL int NbVolumes
neBEMGLOBAL int OptInvMatProc
neBEMGLOBAL int OptRepeatLHMatrix
neBEMGLOBAL int OptStorePrimitives
neBEMGLOBAL int MaxNbVertices
neBEMGLOBAL double ElementLengthRqstd
neBEMGLOBAL int OptFormattedFile
neBEMGLOBAL int NbPrimitives
neBEMGLOBAL int PrimAfter
neBEMGLOBAL int OptSystemChargeZero
neBEMGLOBAL int OptStoreInflMatrix
neBEMGLOBAL int OptForceValidation
neBEMGLOBAL int OptUnformattedFile
neBEMGLOBAL double LengthScale
neBEMGLOBAL int MaxNbElementsOnLength
neBEMGLOBAL int ModelCntr
neBEMGLOBAL int OptValidateSolution
neBEMGLOBAL char DeviceOutDir[256]
neBEMGLOBAL int OptStoreElements
neBEMGLOBAL int OptStoreInvMatrix
neBEMGLOBAL int MinNbElementsOnLength