From 4c3ab64cae5d040fa1797944f8c62faaa5ea46b8 Mon Sep 17 00:00:00 2001 From: akva Date: Tue, 9 Apr 2013 12:50:50 +0000 Subject: [PATCH] fixed: neumann boundary condition without a specified value now default to 0.0 git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@2300 e10b68d5-8a6e-419e-a041-bce267b0401d --- src/SIM/SIMbase.C | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SIM/SIMbase.C b/src/SIM/SIMbase.C index 5bf64509..4ccee950 100644 --- a/src/SIM/SIMbase.C +++ b/src/SIM/SIMbase.C @@ -297,12 +297,16 @@ bool SIMbase::parseBCTag (const TiXmlElement* elem) std::cout <<"\tNeumann code "<< code <<" (generic)" << std::endl; this->setPropertyType(code,Property::NEUMANN_GENERIC); } - else if (elem->FirstChild()) { + else { int ndir = 0; + std::string val = "0.0"; + if (elem->FirstChild() && elem->FirstChild()->Value()) + val = elem->FirstChild()->Value(); + utl::getAttribute(elem,"direction",ndir); std::cout <<"\tNeumann code "<< code <<" direction "<< ndir; if (!type.empty()) std::cout <<" ("<< type <<")"; - this->setNeumann(elem->FirstChild()->Value(),type,ndir,code); + this->setNeumann(val.c_str(),type,ndir,code); std::cout << std::endl; } }