Update Condition notation & domains import in tutorials
This commit is contained in:
26
tutorials/tutorial7/tutorial.ipynb
vendored
26
tutorials/tutorial7/tutorial.ipynb
vendored
@@ -50,7 +50,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"id": "00d1027d-13f2-4619-9ff7-a740568f13ff",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -78,7 +78,7 @@
|
||||
"from pina.equation import Equation, FixedValue\n",
|
||||
"from pina import Condition, Trainer\n",
|
||||
"from pina.solvers import PINN\n",
|
||||
"from pina.geometry import CartesianDomain"
|
||||
"from pina.domain import CartesianDomain"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -155,7 +155,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": null,
|
||||
"id": "8ec0d95d-72c2-40a4-a310-21c3d6fe17d2",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -188,19 +188,19 @@
|
||||
"\n",
|
||||
" # define the conditions for the loss (boundary conditions, equation, data)\n",
|
||||
" conditions = {\n",
|
||||
" 'gamma1': Condition(location=CartesianDomain({'x': [x_min, x_max],\n",
|
||||
" 'bound_cond1': Condition(domain=CartesianDomain({'x': [x_min, x_max],\n",
|
||||
" 'y': y_max}),\n",
|
||||
" equation=FixedValue(0.0, components=['u'])),\n",
|
||||
" 'gamma2': Condition(location=CartesianDomain({'x': [x_min, x_max], 'y': y_min\n",
|
||||
" 'bound_cond2': Condition(domain=CartesianDomain({'x': [x_min, x_max], 'y': y_min\n",
|
||||
" }),\n",
|
||||
" equation=FixedValue(0.0, components=['u'])),\n",
|
||||
" 'gamma3': Condition(location=CartesianDomain({'x': x_max, 'y': [y_min, y_max]\n",
|
||||
" 'bound_cond3': Condition(domain=CartesianDomain({'x': x_max, 'y': [y_min, y_max]\n",
|
||||
" }),\n",
|
||||
" equation=FixedValue(0.0, components=['u'])),\n",
|
||||
" 'gamma4': Condition(location=CartesianDomain({'x': x_min, 'y': [y_min, y_max]\n",
|
||||
" 'bound_cond4': Condition(domain=CartesianDomain({'x': x_min, 'y': [y_min, y_max]\n",
|
||||
" }),\n",
|
||||
" equation=FixedValue(0.0, components=['u'])),\n",
|
||||
" 'D': Condition(location=CartesianDomain({'x': [x_min, x_max], 'y': [y_min, y_max]\n",
|
||||
" 'phys_cond': Condition(domain=CartesianDomain({'x': [x_min, x_max], 'y': [y_min, y_max]\n",
|
||||
" }),\n",
|
||||
" equation=Equation(laplace_equation)),\n",
|
||||
" 'data': Condition(input_points=data_input.extract(['x', 'y']), output_points=data_output)\n",
|
||||
@@ -242,14 +242,14 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"execution_count": null,
|
||||
"id": "e3e0ae40-d8c6-4c08-81e8-85adc60a94e6",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"problem.discretise_domain(20, 'grid', locations=['D'], variables=['x', 'y'])\n",
|
||||
"problem.discretise_domain(1000, 'random', locations=['gamma1', 'gamma2',\n",
|
||||
" 'gamma3', 'gamma4'], variables=['x', 'y'])"
|
||||
"problem.discretise_domain(20, 'grid', locations=['phys_cond'], variables=['x', 'y'])\n",
|
||||
"problem.discretise_domain(1000, 'random', locations=['bound_cond1', 'bound_cond2',\n",
|
||||
" 'bound_cond3', 'bound_cond4'], variables=['x', 'y'])"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -368,7 +368,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.8"
|
||||
"version": "3.12.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in New Issue
Block a user