Attaching mesh value collections to mesh domains fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I'm trying to read in an xml file containing facet ids and attach it to the mesh domains class beneath a mesh. However this currently fails. The example main.cpp (compile with a demo CMakeLists.txt) below illustrates this problem (in a slightly contrived way - without requiring an extra xml file).
Several suggestions have been made to fix this in question 174556 ( https:/
const MeshValueCollec
The implementation is essentially the same as the existing constructor. Am happy to propose a merge of this if this is the preferred solution.
Many thanks,
Cian
main.cpp:
-------
#include <dolfin.h>
class Side : public dolfin::SubDomain
{
public:
Side(const double &side) : side_(side)
{
}
bool inside(const dolfin:
{
return (std::fabs(x[0] - side_) < DOLFIN_EPS && on_boundary);
}
private:
double side_;
};
int main()
{
dolfin:
Side left(0.0);
Side right(1.0);
dolfin:
left.
right.
std::cout << "edgeids:" << std::endl;
std::cout << edgeids.str(true) << std::endl;
boost:
edgecoll( new dolfin:
std::cout << "edgecoll:" << std::endl;
std::cout << edgecoll-
std::cout << "makers(0) before assignment:" << std::endl;
std::cout << mesh.domains(
mesh.
std::cout << "makers(0) after assignment:" << std::endl;
std::cout << mesh.domains(
if(!mesh.
dolfin:
else
std::cout << "facet_domains found." << std::endl;
return 0;
}
-------
Related branches
- Garth Wells: Approve
-
Diff: 759 lines (+517/-41)9 files modified.bzrignore (+1/-0)
ChangeLog (+3/-1)
dolfin/mesh/MeshValueCollection.h (+98/-1)
dolfin/swig/docstrings.i (+65/-7)
dolfin/swig/mesh_post.i (+52/-30)
dolfin/swig/mesh_pre.i (+1/-0)
test/unit/mesh/cpp/test.cpp (+162/-1)
test/unit/mesh/python/MeshValueCollection.py (+134/-0)
test/unit/test.py (+1/-1)
- Registry Administrators: Pending requested
-
Diff: 382 lines (+190/-128)3 files modifieddolfin/common/defines.cpp (+170/-0)
dolfin/common/defines.h (+16/-124)
site-packages/dolfin_utils/meshconvert.py (+4/-4)
Changed in dolfin: | |
status: | New → Fix Committed |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |
Also see: /blueprints. launchpad. net/dolfin/ +spec/extend- meshvaluecollec tion
https:/