Skip to content

Commit ddda644

Browse files
author
Teseo Schneider
committed
Added documentation
1 parent b4437d9 commit ddda644

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

polyfempy/Settings.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
class Settings:
5+
"""Class that encodes the settings of the solver, it nodels the input json file"""
56
def __init__(self):
67
self.discr_order = 1
78
self.pressure_discr_order = 1
@@ -34,35 +35,43 @@ def __init__(self):
3435

3536

3637
def set_problem(self, problem):
38+
"""Sets the problem, use any of the problems in Problems"""
3739
self.problem = problem.name()
3840
self.problem_params = problem.params()
3941

4042

4143
def set_material_params(self, name, value):
44+
"""set the material parameters, for instance set_material_params("E", 200) sets the Young's modulus E to 200"""
4245
self.params[name] = value
4346

4447

4548
def set_vtu_export_path(self, path, bounda_only=False):
49+
"""Sets the path to export a vtu file with the results, use bounda_only to export only one layer of the mesh in 3d"""
4650
self.export["vis_mesh"] = path
4751
self.export["vis_boundary_only"] = bounda_only
4852

4953

5054
def set_wireframe_export_path(self, path):
55+
"""Sets the path to export a wireframe of the mesh"""
5156
self.export["wire_mesh"] = path
5257

5358

5459
def set_isolines_export_path(self, path):
60+
"""Sets the path to export the isolines of the solution"""
5561
self.export["iso_mesh"] = path
5662

5763

5864
def set_solution_export_path(self, path):
65+
"""Sets the path to save the solution"""
5966
self.export["solution"] = path
6067

6168

6269
def set_advanced_option(self, key, value):
70+
"""Used to set any advanced option not present in this class, for instance set_advanced_option("use_spline",True), see https://polyfem.github.io/documentation/ for full list"""
6371
self.advanced_options[key] = value
6472

6573
def __str__(self):
74+
"""stringygied json description of this class, used to run the solver"""
6675
tmp = dict(
6776
(key, value)
6877
for (key, value) in self.__dict__.items())
@@ -72,4 +81,5 @@ def __str__(self):
7281
return json.dumps(tmp, sort_keys=True, indent=4)
7382

7483
def serialize(self):
84+
"""stringygied json description of this class, used to run the solver"""
7585
return str(self)

0 commit comments

Comments
 (0)