Skip to content
Snippets Groups Projects
Commit 1d2fee32 authored by Boris Martin's avatar Boris Martin
Browse files

minor refactoring

parent 5f6b138b
Branches
Tags
2 merge requests!10Draft: Source estimation,!9Introducing unique_ptrs to simplify memory management
...@@ -55,6 +55,18 @@ static unsigned int getNumberOfGroups(const GmshFem &gmshFem) ...@@ -55,6 +55,18 @@ static unsigned int getNumberOfGroups(const GmshFem &gmshFem)
return n_group; return n_group;
} }
static std::string getIntegrationType(const GmshFem &gmshFem, std::string suffix_g)
{
std::string integrationType;
if (!(
gmshFem.userDefinedParameter(integrationType, "integration_type") ||
gmshFem.userDefinedParameter(integrationType, "integration_type" + suffix_g)))
{
throw Exception("Integration type could not be found.");
}
return integrationType;
}
template <Physic T_Physic> template <Physic T_Physic>
int inversion(const GmshFem& gmshFem) int inversion(const GmshFem& gmshFem)
{ {
...@@ -131,15 +143,7 @@ int inversion(const GmshFem& gmshFem) ...@@ -131,15 +143,7 @@ int inversion(const GmshFem& gmshFem)
} }
} }
std::string integrationType; std::string integrationType = getIntegrationType(gmshFem, suffix_g);
if(!(
gmshFem.userDefinedParameter(integrationType, "integration_type")
||
gmshFem.userDefinedParameter(integrationType, "integration_type"+suffix_g)
))
{
throw Exception("Integration type could not be found.");
}
model::Discretization m_discret(gmshFem,suffix_g); model::Discretization m_discret(gmshFem,suffix_g);
if(g==0) if(g==0)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment