Changeset 775 for XIOS/trunk/src/transformation/grid_generate.cpp
- Timestamp:
- 11/02/15 11:46:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/transformation/grid_generate.cpp
r687 r775 17 17 : gridSource_(source), gridDestination_(destination), algoTypes_() 18 18 { 19 //Verify the compatibity between two grids 20 int numElement = gridDestination_->axis_domain_order.numElements(); 21 if (numElement != gridSource_->axis_domain_order.numElements()) 22 ERROR("CGridGenerate::CGridGenerate(CGrid* destination, CGrid* source)", 23 << "Two grids have different number of elements" 24 << "Number of elements of grid source " <<gridSource_->getId() << " is " << gridSource_->axis_domain_order.numElements() << std::endl 25 << "Number of elements of grid destination " <<gridDestination_->getId() << " is " << numElement); 26 27 for (int i = 0; i < numElement; ++i) 28 { 29 if (gridDestination_->axis_domain_order(i) != gridSource_->axis_domain_order(i)) 19 if (0 != source) 20 { 21 //Verify the compatibity between two grids 22 int numElement = gridDestination_->axis_domain_order.numElements(); 23 if (numElement != gridSource_->axis_domain_order.numElements()) 30 24 ERROR("CGridGenerate::CGridGenerate(CGrid* destination, CGrid* source)", 31 << "Transformed grid and its grid source have incompatible elements" 32 << "Grid source " <<gridSource_->getId() << std::endl 33 << "Grid destination " <<gridDestination_->getId()); 25 << "Two grids have different number of elements" 26 << "Number of elements of grid source " <<gridSource_->getId() << " is " << gridSource_->axis_domain_order.numElements() << std::endl 27 << "Number of elements of grid destination " <<gridDestination_->getId() << " is " << numElement); 28 29 for (int i = 0; i < numElement; ++i) 30 { 31 if (gridDestination_->axis_domain_order(i) != gridSource_->axis_domain_order(i)) 32 ERROR("CGridGenerate::CGridGenerate(CGrid* destination, CGrid* source)", 33 << "Transformed grid and its grid source have incompatible elements" 34 << "Grid source " <<gridSource_->getId() << std::endl 35 << "Grid destination " <<gridDestination_->getId()); 36 } 34 37 } 35 38 … … 179 182 { 180 183 std::vector<CAxis*> axisListDestP = gridDestination_->getAxis(); 181 std::vector<CAxis*> axisListSrcP = gridSource_->getAxis();182 184 183 185 int axisIndex = elementPosition2AxisPositionInGrid_[elementPositionInGrid]; … … 207 209 { 208 210 std::vector<CDomain*> domainListDestP = gridDestination_->getDomains(); 209 std::vector<CDomain*> domainListSrcP = gridSource_->getDomains(); 211 std::vector<CDomain*> domainListSrcP(domainListDestP.size()); 212 if (0 != gridSource_) domainListSrcP = gridSource_->getDomains(); 210 213 211 214 int domainIndex = elementPosition2DomainPositionInGrid_[elementPositionInGrid]; … … 223 226 { 224 227 genRectDomain = dynamic_cast<CGenerateRectilinearDomain*> (it->second); 225 algo = new CDomainAlgorithmGenerateRectilinear(domainListDestP[domainIndex], domainListSrcP[domainIndex], gridSource_, genRectDomain); 228 algo = new CDomainAlgorithmGenerateRectilinear(domainListDestP[domainIndex], domainListSrcP[domainIndex], 229 gridDestination_, gridSource_, genRectDomain); 226 230 } 227 231 else
Note: See TracChangeset
for help on using the changeset viewer.