Unexpected behaviour for Parameter assignment

Bug #1071820 reported by Felix Ospald
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
New
Undecided
Unassigned

Bug Description

 Parameters p;
 p.add("prop1", 1);
 p.add("prop2", 2);

 p["prop1"] = p["prop2"] = 88;

 std::cout << p["prop1"].value_str() << " " << p["prop2"].value_str() << std::endl;

gives "1 88".
There is no copy-construcor or assignment operator defined for Parameter class. e.g.

/// Assignment from Parameter
virtual const Parameter& operator= (const Parameter& value);

is missing.

Revision history for this message
Felix Ospald (felix-ospald) wrote :

Stumbled today again over this problem.

solver1->parameters["relative_tolerance"] = solver2->parameters["relative_tolerance"] ;

did not have the desired effect.

solver1->parameters["relative_tolerance"] = (double) solver2->parameters["relative_tolerance"] ;

works.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.