<jupyter_start><jupyter_text>Example 12The use case from the user manual. The example does not contain anything that is not covered in the previous examples.<jupyter_code>import calfem.core as cfc
import calfem.vis_mpl as cfv
import calfem.utils as cfu
import calfem.shapes as cfs
import calfem.solver as cfslv

import numpy as np
%matplotlib notebook<jupyter_output><empty_output><jupyter_text>General problem variables<jupyter_code>rect = cfs.Rectangle(5.0, 1.0, element_type=2, dofs_per_node=1, max_area=0.08)

rect.t = 1
rect.ep = [rect.t, 1]

rect.D = np.diag([1.7, 1.7])<jupyter_output><empty_output><jupyter_text>Create mesh<jupyter_code>mesh = cfs.ShapeMesh(rect)<jupyter_output><empty_output><jupyter_text>Solve problem<jupyter_code>solver = cfslv.Flow2DSolver(mesh)

solver.addBC(rect.left_id, 0.0)
solver.addBC(rect.right_id, 120.0)
#solver.addForceTotal(rect.topId, -10e5, dimension=2)

results = solver.execute()<jupyter_output><empty_output><jupyter_text>Visualise results  Geometry<jupyter_code>cfv.figure() 
cfv.draw_geometry(rect.geometry(), title="Geometry")<jupyter_output><empty_output><jupyter_text>Mesh<jupyter_code>cfv.figure() 
cfv.draw_mesh(mesh.coords, mesh.edof, rect.dofs_per_node, rect.element_type, 
             filled=True, title="Mesh") #Draws the mesh.<jupyter_output><empty_output><jupyter_text>Nodal values<jupyter_code>cfv.figure() 
cfv.draw_nodal_values_shaded(results.a, mesh.coords, mesh.edof)
plt.colorbar()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12110960757780785, 'fraction_numerical': 0.018944519621109608, 'mean_word_length': 7.7514792899408285, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '655575', 'license': 'MIT', 'n_tokens_mistral': 605, 'n_tokens_neox': 579, 'n_words': 93, 'path': 'examples/experimental/exm12.ipynb', 'repo_name': 'CALFEM/calfem-py', 'size': '1478'}