def test_plot_local_solution_unconformity(): from pygeoiga.nurb.cad import make_unconformity_model from pygeoiga.nurb.nrb_to_gmsh import convert_geometry_mp_to_gmsh geometry = make_unconformity_model(refine=False) mesh, script, physical_tag_id = convert_geometry_mp_to_gmsh( geometry, size=50, save_geo=datapath + "unconformity_model.geo", save_msh=datapath + "unconformity_model.msh") from pygeoiga.FE_solvers.run_fenics import convert_msh_to_xdmf, run_simulation input = datapath + "unconformity_model.msh" convert_msh_to_xdmf(input) nodal_coordinates, temperature_nodes = run_simulation( input, topology_info=physical_tag_id, top_bc=10, bot_bc=40, geometry=geometry, show=False) from pygeoiga.plot.solution_mpl import p_temperature fig, ax = plt.subplots() ax.set_aspect("equal") ax = p_temperature(nodal_coordinates[:, 0], nodal_coordinates[:, 1], temperature_nodes, vmin=temperature_nodes.min(), vmax=temperature_nodes.max(), ax=ax, point=True, fill=False) fig.show()
def test_mesh_mp_unconformity(): from pygeoiga.nurb.cad import make_unconformity_model geometry = make_unconformity_model() mesh, script, physical_tag_id = convert_geometry_mp_to_gmsh( geometry, size=10, save_geo=data_path + "unconformity_model.geo", save_msh=data_path + "unconformity_model.msh") print(script, physical_tag_id) plot_mesh(mesh)
def test_create_script_unconformity(): from pygeoiga.nurb.cad import make_unconformity_model from pygeoiga.nurb.nrb_to_gmsh import convert_geometry_mp_to_gmsh geometry = make_unconformity_model(refine=False) mesh, script, physical_tag_id = convert_geometry_mp_to_gmsh( geometry, size=50, save_geo=datapath + "unconformity_model.geo", save_msh=datapath + "unconformity_model.msh") from pygeoiga.FE_solvers.run_moose import create_script input = datapath + "unconformity_model.msh" create_script(input, topology_info=physical_tag_id, top_bc=10, bot_bc=40, geometry=geometry)
def test_run_workflow_unconformity(): #carefull: Is too short the corner so it cannot be plotted from pygeoiga.nurb.cad import make_unconformity_model from pygeoiga.nurb.nrb_to_gmsh import convert_geometry_mp_to_gmsh geometry = make_unconformity_model(refine=False) mesh, script, physical_tag_id = convert_geometry_mp_to_gmsh( geometry, size=50, save_geo=datapath + "unconformity_model.geo", save_msh=datapath + "unconformity_model.msh") from pygeoiga.FE_solvers.run_fenics import convert_msh_to_xdmf, run_simulation input = datapath + "unconformity_model.msh" convert_msh_to_xdmf(input) nodal_coordinates, temperature_nodes = run_simulation( input, topology_info=physical_tag_id, top_bc=10, bot_bc=40, geometry=geometry)
def test_solve_unconformity(): geometry = make_unconformity_model(refine=True) geometry, gDoF = patch_topology(geometry) K_glob = np.zeros((gDoF, gDoF)) K_glob = form_k_IGA_mp(geometry, K_glob) D = np.zeros(gDoF) b = np.zeros(gDoF) T_t = 10 # [°C] T_b = 40 # [°C] T_l = None T_r = None bc, D = boundary_condition_mp(geometry, D, T_t, T_b, T_l, T_r) bc["gDOF"] = gDoF D, b = solve(bc, K_glob, b, D) plt.spy(K_glob) plt.show() print(D)