added: flag the primary solution vector with type="restart"

this allows ignoring it during the conversion to VTF. i used type
"restart" since this vector will only be of interest when doing
restarted runs

git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@1026 e10b68d5-8a6e-419e-a041-bce267b0401d
This commit is contained in:
akva 2011-06-01 13:36:32 +00:00 committed by Knut Morten Okstad
parent 992208fc38
commit 3e9662bfae
2 changed files with 13 additions and 9 deletions

View File

@ -73,6 +73,7 @@ void XMLWriter::readInfo()
entry.description = elem->Attribute("description");
entry.patches = atoi(elem->Attribute("patches"));
entry.components = atoi(elem->Attribute("components"));
entry.type = elem->Attribute("type");
if (elem->Attribute("basis"))
entry.basis = elem->Attribute("basis");
m_entry.push_back(entry);
@ -118,39 +119,40 @@ void XMLWriter::writeSIM (int level, const DataEntry& entry)
if (prob->mixedFormulation())
{
// primary solution vector
addField(entry.first,entry.second.description,sim->getName()+"-0",
prob->getNoFields(1),sim->getNoPatches());
addField(entry.first,entry.second.description,sim->getName()+"-1",
prob->getNoFields(1),sim->getNoPatches(),"restart");
// Assuming that basis2 is used for secondary variables
// primary solution fields
addField(prob->getField1Name(11),"primary",sim->getName()+"-0",
addField(prob->getField1Name(11),"primary",sim->getName()+"-1",
sim->getNoFields(1),sim->getNoPatches());
addField(prob->getField1Name(12),"primary",sim->getName()+"-1",
addField(prob->getField1Name(12),"primary",sim->getName()+"-2",
sim->getNoFields(2),sim->getNoPatches());
}
else
{
// primary solution
addField(prob->getField1Name(11),entry.second.description,sim->getName()+"-0",
addField(prob->getField1Name(11),entry.second.description,sim->getName()+"-1",
prob->getNoFields(1),sim->getNoPatches());
}
// secondary solution fields
if (entry.second.size == -1)
for (size_t j = 0; j < prob->getNoFields(2); j++)
addField(prob->getField2Name(j),"secondary",sim->getName()+"-1",1,sim->getNoPatches());
addField(prob->getField2Name(j),"secondary",sim->getName()+(prob->mixedFormulation()?"-2":"-1"),1,sim->getNoPatches());
}
void XMLWriter::addField (const std::string& name,
const std::string& description,
const std::string& basis,
int components, int patches)
int components, int patches,
const std::string& type)
{
TiXmlElement element("entry");
element.SetAttribute("name",name.c_str());
element.SetAttribute("description",description.c_str());
element.SetAttribute("type","field");
element.SetAttribute("type",type);
if (!basis.empty())
element.SetAttribute("basis",basis.c_str());
element.SetAttribute("patches",patches);

View File

@ -17,6 +17,7 @@ public:
std::string basis;
int patches;
int components;
std::string type;
};
XMLWriter(const std::string& name);
@ -37,7 +38,8 @@ public:
protected:
void addField(const std::string& name, const std::string& description,
const std::string& geometry, int components, int patches);
const std::string& geometry, int components, int patches,
const std::string& type="field");
std::vector<Entry> m_entry;