39 const Real initial_value = 4.984;
40 const std::string initial_name =
"p1";
49 SECTION(
"parameter can return a constant reference to its name")
51 const std::string& name = parameter1.
name();
52 CHECK( name == initial_name );
55 SECTION(
"parameter can return a copy of its name")
57 std::string name = parameter1.
name();
58 CHECK( name == initial_name );
59 name +=
"_added_string";
60 CHECK( name != initial_name );
61 CHECK ( parameter1.
name() == initial_name );
64 SECTION(
"parameter can return a constant reference to its value")
66 const Real const_param_value = parameter1();
67 CHECK( const_param_value == initial_value );
70 SECTION(
"parameter can return a writable reference to its value")
72 Real& parameter_value = parameter1();
73 CHECK( parameter_value == initial_value );
76 SECTION(
"parameter value can be changed through writable reference to its value")
78 Real& parameter_value = parameter1();
79 parameter_value = 2.4578;
80 CHECK( parameter1() == 2.4578 );
83 SECTION(
"parameter value can be set through assignment oeprator '='")
86 CHECK( parameter1() == 5.678 );
89 SECTION(
"parameter can return a pointer to its value")
91 Real* val_ptr = parameter1.
ptr();
92 CHECK( *val_ptr == initial_value );
95 SECTION(
"parameter depends on itself")
97 const bool depends_on_itself = parameter1.
depends_on(parameter1);
98 CHECK( depends_on_itself );
101 SECTION(
"parameter does not depend on other field functions")
104 const bool depends_on_other = parameter1.
depends_on(parameter2);
105 CHECK_FALSE( depends_on_other );
108 SECTION(
"parameter is NOT a shape parameter by default")
113 SECTION(
"parameter can be set as a shape parameter")
119 SECTION(
"parameter is NOT a topology parameter by default")
124 SECTION(
"parameter can be set as a topology parameter")
virtual bool is_shape_parameter() const
const std::string & name() const
returns the name of this function
virtual void set_as_topology_parameter(bool f)
This is a scalar function whose value can be changed and one that can be used as a design variable in...
TEST_CASE("parameters", "[parameter],[base]")
MAST::Parameter objects are independent of libMesh and thus we do not need to initialize any libMesh ...
virtual bool is_topology_parameter() const
virtual bool depends_on(const MAST::FunctionBase &f) const
virtual void set_as_shape_parameter(bool f)