mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-07-08 03:07:03 +00:00
modifications for version (1.0)
This commit is contained in:
@ -64,15 +64,17 @@ bool pFlow::property::makeNameIndex()
|
||||
{
|
||||
nameIndex_.clear();
|
||||
|
||||
|
||||
uint32 i=0;
|
||||
for(auto const& nm:materials_)
|
||||
{
|
||||
if(!nameIndex_.insertIf(nm, i++))
|
||||
if(!nameIndex_.insertIf(nm, i))
|
||||
{
|
||||
fatalErrorInFunction<<
|
||||
" repeated material name in the list of materials: " << materials_;
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
nameIndex_.rehash(0);
|
||||
numMaterials_ = static_cast<uint32>(materials_.size());
|
||||
@ -149,3 +151,33 @@ pFlow::property::property
|
||||
|
||||
}
|
||||
|
||||
pFlow::property::property
|
||||
(
|
||||
const word &fileName,
|
||||
const fileSystem &dir
|
||||
)
|
||||
:
|
||||
fileDictionary
|
||||
(
|
||||
objectFile
|
||||
(
|
||||
fileName,
|
||||
dir,
|
||||
objectFile::READ_ALWAYS,
|
||||
objectFile::WRITE_NEVER
|
||||
),
|
||||
nullptr
|
||||
)
|
||||
{
|
||||
if(!readDictionary())
|
||||
{
|
||||
fatalExit;
|
||||
}
|
||||
|
||||
if(!makeNameIndex())
|
||||
{
|
||||
fatalErrorInFunction<<
|
||||
"error in dictionary "<< globalName()<<endl;
|
||||
fatalExit;
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ Licence:
|
||||
namespace pFlow
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* property holds the pure properties of materials.
|
||||
*
|
||||
@ -52,6 +51,7 @@ private:
|
||||
/// rapid mapping from name to index
|
||||
wordHashMap<uint32> nameIndex_;
|
||||
|
||||
|
||||
/// number of materials
|
||||
uint32 numMaterials_ = 0;
|
||||
|
||||
@ -78,6 +78,11 @@ public:
|
||||
property(
|
||||
const word& fileName,
|
||||
repository* owner=nullptr);
|
||||
|
||||
property(
|
||||
const word& fileName,
|
||||
const fileSystem& dir
|
||||
);
|
||||
|
||||
property(const word& fileName,
|
||||
const wordVector& materials,
|
||||
@ -177,6 +182,8 @@ public:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user