Dear Libmesher,
ParsedFunction was shown in quite limited examples, such as adjoint_ex5 (but
never called by default there).
Now I called it for applying Dirihclet BC in my codes as follows.
std::string bcfuncstring,bcfunctype;
std::set<boundary_id_type> bid;
boundary_id_type id;
std::vector<unsigned int> var_only(1,0);
FunctionBase<Number> *f=nullptr;
...
id=1; //inlet
bid.clear();
bid.insert(id);
var_only[0]=0;//u
bcfunctype=string("expr");
bcfuncstring=string("y*(1-y)");
f=new_function_base(bcfunctype,bcfuncstring);
dofmap.add_dirichlet_boundary(DirichletBoundary(bid, var_only, f));
The problem is, after I make it and run the executable, there 's always one
assertation failure from parsed_function.h when equation_systems.init () is
called:
Assertion `i < parsers.size()' failed.
i = 1
parsers.size() = 1
Stack frames: 14
0: libMesh::print_trace(std::ostream&)
1: libMesh::MacroFunctions::report_error(char const*, int, char const*, char
const*)
2: libMesh::ParsedFunction<double, libMesh::VectorValue<double>
>::component(unsigned int, libMesh::Point const&, double)
3: /home/zhenyu/deps/libmesh/lib/libmesh_opt.so.0(+0x316022) [0x7fe64fe9b022]
4: /home/zhenyu/deps/libmesh/lib/libmesh_opt.so.0(+0x318aec) [0x7fe64fe9daec]
5: libMesh::DofMap::create_dof_constraints(libMesh::MeshBase const&, double)
6: libMesh::System::init_data()
7: libMesh::ImplicitSystem::init_data()
8: libMesh::TransientSystem<libMesh::NonlinearImplicitSystem>::init_data()
9: libMesh::System::init()
10: libMesh::EquationSystems::init()
11: main
12: __libc_start_main
13: ./icaruslm() [0x449299]
[0] /home/zhenyu/deps/libmesh/include/libmesh/parsed_function.h, line 227,
compiled Mar 29 2015 at 22:56:31
--------------------------------------------------------------------------
Could anyone shed a light for this? Thanks in advance
Zhenyu
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users