Skip to content

Commit

Permalink
Bug fix: The bug prevented the subset handlers to be registered in th…
Browse files Browse the repository at this point in the history
…e domain.
  • Loading branch information
LogashenkoDL committed Sep 12, 2024
1 parent 617b0ff commit 670e01f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
22 changes: 6 additions & 16 deletions ugbase/lib_disc/domain_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,13 @@ void LoadDomain(TDomain& domain, const char* filename, int procId)
//domain.create_additional_subset_handler("markSH");
vector<string> additionalSHNames = domain.additional_subset_handler_names();
SPProjectionHandler ph = make_sp(new ProjectionHandler(domain.geometry3d(), domain.subset_handler()));
vector<SmartPtr<ISubsetHandler> > ash(additionalSHNames.size());

if(additionalSHNames.size()>0){
SmartPtr<ISubsetHandler> sh;
vector<SmartPtr<ISubsetHandler>> ash(additionalSHNames.size());
for(size_t i_name = 0; i_name < additionalSHNames.size(); ++i_name){
SmartPtr<ISubsetHandler> sh = domain.additional_subset_handler(additionalSHNames[i_name]);
ash[i_name]= sh;
}

if(!LoadGridFromFile(*domain.grid(), ph, num_ph, *domain.subset_handler(), additionalSHNames, ash,
filename, domain.position_attachment(), procId))
{
UG_THROW("LoadDomain: Could not load file: "<<filename);
}
}
else if(!LoadGridFromFile(*domain.grid(), *domain.subset_handler(),
filename, domain.position_attachment(), procId))
for(size_t i_name = 0; i_name < additionalSHNames.size(); ++i_name)
ash[i_name] = domain.additional_subset_handler(additionalSHNames[i_name]);

if(!LoadGridFromFile(*domain.grid(), ph, num_ph, *domain.subset_handler(), additionalSHNames, ash,
filename, domain.position_attachment(), procId))
{
UG_THROW("LoadDomain: Could not load file: "<<filename);
}
Expand Down
2 changes: 1 addition & 1 deletion ugbase/lib_grid/file_io/file_io_ugx_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ bool LoadGridFromUGX(Grid& grid, SPProjectionHandler& ph, size_t& num_ph, ISubse
}
}

if(ugxReader.num_projection_handlers(0) > 0){
if((num_ph = ugxReader.num_projection_handlers(0)) != 0){
ugxReader.projection_handler(*ph, 0, 0);
size_t shIndex = ugxReader.get_projection_handler_subset_handler_index(0, 0);
std::string shName2;
Expand Down

0 comments on commit 670e01f

Please sign in to comment.