@@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
25
25
#include " hemocell.h"
26
26
#include " palabos3D.h"
27
27
#include " palabos3D.hh"
28
+ #include " preInlet.h"
28
29
29
30
namespace hemo {
30
31
bindingFieldHelper::bindingFieldHelper (HemoCellFields * cellFields_) : cellFields(*cellFields_) {
@@ -36,26 +37,26 @@ namespace hemo {
36
37
37
38
// Create bindingfield with same properties as fluid field underlying the particleField.
38
39
multiBindingField = new plb::MultiScalarField3D<bool >(
39
- MultiBlockManagement3D (
40
- *cellFields.hemocell .lattice ->getSparseBlockStructure ().clone (),
41
- cellFields.hemocell .lattice ->getMultiBlockManagement ().getThreadAttribution ().clone (),
42
- cellFields.hemocell .lattice ->getMultiBlockManagement ().getEnvelopeWidth (),
43
- cellFields.hemocell .lattice ->getMultiBlockManagement ().getRefinementLevel ()),
40
+ MultiBlockManagement3D (
41
+ *cellFields.hemocell .domain_lattice ->getSparseBlockStructure ().clone (),
42
+ cellFields.hemocell .domain_lattice ->getMultiBlockManagement ().getThreadAttribution ().clone (),
43
+ cellFields.hemocell .domain_lattice ->getMultiBlockManagement ().getEnvelopeWidth (),
44
+ cellFields.hemocell .domain_lattice ->getMultiBlockManagement ().getRefinementLevel ()),
44
45
defaultMultiBlockPolicy3D ().getBlockCommunicator (),
45
46
defaultMultiBlockPolicy3D ().getCombinedStatistics (),
46
47
defaultMultiBlockPolicy3D ().getMultiScalarAccess <bool >(),
47
48
0 );
48
- multiBindingField->periodicity ().toggle (0 ,cellFields.hemocell .lattice ->periodicity ().get (0 ));
49
- multiBindingField->periodicity ().toggle (1 ,cellFields.hemocell .lattice ->periodicity ().get (1 ));
50
- multiBindingField->periodicity ().toggle (2 ,cellFields.hemocell .lattice ->periodicity ().get (2 ));
49
+ multiBindingField->periodicity ().toggle (0 ,cellFields.hemocell .domain_lattice ->periodicity ().get (0 ));
50
+ multiBindingField->periodicity ().toggle (1 ,cellFields.hemocell .domain_lattice ->periodicity ().get (1 ));
51
+ multiBindingField->periodicity ().toggle (2 ,cellFields.hemocell .domain_lattice ->periodicity ().get (2 ));
51
52
52
53
multiBindingField->initialize ();
53
-
54
54
// Make sure each particleField has access to its local scalarField
55
55
for (const plint & bId : multiBindingField->getLocalInfo ().getBlocks ()) {
56
- HemoCellParticleField & pf = cellFields.immersedParticles ->getComponent (bId);
56
+ HemoCellParticleField & pf = cellFields.domain_immersedParticles ->getComponent (bId);
57
57
pf.bindingField = &multiBindingField->getComponent (bId);
58
58
}
59
+
59
60
}
60
61
61
62
bindingFieldHelper::~bindingFieldHelper () {
@@ -67,15 +68,17 @@ namespace hemo {
67
68
pcout << " (BindingField) Checkpoint called while global.enableSolidifyMechanics is not enabled, still checkpointing but this should not happen" << endl;
68
69
return ;
69
70
}
71
+
70
72
std::string & outDir = hemo::global.checkpointDirectory ;
71
73
mkpath (outDir.c_str (), 0777 );
72
-
74
+
73
75
if (global::mpi ().isMainProcessor ()) {
74
76
renameFileToDotOld (outDir + " bindingSites.dat" );
75
77
renameFileToDotOld (outDir + " bindingSites.plb" );
76
78
}
77
-
79
+
78
80
plb::parallelIO::save (*multiBindingField, outDir + " bindingSites" , true );
81
+
79
82
}
80
83
81
84
void bindingFieldHelper::restore (HemoCellFields & cellFields) {
@@ -119,8 +122,8 @@ namespace hemo {
119
122
}
120
123
121
124
void bindingFieldHelper::refillBindingSites () {
122
- for (const plint & bId : cellFields.immersedParticles ->getLocalInfo ().getBlocks ()) {
123
- HemoCellParticleField & pf = cellFields.immersedParticles ->getComponent (bId);
125
+ for (const plint & bId : cellFields.domain_immersedParticles ->getLocalInfo ().getBlocks ()) {
126
+ HemoCellParticleField & pf = cellFields.domain_immersedParticles ->getComponent (bId);
124
127
ScalarField3D<bool > & bf = *pf.bindingField ;
125
128
Box3D domain = bf.getBoundingBox ();
126
129
for (int x = domain.x0 ; x <= domain.x1 ; x++) {
@@ -134,4 +137,5 @@ namespace hemo {
134
137
}
135
138
}
136
139
}
140
+
137
141
}
0 commit comments