Skip to content
Snippets Groups Projects
Commit 66331b04 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Plugged boundary condition handler

parent 111ad07b
No related branches found
No related tags found
No related merge requests found
......@@ -343,6 +343,17 @@ int main(int argc, char *argv[])
break;
}
case 3: {
std::vector<std::string> sym_boundary_name_list = {"XMIN", "XMAX", "YMIN", "YMAX", "ZMIN", "ZMAX"};
std::vector<std::shared_ptr<BoundaryConditionDescriptor>> bc_descriptor_list;
for (const auto& sym_boundary_name : sym_boundary_name_list){
std::shared_ptr<BoundaryDescriptor> boudary_descriptor
= std::shared_ptr<BoundaryDescriptor>(new NamedBoundaryDescriptor(sym_boundary_name));
SymmetryBoundaryConditionDescriptor* sym_bc_descriptor
= new SymmetryBoundaryConditionDescriptor(boudary_descriptor);
bc_descriptor_list.push_back(std::shared_ptr<BoundaryConditionDescriptor>(sym_bc_descriptor));
}
typedef Connectivity3D ConnectivityType;
typedef Mesh<ConnectivityType> MeshType;
typedef MeshData<MeshType> MeshDataType;
......@@ -355,6 +366,32 @@ int main(int argc, char *argv[])
MeshDataType mesh_data(mesh);
std::vector<BoundaryConditionHandler> bc_list;
{
for (const auto& bc_descriptor : bc_descriptor_list) {
switch (bc_descriptor->type()) {
case BoundaryConditionDescriptor::Type::symmetry: {
const SymmetryBoundaryConditionDescriptor& sym_bc_descriptor
= dynamic_cast<const SymmetryBoundaryConditionDescriptor&>(*bc_descriptor);
for (size_t i_ref_face_list=0; i_ref_face_list<mesh.connectivity().numberOfRefFaceList();
++i_ref_face_list) {
const RefFaceList& ref_face_list = mesh.connectivity().refFaceList(i_ref_face_list);
const RefId& ref = ref_face_list.refId();
if (ref == sym_bc_descriptor.boundaryDescriptor()) {
SymmetryBoundaryCondition<MeshType::dimension>* sym_bc
= new SymmetryBoundaryCondition<MeshType::dimension>(MeshFlatNodeBoundary<MeshType::dimension>(mesh, ref_face_list));
std::shared_ptr<SymmetryBoundaryCondition<MeshType::dimension>> bc(sym_bc);
bc_list.push_back(BoundaryConditionHandler(bc));
}
}
break;
}
default: {
std::cerr << "Unknown BCDescription\n";
std::exit(1);
}
}
}
}
UnknownsType unknowns(mesh_data);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment