Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create test_cfpdes.py #225

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/user/modules/python/examples/python/test_cfpdes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import feelpp
from feelpp.toolboxes.core import *
from feelpp.toolboxes.cfpdes import *

app = feelpp.Environment(["myapp"], opts= toolboxes_options("coefficient-form-pdes", "cfpdes"),config=feelpp.localRepository(""))

case=feelpp.download( "github:{repo:feelpp,path:toolboxes/coefficientformpdes/cases/heat/ThermalBridgesENISO10211/", worldComm=app.worldCommPtr() )[0]
casedfile=case+'/thermo2dCase2.cfg'
feelpp.Environment.setConfigFile(casefile)
f = cfpdes(dim=2)
if not f.isStationary():
f.setTimeFinal(10*f.timeStep())
[ok,meas]=simulate(f)
f.checkResults()

if ok: # <1>
meas = f.postProcessMeasures().values()

try:
import pandas as pd
df=pd.DataFrame([meas])
print(df)
except ImportError:
print("cannot import pandas, no problem it was just a test")
else:
print("error during simulation, cannot proceed with data analysis")