Does MoFEM has the ability to solve an equation only on the subdomain like LibMesh?

24 views
Skip to first unread message

Stone Joe

unread,
Dec 22, 2017, 7:28:14 AM12/22/17
to mofem Group
Hello everyone!  I am a newbie of MoFEM. Now, I am doing some work about simulation of thermomechanics in metal additive manufacturing process, see Fig 1. The material will be added layer by layer.I want to use the adaptive mesh, so I refine the whole domain at first. However, the computational domain  is only the subdomain under current layer, see Fig 2. 

So, I want to know if the MoFEM have the ability to solve an equation only on the subdomain like LibMesh. And I need apply some boundary condition(like heat radiation,heat convection) on the top of subdomain. Or does MoFEM has something like FE_Nothing (which defines a finite element with zero degrees of freedom ) in deal.II ? Thank you.

Lukasz Kaczmraczyk

unread,
Dec 22, 2017, 7:54:13 AM12/22/17
to mofem...@googlegroups.com
Hello,


MoFEM does not have FE_Nothing; you can define problem on sub-domain, i.e. meshset. You can have a field, for example, a mechanical or temperature field defined on full or part of mesh but define problem only in part of the mesh, in your case layer. The same goes with elements, for example, the finite element can be defined on the part of the mesh, but you can construct problem, matrices only on the part of it. You can have surface elements to apply boundary natural conditions etc, on subdomains of lower dimensions as well.

In general, you can add entities/domain to the filed or finite elements on the way, but solve the problem only on some part of the mesh. MoFEM using the concept of BitRefLevels to define the computational domain.

Let us know if that helps, we can help you with that. 

Kind regards,
Lukasz

For example you can do as follows

// Create field in H1 space
CHKERR mField
.add_field("TEMPERATURE",H1,AINSWORTH_LEGENDRE_BASE,1);
// Add entities to the field on which field is spanning
CHEERR mField
.add_ents_to_field_by_type(layer1_set,MBTET,"TEMPERATURE");
// Set approximation order
CHKERR mField
.set_field_order(layer1_set,MBTET,"TEMPERATURE",order);

// Create element and add entities to it
CHKERR mField
.add_finite_element("TEMP_FE",MF_ZERO);
CHKERR mField
.modify_finite_element_add_field_row("TEMP_FE","TEMPERATURE");
CHKERR mField
.modify_finite_element_add_field_col("TEMP_FE","TEMPERATURE");
CHKERR mField
.modify_finite_element_add_field_data("TEMP_FE","TEMPERATURE");
CHKERR mField
.add_ents_to_finite_element_by_TETs(layer1_set,"TEMP_FE");


// Define bit_ref_level for layer 1
BitRefLevel bit_level_layer1;
bit_level_layer1
.set(1);
CHKERR mField
.getInterface<BitRefManager>()->setBitRefLevelByType (layer1_set, MBTET, bit_level_layer1);


// Create problem for layer 1
CHKERR mField
.add_problem("PROB_LAYER1",MF_ZERO); CHKERRG(ierr);
CHKERR mField
.modify_problem_add_finite_element("PROB_LAYER1","TEMP_FE");
CHHERR mField
.modify_problem_ref_level_set_bit("PROB_LAYER1",bit_level_layer1);


// Create meshset for layer, f.e. layer2_set
// Create elements and add them to meshset for layer 2

// Add another layer
CHEERR mField
.add_ents_to_field_by_type(layer2_set,MBTET,"TEMPERATURE");
CHKERR mField
.set_field_order(layer2_set,MBTET,"TEMPERATURE",order);
CHKERR mField.add_ents_to_finite_element_by_TETs(layer2_set,"TEMP_FE");


// Define bit_ref_level for layer 2
BitRefLevel bit_level_layer1;
bit_level_layer2
.set(2);
CHKERR mField
.getInterface<BitRefManager>()->setBitRefLevelByType(layer2_set, MBTET, bit_level_layer2);


CHKERR mField
.add_problem("PROB_LAYER2",MF_ZERO); CHKERRG(ierr);
CHKERR mField
.modify_problem_add_finite_element("PROB_LAYER2","TEMP_FE");
CHHERR mField
.modify_problem_ref_level_set_bit("PROB_LAYER2",bit_level_layer2);
Reply all
Reply to author
Forward
0 new messages