diff --git a/src/meshTools/coordinateSystems/Changes.txt b/src/meshTools/coordinateSystems/Changes.txt deleted file mode 100644 index 3fe3740b7d39d5124777d84f749bf44a82bead35..0000000000000000000000000000000000000000 --- a/src/meshTools/coordinateSystems/Changes.txt +++ /dev/null @@ -1,103 +0,0 @@ -ALL FILES: - * construct null - * allow assignment of name/origin - - * MAJOR CHANGE - - a point is a vector, but not vice versa - - previous methods toGlobal/toLocal include the origin translation - which is incorrect for vectors - - new methods with explicit names: - globalPosition, globalVector, relativePosition, relativeVector - - * change affects: - finiteVolume/fields/fvPatchFields/derivedFvPatchFields/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C - utilities/mesh/generation/blockMesh/curvedEdges/arcEdge.C - ------------------------- - -coordinateRotation.C -coordinateRotation.H - - * coordinateRotation is a tensor with restricted contructors - - * null contructor yields the global coordinate system - - * a null dictionary corresponds to a null constructor - - * new axis/direction constructor with functionality taken from - porousZone and previous coordinateSystem implementation - - * allow any combination (e1/e2), (e2/e3), (e3,e1) of local vectors - in addition to the axis/direction specification. - - Added check for co-linear axes. - - Could possibly eliminate the non-orthogonality check. - - * allow assigment from dictionary, automatically descend in a - 'coordinateRotation' sub-dictionary - - * add hook in New() for type 'coordinateRotation' with alias 'axes' - ------------------------- - -coordinateSystem.C -coordinateSystem.H - - * remove pure virtual restriction - coordinateSystem can be used - directly and has the same properties as a cartesianCS - - * null contructor yields the global coordinate system - - * a null dictionary entry corresponds to the global coordinate system - - * dictionary constructor w/o name uses the typeName - - * the coordinateSystem now has a coordinateRotation, - use coordinateRotation constructors instead of calculating any - rotations ourselves - - * allow assigment from dictionary, automatically descend into a - 'coordinateSystem' sub-dictionary - This simplifies the addition to other dictionary constructors - (eg, porousZone) without requiring a flat structure or special - parsing within the constructor. - eg, - - Foam::porousZone::porousZone(const fvMesh& mesh, Istream& is) - : - mesh_(mesh), - name_(is), - dict_(is), - cellZoneID_(mesh_.cellZones().findZoneID(name_)), - csys_(dict_), - C0_(0), - C1_(0), - D_("D", dimensionSet(0, -2, 0, 0, 0), tensor::zero), - F_("F", dimensionSet(0, -1, 0, 0, 0), tensor::zero) - { - ... - } - - * could consider eliminating Rtr_ member and just use R_.T() instead - - * add hook in New() for type 'coordinateSystem' - ------------------------- - -cartesianCS.C -cartesianCS.H - - * eliminate redundant virtual functions - ------------------------- - -cylindricalCS.H - - * include coordinateSystem.H and not cartesianCS.H - - ------------------------- - -coordinateSystems.C -coordinateSystems.H - - * provide a means to access an invariant set of coordinate systems diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C index 649013fdf10f5fc160099ef9c1d97b569da46d72..a0ff38a9ee968c1195e576e875f7653fb02e03fe 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C @@ -210,25 +210,19 @@ void Foam::coordinateRotation::operator=(const dictionary& rhs) ); vector axis1, axis2; - axisOrder order = e3e1; + axisOrder order(e3e1); - if (dict.found("e1") && dict.found("e2")) + if (dict.readIfPresent("e1", axis1) && dict.readIfPresent("e2", axis2)) { order = e1e2; - dict.lookup("e1") >> axis1; - dict.lookup("e2") >> axis2; } - else if (dict.found("e2") && dict.found("e3")) + else if (dict.readIfPresent("e2", axis1) && dict.readIfPresent("e3", axis2)) { order = e2e3; - dict.lookup("e2") >> axis1; - dict.lookup("e3") >> axis2; } - else if (dict.found("e3") && dict.found("e1")) + else if (dict.readIfPresent("e3", axis1) && dict.readIfPresent("e1", axis2)) { order = e3e1; - dict.lookup("e3") >> axis1; - dict.lookup("e1") >> axis2; } else if (dict.found("axis") || dict.found("direction")) { diff --git a/src/meshTools/coordinateSystems/coordinateSystem.C b/src/meshTools/coordinateSystems/coordinateSystem.C index d2c57bb6669b7faa80bf94d2dfcec280acda037d..a89a507b8e8be677d7cbdc6a3e8ae60c8e304055 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.C +++ b/src/meshTools/coordinateSystems/coordinateSystem.C @@ -267,14 +267,8 @@ void Foam::coordinateSystem::operator=(const dictionary& rhs) ); // unspecified origin is (0 0 0) - if (dict.found("origin")) - { - dict.lookup("origin") >> origin_; - } - else - { - origin_ = vector::zero; - } + origin_ = vector::zero; + dict.readIfPresent("origin", origin_); // specify via coordinateRotation if (dict.found("coordinateRotation")) diff --git a/src/meshTools/coordinateSystems/newCoordinateSystem.C b/src/meshTools/coordinateSystems/newCoordinateSystem.C index 5c2570a6e22955a0a9f79869e4447111ed69140c..c4d416bd78ccb3f52e91e794f888c8332307e14a 100644 --- a/src/meshTools/coordinateSystems/newCoordinateSystem.C +++ b/src/meshTools/coordinateSystems/newCoordinateSystem.C @@ -117,10 +117,7 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New // default type is self word coordType(typeName_()); - if (dict.found("type")) - { - dict.lookup("type") >> coordType; - } + dict.readIfPresent("type", coordType); // can (must) construct base class directly if (coordType == typeName_())