View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003727 | OpenFOAM | Bug | public | 2021-09-14 08:17 | 2021-09-14 09:29 |
Reporter | tniemi | Assigned To | henry | ||
Priority | low | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | dev | ||||
Summary | 0003727: meshtools/coordinateSystem: Missing copy constructor preventing reuse of coordinateSystems | ||||
Description | I tried to use the constant/coordinateSystem-file to specify a single, simple coordinate system which was used in multiple porous regions. However, I noticed that this only worked for the first porous region and when the second one is created one gets --> FOAM FATAL ERROR: object of type N4Foam18coordinateRotationE is not allocated I traced the issue to coordinateSystem-class, which has R_ as autoPtr but does not have a custom copy constructor. Thus when calling the clone-function, the default copy constructor is used which transfers the ownership of R_ and clears the original pointer. The next clone will produce a coordinateSystem with null R_. Adding coordinateSystem(const coordinateSystem &obj) : name_(obj.name_), origin_(obj.origin_), R_(obj.R_->clone()) {} seemed to solve the issue. | ||||
Steps To Reproduce | With tutorials/incompressible/pisoFoam/laminar/porousBlockage try to define another porosity source which uses "coordinateSystem porousBlockage;" leads to --> FOAM FATAL ERROR: object of type N4Foam18coordinateRotationE is not allocated | ||||
Tags | No tags attached. | ||||