GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
MaterialMapFactory.cc
1 #include <string>
2 #include <vector>
3 
4 #include "gear/GEAR.h"
5 #include "gear/geartgeo/MaterialMapFactory.h"
6 
7 namespace gear {
8 
9  MaterialMapFactory::MaterialMapFactory(GearMgr *gearMgr)
10  {
11  _gearMgr=gearMgr;
12  }
13 
14  MaterialMap* MaterialMapFactory:: createMaterialMap(double xmin, double xmax, int nxsteps,
15  double ymin, double ymax, int nysteps,
16  double zmin, double zmax, int nzsteps,
17  int coord)
18  {
19  double gridA[]={xmin,xmax,double(nxsteps),ymin,ymax,double(nysteps),zmin,zmax,double(nzsteps)};
20  std::vector<double> gridV;
21  gridV.assign(gridA,gridA+9);
22 
23  if(_managerMap.find(gridV)==_managerMap.end())
24  _managerMap[gridV]=new MaterialMap(_gearMgr,xmin,xmax,nxsteps,ymin,ymax,nysteps,zmin,zmax,nzsteps,coord);
25 
26  return _managerMap[gridV];
27 
28  }
29 } // namespace gear
Material map using GearDistanceProperties.
Definition: MaterialMap.h:16
MaterialMap * createMaterialMap(double xmin, double xmax, int nxsteps, double ymin, double ymax, int nysteps, double zmin, double zmax, int nzsteps, int coord)
Creating a material map in memory.