EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stddef.h>
#include <string.h>
#include <ctype.h>
#include <float.h>
#include <stdarg.h>
#include "egutils.h"
#include "egdef.h"
#include "egtypes.h"
#include "egnative.h"
#include "egmesh.h"
Go to the source code of this file.
Functions | |
void | InitGrid (struct GridType *grid) |
static void | ExampleGrid1D (struct GridType **grids, int *nogrids, int info) |
static void | ExampleGrid2D (struct GridType **grids, int *nogrids, int info) |
static void | ExampleGrid3D (struct GridType **grids, int *nogrids, int info) |
void | CreateExampleGrid (int dim, struct GridType **grids, int *nogrids, int info) |
void | SetElementDivision (struct GridType *grid, Real relh, int info) |
void | SetCellData (struct GridType *grid, struct CellType *cell, int info) |
int | SetCellKnots (struct GridType *grid, struct CellType *cell, int info) |
int | SetCellKnots1D (struct GridType *grid, struct CellType *cell, int info) |
int | GetKnotIndex (struct CellType *cell, int i, int j) |
int | GetKnotCoordinate (struct CellType *cell, int i, int j, Real *x, Real *y) |
int | GetElementIndices (struct CellType *cell, int i, int j, int *ind) |
int | GetElementIndex (struct CellType *cell, int i, int j) |
int | GetElementCoordinates (struct CellType *cell, int i, int j, Real *globalcoord, int *ind) |
int | GetSideInfo (struct CellType *cell, int cellno, int side, int element, int *elemind) |
void | SetElementDivisionExtruded (struct GridType *grid, int info) |
void | SetElementDivisionCylinder (struct GridType *grid, int info) |
static int | Getline (char *line1, FILE *io) |
static int | GetCommand (char *line1, char *line2, FILE *io) |
int | SaveElmergrid (struct GridType *grid, int nogrids, char *prefix, int info) |
int | LoadElmergrid (struct GridType **grid, int *nogrids, char *prefix, int info) |
void | InitParameters (struct ElmergridType *eg) |
int | LoadCommands (char *prefix, struct ElmergridType *eg, struct GridType *grid, int mode, const char *IOmethods[], int info) |
int | CreateElmerGridMesh (struct GridType *grid, struct FemType *data, struct BoundaryType *boundaries, Real relh, int info) |
Variables | |
int | matcactive |
int CreateElmerGridMesh | ( | struct GridType * | grid, |
struct FemType * | data, | ||
struct BoundaryType * | boundaries, | ||
Real | relh, | ||
int | info | ||
) |
Definition at line 3239 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 3239 of file egnative.cpp
References GridType::boundext, GridType::boundint, GridType::boundsolid, GridType::boundtype, CreateAllBoundaries(), CreateBoundary(), BoundaryType::created, CreateKnots(), CreatePoints(), GridType::dimension, FALSE, MAXBOUNDARIES, GridType::noboundaries, GridType::nocells, BoundaryType::nosides, SetCellData(), SetCellKnots(), SetCellKnots1D(), and SetElementDivision().
Referenced by ManipulateMeshDefinition().
void CreateExampleGrid | ( | int | dim, |
struct GridType ** | grids, | ||
int * | nogrids, | ||
int | info | ||
) |
Definition at line 405 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 405 of file egnative.cpp
References ExampleGrid1D(), ExampleGrid2D(), and ExampleGrid3D().
Referenced by ImportMeshDefinition().
|
static |
Definition at line 158 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 158 of file egnative.cpp
References GridType::autoratio, GridType::boundext, GridType::boundint, GridType::boundsolid, GridType::boundtype, COORD_CART1, GridType::coordsystem, GridType::firstmaterial, InitGrid(), GridType::lastmaterial, GridType::mappings, GridType::noboundaries, GridType::nonodes, NUMBER_1D, GridType::numbering, printf(), GridType::structure, GridType::wantedelems, GridType::x, GridType::xcells, GridType::xdens, GridType::xexpand, and GridType::ycells.
Referenced by CreateExampleGrid().
|
static |
Definition at line 214 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 214 of file egnative.cpp
References GridType::autoratio, GridType::boundext, GridType::boundint, GridType::boundsolid, GridType::boundtype, COORD_CART2, GridType::coordsystem, GridType::firstmaterial, InitGrid(), GridType::lastmaterial, GridType::mappinglimits, GridType::mappingline, GridType::mappingparams, GridType::mappingpoints, GridType::mappings, GridType::mappingtype, GridType::noboundaries, NUMBER_XY, GridType::numbering, printf(), Rvector, GridType::structure, GridType::totxelems, GridType::totyelems, GridType::totzelems, GridType::wantedelems, GridType::x, GridType::xcells, GridType::xexpand, GridType::y, GridType::ycells, and GridType::yexpand.
Referenced by CreateExampleGrid().
|
static |
Definition at line 306 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 306 of file egnative.cpp
References GridType::autoratio, GridType::boundext, GridType::boundint, GridType::boundsolid, GridType::boundtype, COORD_CART3, GridType::coordsystem, GridType::dimension, GridType::firstmaterial, InitGrid(), GridType::lastmaterial, GridType::layered, GridType::noboundaries, NUMBER_XY, GridType::numbering, printf(), GridType::structure, TRUE, GridType::wantedelems, GridType::x, GridType::xcells, GridType::y, GridType::ycells, GridType::z, GridType::zcells, GridType::zlastmaterial, and GridType::zmaterial.
Referenced by CreateExampleGrid().
|
static |
Definition at line 1973 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1973 of file egnative.cpp
References FALSE, matcactive, MAXLINESIZE, printf(), and TRUE.
Referenced by LoadCommands(), and LoadElmergrid().
Definition at line 1510 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1510 of file egnative.cpp
References BOTLEFT, BOTRIGHT, CellType::elem1st, CellType::elemwidth, GetElementIndices(), GetKnotCoordinate(), k, GridType::nonodes, CellType::nonodes, NUMBER_1D, NUMBER_XY, NUMBER_YX, GridType::numbering, CellType::numbering, printf(), TOPLEFT, TOPRIGHT, CellType::xlinear, CellType::xratio, CellType::ylinear, and CellType::yratio.
Referenced by CreateKnots().
int GetElementIndex | ( | struct CellType * | cell, |
int | i, | ||
int | j | ||
) |
Definition at line 1492 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1492 of file egnative.cpp
References CellType::elem1st, CellType::elemwidth, NUMBER_XY, NUMBER_YX, and CellType::numbering.
Referenced by CreatePoints().
int GetElementIndices | ( | struct CellType * | cell, |
int | i, | ||
int | j, | ||
int * | ind | ||
) |
Definition at line 1357 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1357 of file egnative.cpp
References BOTLEFT, BOTRIGHT, CellType::elem1st, CellType::elemwidth, GetKnotIndex(), CellType::left2center, CellType::leftcenter, CellType::levelwidthcenter, GridType::nonodes, CellType::nonodes, NUMBER_1D, NUMBER_XY, NUMBER_YX, GridType::numbering, CellType::numbering, printf(), TOPLEFT, and TOPRIGHT.
Referenced by GetElementCoordinates(), and GetSideInfo().
Definition at line 1309 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1309 of file egnative.cpp
References BOTLEFT, BOTRIGHT, CellType::dx1, CellType::dy1, GetKnotIndex(), TOPLEFT, CellType::xcorner, CellType::xelem, CellType::xlinear, CellType::xratio, CellType::ycorner, CellType::yelem, CellType::ylinear, and CellType::yratio.
Referenced by GetElementCoordinates().
int GetKnotIndex | ( | struct CellType * | cell, |
int | i, | ||
int | j | ||
) |
Definition at line 1263 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1263 of file egnative.cpp
References CellType::left1st, CellType::left2nd, CellType::leftlast, CellType::levelwidth, CellType::nonodes, NUMBER_1D, NUMBER_XY, NUMBER_YX, CellType::numbering, CellType::xelem, and CellType::yelem.
Referenced by GetElementIndices(), and GetKnotCoordinate().
|
static |
Definition at line 1930 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1930 of file egnative.cpp
References matcactive, MAXLINESIZE, and printf().
Referenced by LoadCommands(), and LoadElmergrid().
int GetSideInfo | ( | struct CellType * | cell, |
int | cellno, | ||
int | side, | ||
int | element, | ||
int * | elemind | ||
) |
Definition at line 1637 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1637 of file egnative.cpp
References DOWN, FALSE, GetElementIndices(), LEFT, MAXNODESD2, NUMBER_1D, GridType::numbering, printf(), RIGHT, TRUE, and UP.
Referenced by CreateAllBoundaries(), and CreateBoundary().
void InitGrid | ( | struct GridType * | grid | ) |
Definition at line 55 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 55 of file egnative.cpp
References GridType::autoratio, GridType::boundext, GridType::boundint, GridType::boundsolid, GridType::boundtype, GridType::curveangle, GridType::curverad, GridType::curvezet, GridType::dimension, GridType::elemmidpoints, GridType::elemorder, FALSE, GridType::firstmaterial, GridType::lastmaterial, GridType::layered, GridType::layeredbc, GridType::limitdx, GridType::limitdxverify, GridType::mappinglimits, GridType::mappingline, GridType::mappingpoints, GridType::mappings, GridType::mappingtype, MAT_NOTHING, MAXBOUNDARIES, MAXCELLS, MAXMAPPINGS, MAXMATERIALS, GridType::minxelems, GridType::minyelems, GridType::minzelems, GridType::noboundaries, GridType::nocells, GridType::noelements, GridType::noknots, GridType::nonodes, NUMBER_XY, GridType::numbered, GridType::numbering, GridType::partitions, GridType::polarradius, GridType::reduceordermatmax, GridType::reduceordermatmin, GridType::rotate, GridType::rotateblocks, GridType::rotatecartesian, GridType::rotatecurve, GridType::rotateimprove, GridType::rotateradius1, GridType::rotateradius2, GridType::structure, GridType::totxelems, GridType::totyelems, GridType::totzelems, GridType::triangleangle, GridType::triangles, TRUE, GridType::wantedelems, GridType::x, GridType::xcells, GridType::xdens, GridType::xelems, GridType::xexpand, GridType::xlinear, GridType::xratios, GridType::xyratio, GridType::xzratio, GridType::y, GridType::ycells, GridType::ydens, GridType::yelems, GridType::yexpand, GridType::ylinear, GridType::yratios, GridType::z, GridType::zcells, GridType::zdens, GridType::zelems, GridType::zexpand, GridType::zfirstmaterial, GridType::zlastmaterial, GridType::zlinear, GridType::zmaterial, and GridType::zratios.
Referenced by eg_transfermesh(), ExampleGrid1D(), ExampleGrid2D(), ExampleGrid3D(), and LoadElmergrid().
void InitParameters | ( | struct ElmergridType * | eg | ) |
Definition at line 2754 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 2754 of file egnative.cpp
References ElmergridType::advancedmat, ElmergridType::bcoffset, ElmergridType::belems, ElmergridType::boundbounds, ElmergridType::boundorder, ElmergridType::bulkbounds, ElmergridType::bulkmappings, ElmergridType::bulkorder, ElmergridType::center, ElmergridType::clone, ElmergridType::connect, ElmergridType::cylinder, ElmergridType::decimals, ElmergridType::dim, ElmergridType::discont, ElmergridType::elements3d, FALSE, ElmergridType::findsides, ElmergridType::increase, ElmergridType::inmethod, ElmergridType::isoparam, ElmergridType::layereps, ElmergridType::layermove, ElmergridType::layers, MAXSIDEBULK, ElmergridType::merge, ElmergridType::metis, ElmergridType::nodes3d, ElmergridType::nofilesin, ElmergridType::order, ElmergridType::outmethod, ElmergridType::partitionhalo, ElmergridType::partitionindirect, ElmergridType::partitions, ElmergridType::partorder, ElmergridType::pelems, ElmergridType::periodic, ElmergridType::periodicdim, ElmergridType::polar, ElmergridType::reduce, ElmergridType::relh, ElmergridType::removelowdim, ElmergridType::removeunused, ElmergridType::rotate, ElmergridType::saveboundaries, ElmergridType::saveinterval, ElmergridType::scale, ElmergridType::sidebulk, ElmergridType::sidemappings, ElmergridType::silent, ElmergridType::translate, ElmergridType::triangleangle, ElmergridType::triangles, TRUE, ElmergridType::unitemeshes, and ElmergridType::usenames.
Referenced by eg_transfermesh().
int LoadCommands | ( | char * | prefix, |
struct ElmergridType * | eg, | ||
struct GridType * | grid, | ||
int | mode, | ||
const char * | IOmethods[], | ||
int | info | ||
) |
Definition at line 2822 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 2822 of file egnative.cpp
References AddExtension(), ElmergridType::advancedelem, ElmergridType::advancedmat, GridType::autoratio, ElmergridType::belemmap, ElmergridType::belems, ElmergridType::boundbound, ElmergridType::boundbounds, ElmergridType::boundorder, ElmergridType::bulkbound, ElmergridType::bulkbounds, ElmergridType::bulkmap, ElmergridType::bulkmappings, ElmergridType::bulkorder, ElmergridType::center, ElmergridType::clone, ElmergridType::clonesize, ElmergridType::cmerge, ElmergridType::corder, ElmergridType::crotate, ElmergridType::cscale, ElmergridType::ctranslate, ElmergridType::cylinder, ElmergridType::decimals, ElmergridType::dim, GridType::dimension, FALSE, INPUTHEPMC::filename, ElmergridType::filesin, ElmergridType::filesout, GetCommand(), Getline(), in, ElmergridType::increase, ElmergridType::inmethod, ElmergridType::isoparam, ElmergridType::layerbounds, ElmergridType::layereps, ElmergridType::layermove, ElmergridType::layernumber, ElmergridType::layerparents, ElmergridType::layerratios, ElmergridType::layers, ElmergridType::layerthickness, MAXBOUNDARIES, MAXFILESIZE, MAXFORMATS, MAXLINESIZE, MAXMATERIALS, ElmergridType::merge, ElmergridType::metis, next_int(), next_real(), ElmergridType::order, ElmergridType::outmethod, ElmergridType::partcorder, ElmergridType::partdim, ElmergridType::partitionhalo, ElmergridType::partitionindirect, ElmergridType::partitions, ElmergridType::partopt, ElmergridType::partorder, ElmergridType::pelemmap, ElmergridType::pelems, ElmergridType::periodicdim, ElmergridType::polar, ElmergridType::polarradius, printf(), ElmergridType::reduce, ElmergridType::reducemat1, ElmergridType::reducemat2, ElmergridType::removelowdim, ElmergridType::removeunused, ElmergridType::rotate, ElmergridType::saveboundaries, ElmergridType::scale, ElmergridType::sidemap, ElmergridType::sidemappings, ElmergridType::translate, ElmergridType::triangleangle, ElmergridType::triangles, TRUE, ElmergridType::unitemeshes, GridType::z, GridType::zcells, GridType::zdens, GridType::zelems, GridType::zexpand, GridType::zfirstmaterial, GridType::zlastmaterial, and GridType::zmaterial.
Referenced by eg_transfermesh(), and ImportMeshDefinition().
int LoadElmergrid | ( | struct GridType ** | grid, |
int * | nogrids, | ||
char * | prefix, | ||
int | info | ||
) |
Definition at line 2271 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 2271 of file egnative.cpp
References AddExtension(), GridType::boundext, GridType::boundint, GridType::boundsolid, GridType::boundtype, COORD_AXIS, COORD_CART1, COORD_CART2, COORD_CART3, COORD_POLAR, GridType::coordsystem, GridType::curveangle, GridType::curverad, GridType::curvezet, Acts::Test::dim, GridType::dimension, GridType::elemmidpoints, GridType::elemorder, FALSE, INPUTHEPMC::filename, GridType::firstmaterial, GetCommand(), Getline(), in, InitGrid(), k, GridType::lastmaterial, GridType::limitdx, GridType::mappingpoints, GridType::mappings, GridType::mappingtype, matcactive, MAXBOUNDARIES, MAXCASES, MAXCELLS, MAXFILESIZE, MAXLINESIZE, MAXMAPPINGS, MAXMATERIALS, GridType::minxelems, GridType::minyelems, GridType::minzelems, next_int(), next_real(), GridType::noelements, nogrids, GridType::noknots, NUMBER_XY, NUMBER_YX, GridType::polarradius, printf(), GridType::reduceordermatmax, GridType::reduceordermatmin, GridType::rotateblocks, GridType::rotateimprove, GridType::rotateradius2, Rvector, SGN, GridType::structure, GridType::triangleangle, TRUE, GridType::wantedelems, GridType::x, x, GridType::xcells, GridType::xyratio, GridType::xzratio, GridType::y, y, GridType::ycells, GridType::z, z, GridType::zcells, GridType::zfirstmaterial, GridType::zlastmaterial, and GridType::zmaterial.
Referenced by ImportMeshDefinition().
int SaveElmergrid | ( | struct GridType * | grid, |
int | nogrids, | ||
char * | prefix, | ||
int | info | ||
) |
Definition at line 2059 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 2059 of file egnative.cpp
References AddExtension(), GridType::autoratio, GridType::boundext, GridType::boundint, GridType::boundsolid, GridType::boundtype, COORD_AXIS, COORD_CART1, COORD_POLAR, GridType::coordsystem, GridType::curveangle, GridType::curverad, GridType::curvezet, Acts::Test::dim, GridType::dimension, Acts::UnitConstants::e, GridType::elemmidpoints, GridType::elemorder, FALSE, INPUTHEPMC::filename, GridType::firstmaterial, GridType::lastmaterial, GridType::mappinglimits, GridType::mappingline, GridType::mappingparams, GridType::mappingpoints, GridType::mappings, GridType::mappingtype, MAXFILESIZE, GridType::minxelems, GridType::minyelems, GridType::minzelems, GridType::noboundaries, nogrids, NUMBER_XY, NUMBER_YX, GridType::numbering, GridType::polarradius, printf(), GridType::rotate, GridType::rotateblocks, GridType::rotatecurve, GridType::rotateimprove, GridType::rotateradius2, GridType::structure, GridType::triangles, TRUE, GridType::wantedelems, GridType::x, GridType::xcells, GridType::xdens, GridType::xelems, GridType::xexpand, GridType::xyratio, GridType::xzratio, GridType::y, GridType::ycells, GridType::ydens, GridType::yelems, GridType::yexpand, GridType::z, GridType::zcells, GridType::zdens, GridType::zelems, GridType::zexpand, GridType::zfirstmaterial, GridType::zlastmaterial, and GridType::zmaterial.
Referenced by ImportMeshDefinition().
Definition at line 888 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 888 of file egnative.cpp
References BOTLEFT, BOTRIGHT, CellType::boundary, DOWN, GridType::dx, CellType::dx1, GridType::dy, CellType::dy1, CellType::elem1st, CellType::elemwidth, FALSE, LEFT, CellType::left1st, CellType::left2nd, CellType::leftcenter, CellType::leftlast, CellType::levelwidth, CellType::levelwidthcenter, CellType::material, CellType::neighbour, GridType::nocells, GridType::nonodes, CellType::nonodes, GridType::numbered, GridType::numbering, CellType::numbering, printf(), RIGHT, GridType::structure, TOPLEFT, TOPRIGHT, UP, GridType::x, GridType::xcells, CellType::xcorner, CellType::xelem, GridType::xelems, GridType::xexpand, GridType::xlinear, CellType::xlinear, CellType::xratio, GridType::xratios, CellType::xwidth, GridType::y, GridType::ycells, CellType::ycorner, CellType::yelem, GridType::yelems, GridType::yexpand, GridType::ylinear, CellType::ylinear, CellType::yratio, GridType::yratios, and CellType::ywidth.
Referenced by CreateElmerGridMesh().
Definition at line 975 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 975 of file egnative.cpp
References Acts::UnitConstants::degree, CellType::elem1st, CellType::elemwidth, FALSE, CellType::left1st, CellType::left2center, CellType::left2nd, CellType::leftcenter, CellType::leftlast, CellType::levelwidth, CellType::levelwidthcenter, GridType::maxwidth, GridType::noelements, GridType::noknots, GridType::nonodes, NUMBER_XY, NUMBER_YX, GridType::numbered, GridType::numbering, printf(), TRUE, width(), GridType::xcells, GridType::xelems, CellType::xind, GridType::ycells, GridType::yelems, and CellType::yind.
Referenced by CreateElmerGridMesh().
Definition at line 1196 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1196 of file egnative.cpp
References Acts::UnitConstants::degree, CellType::elem1st, CellType::left1st, GridType::maxwidth, GridType::noelements, GridType::noknots, GridType::nonodes, GridType::numbered, printf(), GridType::xcells, GridType::xelems, and CellType::xind.
Referenced by CreateElmerGridMesh().
Definition at line 426 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 426 of file egnative.cpp
References GridType::autoratio, GridType::dimension, dx, dy, FALSE, GridType::firstmaterial, GridType::lastmaterial, GridType::minxelems, GridType::minyelems, GridType::nocells, NUMBER_1D, GridType::numbered, GridType::numbering, printf(), ratio, GridType::structure, GridType::totxelems, GridType::totyelems, TRUE, GridType::wantedelems, GridType::x, GridType::xcells, GridType::xdens, GridType::xelems, GridType::xexpand, GridType::xlinear, GridType::y, GridType::ycells, GridType::ydens, GridType::yelems, GridType::yexpand, and GridType::ylinear.
Referenced by CreateElmerGridMesh().
void SetElementDivisionCylinder | ( | struct GridType * | grid, |
int | info | ||
) |
Definition at line 1854 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1854 of file egnative.cpp
References GridType::dz, dz, GridType::dz0, eps, FM_PI, k, MAX, printf(), ratio, GridType::rotateblocks, GridType::rotatecartesian, GridType::rotateradius1, GridType::rotateradius2, GridType::totzelems, TRUE, GridType::x, GridType::xcells, GridType::xelems, GridType::xexpand, GridType::xlinear, GridType::xratios, GridType::z, GridType::zcells, GridType::zelems, GridType::zexpand, GridType::zlinear, GridType::zmaterial, and GridType::zratios.
Referenced by CreateKnotsExtruded().
void SetElementDivisionExtruded | ( | struct GridType * | grid, |
int | info | ||
) |
Definition at line 1723 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 1723 of file egnative.cpp
References Acts::active, GridType::autoratio, GridType::dx0, GridType::dz, dz, GridType::dz0, FALSE, GridType::minzelems, printf(), ratio, GridType::totzelems, TRUE, GridType::xzratio, GridType::z, GridType::zcells, GridType::zdens, GridType::zelems, GridType::zexpand, GridType::zlinear, and GridType::zratios.
Referenced by CreateKnotsExtruded().
int matcactive |
Definition at line 47 of file egnative.cpp.
View newest version in sPHENIX GitHub at line 47 of file egnative.cpp
Referenced by GetCommand(), Getline(), and LoadElmergrid().