Skip to content
Snippets Groups Projects
Commit 1f0bc692 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

BUG: dictionary lookup of embedded coordinateSystem fails (fixes #879)

- also fix incorrect documentation in forces functionObject and
  interRegionExplicitPorositySource fvOption.
parent 854b5cec
No related merge requests found
...@@ -111,8 +111,12 @@ Note ...@@ -111,8 +111,12 @@ Note
coordinateSystem coordinateSystem
{ {
origin (0 0 0); origin (0 0 0);
e3 (0 0 1); coordinateRotation
e1 (1 0 0); {
type axesRotation;
e3 (0 0 1);
e1 (1 0 0);
}
} }
\endverbatim \endverbatim
...@@ -346,11 +350,11 @@ protected: ...@@ -346,11 +350,11 @@ protected:
//- Write binned data //- Write binned data
void writeBins(); void writeBins();
//- Disallow default bitwise copy construct //- No copy construct
forces(const forces&); forces(const forces&) = delete;
//- Disallow default bitwise assignment //- No copy assignment
void operator=(const forces&); void operator=(const forces&) = delete;
public: public:
......
...@@ -43,8 +43,13 @@ Description ...@@ -43,8 +43,13 @@ Description
coordinateSystem coordinateSystem
{ {
e1 (0.70710678 0.70710678 0); origin (0 0 0);
e2 (0 0 1); coordinateRotation
{
type axesRotation;
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
} }
} }
} }
......
...@@ -129,9 +129,21 @@ Foam::coordinateSystem::coordinateSystem ...@@ -129,9 +129,21 @@ Foam::coordinateSystem::coordinateSystem
{ {
const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false); const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false);
// non-dictionary entry is a lookup into global coordinateSystems if (!entryPtr)
if (entryPtr && !entryPtr->isDict())
{ {
// No 'coordinateSystem' entry
init(dict, obr);
}
else if (entryPtr->isDict())
{
// 'coordinateSystem' as dictionary entry - use it
init(entryPtr->dict(), obr);
}
else
{
// 'coordinateSystem' as non-dictionary entry
// - this is a lookup into global coordinateSystems
keyType key(entryPtr->stream()); keyType key(entryPtr->stream());
const coordinateSystems& lst = coordinateSystems::New(obr); const coordinateSystems& lst = coordinateSystems::New(obr);
...@@ -152,15 +164,11 @@ Foam::coordinateSystem::coordinateSystem ...@@ -152,15 +164,11 @@ Foam::coordinateSystem::coordinateSystem
<< exit(FatalError); << exit(FatalError);
} }
// copy coordinateSystem, but assign the name as the typeName // Copy from coordinateSystem, but assign the name as the typeName
// to avoid strange things in writeDict() // to avoid strange things in writeDict()
operator=(lst[index]); operator=(lst[index]);
name_ = typeName_(); name_ = typeName_();
} }
else
{
init(dict, obr);
}
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment