Hi Alls,
this initial condition problem still stumps me. I have modified the
exact_solution and exact_value many times, but still can't pass the compiler
or can't assign dependent values to two variables. The following error
massage happened all the time when I set the
unknown_name = "n2" in exact_value function, this should be a right
expression for basic_string class, but can't pass the compiling.. any one
can help? I will be very grateful... Thanks!
Liang
/*******************************************************************
****************************error**********************************
*******************************************************************/
compiling C++ (in debug mode) lc2d_v4.C...
lc2d_v4.C: In function ‘Number exact_value(const Point&, const Parameters&,
const std::string&, const std::string&)’:
lc2d_v4.C:265: error: no match for ‘operator=’ in ‘unknown_name = "n2"’
/usr/include/c++/4.4/bits/basic_string.h:505: note: candidates are:
std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT,
_Traits, _Alloc>::operator=(const std::basic_string<_CharT, _Traits,
_Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc =
std::allocator<char>] <near match>
/usr/include/c++/4.4/bits/basic_string.h:513: note:
std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT,
_Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>] <near match>
/usr/include/c++/4.4/bits/basic_string.h:524: note:
std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT,
_Traits, _Alloc>::operator=(_CharT) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>] <near match>
/*******************************************************************
****************************code**********************************
*******************************************************************/
void init_lc (EquationSystems& es,
const std::string& system_name)
{
libmesh_assert (system_name == "hw8-2d");
TransientLinearImplicitSystem & system =
es.get_system<TransientLinearImplicitSystem>("hw8-2d");
es.parameters.set<Real> ("time") = 0;
system.project_solution(exact_value, NULL, es.parameters);
}
Number exact_value (const Point& p,
const Parameters& parameters,
const std::string&,
const std::string& unknown_name) // fptr
{
unknown_name =
"n2"; //can't
pass the compiling!!!!!!!
return exact_solution(p(0), p(1), parameters.get<Real> ("time")
,unknown_name);
}
Real exact_solution (const Real x,
const Real y,
const Real t,
const std::string& unknown_name)
{
if(unknown_name == "n2")
return 222.222;
else if (unknown_name == "n1")
return 111.111;
}
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users