Skip to content
Snippets Groups Projects
Commit e68fe0a6 authored by Laura Lindner's avatar Laura Lindner
Browse files

update

parent 37208ad1
No related branches found
No related tags found
1 merge request!261Resolve "Fix evaluation on cells"
Pipeline #136188 passed
Subproject commit 37c2aba31c73fc3f239a9a5a40b43d553f4d8e00
Subproject commit 20c09dfd1f52ee0593c136ced501b1d54c78d524
......@@ -8,6 +8,9 @@
#include "CardiacInterpolation.hpp"
#include "MCellModel.hpp"
#include <fstream>
#include <iostream>
IElphyAssemble::IElphyAssemble(ElphyProblem &elphyProblem, int degree, int exactUpTo)
: INonLinearTimeAssemble(), ICardiacAssemble("ElphyVTK"), problem(elphyProblem), degree(degree),
disc(elphyProblem.GetMeshes(), degree, exactUpTo < 0 ? 2 * degree : exactUpTo, DomainPart, 1),
......@@ -159,12 +162,40 @@ void IElphyAssemble::PlotExcitation() const {
void IElphyAssemble::PlotActivation() const {
if (problem.UpdateActivationTime == false) return;
//writeActivationTimeFile();
auto &plot = mpp::plot("ActivationTime");
plot.AddData("Activation", *activationTime);
plot.PlotFile("ActivationTime");
}
void IElphyAssemble::writeActivationTimeFile() const {
string filename("data/AT.txt");
std::fstream file_out;
ExchangeBuffer B;
for (row r= (*activationTime).rows(); r != (*activationTime).rows_end(); ++r) {
if((*activationTime).find_procset(r()) == (*activationTime).procsets_end() || (*activationTime).find_procset(r()).master() == PPM->Proc()) {
//if((*activationTime).find_procset(r()).master()==PPM->Proc()) {
B.Send(0) << r() << (*activationTime)(r(), 0);
}
}
B.Communicate();
if (PPM->Master()) {
file_out.open(filename, std::ios_base::out);
if (!file_out.is_open()) {
std::cout << "failed to open " << filename << '\n';
} else {
for (int i = 0; i < PPM->Size(); i++) {
for (row r = (*activationTime).rows(); r != (*activationTime).rows_end(); ++r) {
Point p;
double actiTime;
B.Receive(i) >> p >> actiTime ;
file_out << p << " " <<actiTime << endl;
}
}
}
}
}
void IElphyAssemble::PrintActivationTime() const {
auto &AT = *activationTime;
if (problem.UpdateActivationTime) {
......
......@@ -119,6 +119,8 @@ public:
void PlotActivation() const;
void writeActivationTimeFile() const;
void PlotPotential(Vector &V, const std::string &varname, int step) const;
Vector &ActivationTime() const;
......
......@@ -5,7 +5,7 @@ import shutil
import mpp.python.mppy as mppy
lList = [0,1,2,3]
lList = [3]
lList = [0]
tList = [0,1,2,3]
#start_dt=0.0001
start_dt=0.0004
......@@ -14,7 +14,7 @@ path='../../../data/biventricleTT/'
pathToMakeFolders=path #'../'+path
def moveActivationtime(l,j, expPath):
shutil.move('../../build/data/vtu/ActivationTime.pvtu', pathToMakeFolders+expPath+'AT_l'+str(l)+'j'+str(j)+'.vtu')
shutil.move('../../build/data/vtu/ActivationTime.vtu', pathToMakeFolders+expPath+'AT_l'+str(l)+'j'+str(j)+'.vtu')
......@@ -45,7 +45,7 @@ if __name__=="__main__":
#startExperiment(procs,startconf,pathExperiment,{"ElphyModelName": "TenTusscher"})
pathExperiment="OnCells/SI0004/"
startExperiment(procs,startconf,pathExperiment,{"ElphyModelName": "TenTusscher","ElphyModel":"SemiImplicitOnCells"})
startExperiment(procs,startconf,pathExperiment,{"ElphyModelName": "TenTusscher","ElphyModel":"SemiImplicitOnCells","ParallelPlotting":0,"Compression":"ascii"})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment