Commit a302d5b3 authored by clang-formatter's avatar clang-formatter Committed by Janek Kozicki

small clang reformat

parent 34a3b4b0
......@@ -173,7 +173,7 @@ namespace CGT {
vector<Matrix3r> normalStressInteraction;
void Localize();
virtual void computePermeability();
virtual void computePermeability();
virtual void gaussSeidel(Real dt = 0);
virtual void resetNetwork();
virtual void resetLinearSystem(); //reset both A and B in the linear system A*P=B, done typically after updating the mesh
......@@ -196,12 +196,12 @@ namespace CGT {
Real cavityFluidDensity;
bool multithread;
void displayStatistics();
void initializePressure(Real pZero);
void initializeTemperatures(Real tZero);
bool reApplyBoundaryConditions();
void displayStatistics();
void initializePressure(Real pZero);
void initializeTemperatures(Real tZero);
bool reApplyBoundaryConditions();
virtual void computeFacetForcesWithCache(bool onlyCache = false);
void saveVtk(const char* folder, bool withBoundaries);
void saveVtk(const char* folder, bool withBoundaries);
//write vertices, cells, return ids and no. of fictious neighbors, allIds is an ordered list of cell ids (from begin() to end(), for vtk table lookup),
// some ids will appear multiple times if withBoundaries==true since boundary cells are splitted into multiple tetrahedra
void saveMesh(basicVTKwritter& writer, bool withBoundaries, vector<int>& allIds, vector<int>& fictiousN, const char* folder);
......@@ -249,7 +249,7 @@ namespace CGT {
void sliceField(const char* filename);
void comsolField();
virtual void interpolate(Tesselation& Tes, Tesselation& NewTes);
virtual void interpolate(Tesselation& Tes, Tesselation& NewTes);
virtual void averageRelativeCellVelocity();
void averageFluidVelocity();
void applySinusoidalPressure(RTriangulation& Tri, Real amplitude, Real averagePressure, Real loadIntervals);
......
......@@ -74,7 +74,6 @@ namespace CGT {
using _N::surfaceSolidThroatInPore;
using _N::tesselation;
using BaseFlowSolver::manualCrackPerm;
using BaseFlowSolver::bIntrinsicPerm;
using BaseFlowSolver::checkSphereFacetOverlap;
using BaseFlowSolver::clampKValues;
......@@ -90,6 +89,7 @@ namespace CGT {
using BaseFlowSolver::freezeSaturation;
using BaseFlowSolver::kFactor;
using BaseFlowSolver::KOptFactor;
using BaseFlowSolver::manualCrackPerm;
using BaseFlowSolver::matricSuctionRatio;
using BaseFlowSolver::maxKdivKmean;
using BaseFlowSolver::meanInitialPorosity;
......
......@@ -589,8 +589,11 @@ namespace CGT {
} else {
if (SeM < 0)
cerr << "negative equivalent saturation, linear system will be unstable" << endl;
Real kM = -kFactor * exp(bIntrinsicPerm * (avgPoro - meanInitialPorosity)); //avgPoroOrig)); consider making all perm relative to the mean instaed of the initial...
Real perm = kM * pow(SeM, nUnsatPerm) * area / distance;
Real kM = -kFactor
* exp(bIntrinsicPerm
* (avgPoro
- meanInitialPorosity)); //avgPoroOrig)); consider making all perm relative to the mean instaed of the initial...
Real perm = kM * pow(SeM, nUnsatPerm) * area / distance;
cell->info().kNorm()[j] = (permClamp > 0 and perm > permClamp) ? permClamp : perm;
//cout << "id " << cell->info().id << " perm " << cell->info().kNorm()[j] << " SeM " << SeM << " kM " << kM << " avgPoro " << avgPoro << endl;
}
......@@ -796,7 +799,7 @@ namespace CGT {
return 0; //the engine never solved anything
//RTriangulation& Tri = T[noCache?(!currentTes):currentTes].Triangulation();
Real suctionTotal = 0;
int numCells = 0;
int numCells = 0;
for (VCellIterator cellIt = T[currentTes].cellHandles.begin(); cellIt != T[currentTes].cellHandles.end(); cellIt++) {
CellHandle& cell = *cellIt;
if (cell->info().Pcondition or cell->info().blocked)
......
......@@ -173,7 +173,7 @@ public:
// Evaluate gradient for function
void EvaluateGradient(
Real /*x*/[3], Real /*n*/[3]){}; // FIXME - better use Vector3r here instead of Real[3] (here I only fix the unused parameter warning).
Real /*x*/[3], Real /*n*/[3]) {}; // FIXME - better use Vector3r here instead of Real[3] (here I only fix the unused parameter warning).
// If you need to set parameters, add methods here
......
......@@ -10,7 +10,7 @@ namespace yade { // Cannot have #include directive inside.
YADE_PLUGIN((MindlinPhys)(Ip2_FrictMat_FrictMat_MindlinPhys)(Law2_ScGeom_MindlinPhys_MindlinDeresiewitz)(Law2_ScGeom_MindlinPhys_HertzWithLinearShear)(
Law2_ScGeom_MindlinPhys_Mindlin)(MindlinCapillaryPhys)(Ip2_FrictMat_FrictMat_MindlinCapillaryPhys)
#ifdef PARTIALSAT
(PartialSatMat)(PartialSatState)(Ip2_PartialSatMat_PartialSatMat_MindlinPhys)
(PartialSatMat)(PartialSatState)(Ip2_PartialSatMat_PartialSatMat_MindlinPhys)
#endif
);
......@@ -24,12 +24,12 @@ CREATE_LOGGER(Ip2_FrictMat_FrictMat_MindlinPhys);
void Ip2_FrictMat_FrictMat_MindlinPhys::go(const shared_ptr<Material>& b1, const shared_ptr<Material>& b2, const shared_ptr<Interaction>& interaction)
{
if (interaction->phys)
if (interaction->phys)
return; // no updates of an already existing contact necessary
shared_ptr<MindlinPhys> contactPhysics(new MindlinPhys());
interaction->phys = contactPhysics;
const auto mat1 = YADE_CAST<FrictMat*>(b1.get());
const auto mat2 = YADE_CAST<FrictMat*>(b2.get());
const auto mat1 = YADE_CAST<FrictMat*>(b1.get());
const auto mat2 = YADE_CAST<FrictMat*>(b2.get());
/* from interaction physics */
const Real Ea = mat1->young;
......@@ -42,8 +42,8 @@ void Ip2_FrictMat_FrictMat_MindlinPhys::go(const shared_ptr<Material>& b1, const
/* from interaction geometry */
const auto scg = YADE_CAST<GenericSpheresContact*>(interaction->geom.get());
const Real Da = scg->refR1 > 0 ? scg->refR1 : scg->refR2;
const Real Db = scg->refR2;
const Real Da = scg->refR1 > 0 ? scg->refR1 : scg->refR2;
const Real Db = scg->refR2;
//Vector3r normal=scg->normal; //The variable set but not used
......@@ -80,7 +80,7 @@ void Ip2_FrictMat_FrictMat_MindlinPhys::go(const shared_ptr<Material>& b1, const
// en or es specified, just compute alpha, otherwise alpha remains 0
if (en || es) {
const Real logE = log((*en)(mat1->id, mat2->id));
const Real logE = log((*en)(mat1->id, mat2->id));
contactPhysics->alpha = -sqrt(5 / 6.) * 2 * logE / sqrt(pow(logE, 2) + pow(Mathr::PI, 2))
* sqrt(2 * E * sqrt(R)); // (see Tsuji, 1992), also [Antypov2011] eq. 17
}
......@@ -241,7 +241,7 @@ bool Law2_ScGeom_MindlinPhys_HertzWithLinearShear::go(shared_ptr<IGeom>& ig, sha
Real ks = nonLin > 0 ? phys->kso * math::pow(uN, 0.5) : phys->kso;
Vector3r shearIncrement;
if (nonLin > 1) {
auto * de1 = Body::byId(id1, scene)->state.get(), *de2 = Body::byId(id2, scene)->state.get();
auto * de1 = Body::byId(id1, scene)->state.get(), *de2 = Body::byId(id2, scene)->state.get();
Vector3r shiftVel = scene->isPeriodic ? Vector3r(scene->cell->velGrad * scene->cell->hSize * contact->cellDist.cast<Real>()) : Vector3r::Zero();
Vector3r shift2 = scene->isPeriodic ? Vector3r(scene->cell->hSize * contact->cellDist.cast<Real>()) : Vector3r::Zero();
......@@ -641,8 +641,8 @@ void Ip2_FrictMat_FrictMat_MindlinCapillaryPhys::go(
/* from interaction geometry */
const auto scg = YADE_CAST<GenericSpheresContact*>(interaction->geom.get());
const Real Da = scg->refR1 > 0 ? scg->refR1 : scg->refR2;
const Real Db = scg->refR2;
const Real Da = scg->refR1 > 0 ? scg->refR1 : scg->refR2;
const Real Db = scg->refR2;
//Vector3r normal=scg->normal; //The variable set but not used
/* calculate stiffness coefficients */
......@@ -678,7 +678,7 @@ void Ip2_FrictMat_FrictMat_MindlinCapillaryPhys::go(
// en or es specified, just compute alpha, otherwise alpha remains 0
if (en || es) {
const Real logE = log((*en)(mat1->id, mat2->id));
const Real logE = log((*en)(mat1->id, mat2->id));
contactPhysics->alpha = -sqrt(5 / 6.) * 2 * logE / sqrt(pow(logE, 2) + pow(Mathr::PI, 2)) * sqrt(2 * E * sqrt(R)); // (see Tsuji, 1992)
}
......@@ -699,8 +699,8 @@ void Ip2_PartialSatMat_PartialSatMat_MindlinPhys::go(const shared_ptr<Material>&
return; // no updates of an already existing contact necessary
shared_ptr<MindlinPhys> contactPhysics(new MindlinPhys());
interaction->phys = contactPhysics;
const auto mat1 = YADE_CAST<FrictMat*>(b1.get());
const auto mat2 = YADE_CAST<FrictMat*>(b2.get());
const auto mat1 = YADE_CAST<FrictMat*>(b1.get());
const auto mat2 = YADE_CAST<FrictMat*>(b2.get());
/* from interaction physics */
const Real Ea = mat1->young;
......@@ -713,8 +713,8 @@ void Ip2_PartialSatMat_PartialSatMat_MindlinPhys::go(const shared_ptr<Material>&
/* from interaction geometry */
const auto scg = YADE_CAST<GenericSpheresContact*>(interaction->geom.get());
const Real Da = scg->refR1 > 0 ? scg->refR1 : scg->refR2;
const Real Db = scg->refR2;
const Real Da = scg->refR1 > 0 ? scg->refR1 : scg->refR2;
const Real Db = scg->refR2;
//Vector3r normal=scg->normal; //The variable set but not used
......@@ -751,7 +751,7 @@ void Ip2_PartialSatMat_PartialSatMat_MindlinPhys::go(const shared_ptr<Material>&
// en or es specified, just compute alpha, otherwise alpha remains 0
if (en || es) {
const Real logE = log((*en)(mat1->id, mat2->id));
const Real logE = log((*en)(mat1->id, mat2->id));
contactPhysics->alpha = -sqrt(5 / 6.) * 2 * logE / sqrt(pow(logE, 2) + pow(Mathr::PI, 2))
* sqrt(2 * E * sqrt(R)); // (see Tsuji, 1992), also [Antypov2011] eq. 17
}
......
......@@ -248,7 +248,6 @@ class PartialSatState : public State {
);
// clang-format on
REGISTER_CLASS_INDEX(PartialSatState, State);
};
REGISTER_SERIALIZABLE(PartialSatState);
......
......@@ -59,7 +59,11 @@ void NewtonIntegrator::updateEnergy(const shared_ptr<Body>& b, const State* stat
assert(b->isStandalone() || b->isClump());
// always positive dissipation, by-component: |F_i|*|v_i|*damping*dt (|T_i|*|ω_i|*damping*dt for rotations)
if (damping != 0. && state->isDamped) {
scene->energy->add(fluctVel.cwiseAbs().dot((f+state->mass*gravity).cwiseAbs()) * damping * scene->dt, "nonviscDamp", nonviscDampIx, /*non-incremental*/ false);
scene->energy->add(
fluctVel.cwiseAbs().dot((f + state->mass * gravity).cwiseAbs()) * damping * scene->dt,
"nonviscDamp",
nonviscDampIx,
/*non-incremental*/ false);
// when the aspherical integrator is used, torque is damped instead of ang acceleration; this code is only approximate
scene->energy->add(state->angVel.cwiseAbs().dot(m.cwiseAbs()) * damping * scene->dt, "nonviscDamp", nonviscDampIx, false);
}
......
......@@ -155,10 +155,10 @@ void VTKRecorder::action()
recActive[REC_DEFORM] = true;
else if (rec == "lubrication")
recActive[REC_LUBRICATION] = true;
else if (rec=="hertz")
recActive[REC_HERTZMINDLIN]=true;
else if (rec=="partialSat")
recActive[REC_PARTIALSAT]=true;
else if (rec == "hertz")
recActive[REC_HERTZMINDLIN] = true;
else if (rec == "partialSat")
recActive[REC_PARTIALSAT] = true;
else
LOG_ERROR(
"Unknown recorder named `" << rec
......@@ -544,13 +544,13 @@ void VTKRecorder::action()
wpmLimitFactor->SetName("wpmLimitFactor");
#ifdef PARTIALSAT
// extras for hertzmindlin
vtkSmartPointer<vtkDoubleArrayFromReal> intrBrokenHertz = vtkSmartPointer<vtkDoubleArrayFromReal>::New();
intrBrokenHertz->SetNumberOfComponents(1);
intrBrokenHertz->SetName("broken");
vtkSmartPointer<vtkDoubleArray> intrDisp = vtkSmartPointer<vtkDoubleArrayFromReal>::New();
intrDisp->SetNumberOfComponents(1);
intrDisp->SetName("disp");
// extras for hertzmindlin
vtkSmartPointer<vtkDoubleArrayFromReal> intrBrokenHertz = vtkSmartPointer<vtkDoubleArrayFromReal>::New();
intrBrokenHertz->SetNumberOfComponents(1);
intrBrokenHertz->SetName("broken");
vtkSmartPointer<vtkDoubleArray> intrDisp = vtkSmartPointer<vtkDoubleArrayFromReal>::New();
intrDisp->SetNumberOfComponents(1);
intrDisp->SetName("disp");
vtkSmartPointer<vtkDoubleArrayFromReal> spheresRadiiChange = vtkSmartPointer<vtkDoubleArrayFromReal>::New();
......@@ -678,14 +678,14 @@ void VTKRecorder::action()
intrIsOnJoint->InsertNextValue(jcfpmphys->isOnJoint);
intrForceN->InsertNextValue(fn);
eventNumber->InsertNextValue(jcfpmphys->eventNumber);
} else if (recActive[REC_HERTZMINDLIN]){
} else if (recActive[REC_HERTZMINDLIN]) {
#ifdef PARTIALSAT
const auto mindlinphys = YADE_CAST<MindlinPhys*>(I->phys.get());
const auto mindlingeom = YADE_CAST<ScGeom*>(I->geom.get());
const auto mindlinphys = YADE_CAST<MindlinPhys*>(I->phys.get());
const auto mindlingeom = YADE_CAST<ScGeom*>(I->geom.get());
intrBrokenHertz->InsertNextValue(mindlinphys->isBroken);
intrDisp->InsertNextValue(mindlingeom->penetrationDepth - mindlinphys->initD);
intrDisp->InsertNextValue(mindlingeom->penetrationDepth - mindlinphys->initD);
#endif
intrForceN->InsertNextValue(fn);
intrForceN->InsertNextValue(fn);
} else {
intrForceN->InsertNextValue(fn);
}
......@@ -1346,12 +1346,12 @@ void VTKRecorder::action()
intrPd->GetCellData()->AddArray(wpmNormalForce);
intrPd->GetCellData()->AddArray(wpmLimitFactor);
}
if (recActive[REC_HERTZMINDLIN]){
if (recActive[REC_HERTZMINDLIN]) {
#ifdef PARTIALSAT
intrPd->GetCellData()->AddArray(intrBrokenHertz);
intrPd->GetCellData()->AddArray(intrDisp);
intrPd->GetCellData()->AddArray(intrBrokenHertz);
intrPd->GetCellData()->AddArray(intrDisp);
#endif
}
}
#ifdef YADE_VTK_MULTIBLOCK
if (!multiblock)
#endif
......
......@@ -46,8 +46,8 @@ public:
REC_DEFORM,
REC_LUBRICATION,
REC_SUBDOMAIN,
REC_PARTIALSAT,
REC_HERTZMINDLIN };
REC_PARTIALSAT,
REC_HERTZMINDLIN };
virtual void action();
void addWallVTK(vtkSmartPointer<vtkQuad>& boxes, vtkSmartPointer<vtkPointsReal>& boxesPos, Vector3r& W1, Vector3r& W2, Vector3r& W3, Vector3r& W4);
// clang-format off
......
This diff is collapsed.
......@@ -57,18 +57,18 @@ public:
Real saturation; //the saturation of single pore (will be used in quasi-static imbibition and dynamic flow)
Real porosity;
//Real solidLine [4][4];//the length of intersecting line between sphere and facet. [i][j] is for facet "i" and sphere (facetVertices)"[i][j]". Last component [i][3] for 1/sumLines in the facet "i" (used by chao).
Real dsdp; // the change of saturation for given capillary pressure
Real dsdp; // the change of saturation for given capillary pressure
bool crack;
short int crackNum;
Real crackArea;
bool isExposed;
Real initialPorosity;
Real initialSaturation;
Real Po; // parameter for water retention curve, unique to cell
Real lambdao; // parameter for water retention curve
Real vSolids;
Real equivalentBulkModulus;
Real oldPressure;
Real Po; // parameter for water retention curve, unique to cell
Real lambdao; // parameter for water retention curve
Real vSolids;
Real equivalentBulkModulus;
Real oldPressure;
bool clumped;
bool initiallyCracked; // flag to continue computing initial crack perm during simulation without needing displacements or broken bonds
......@@ -123,12 +123,12 @@ public:
public:
//PartialSatClayEngineT* clayFlow;
Real dsdp(CellHandle& cell);
void initializeSaturations(FlowSolver& flow);
void setSaturationFromPcS(CellHandle& cell);
void setCellsDSDP(FlowSolver& flow);
void initializeSaturations(FlowSolver& flow);
void setSaturationFromPcS(CellHandle& cell);
void setCellsDSDP(FlowSolver& flow);
Real getTotalVolume();
void updateSaturation(FlowSolver& flow);
void updateBoundarySaturation(FlowSolver& flow);
void updateSaturation(FlowSolver& flow);
void updateBoundarySaturation(FlowSolver& flow);
// void triangulate(FlowSolver& flow);
//Real diagonalSaturationContribution(CellHandle cell);
//Real RHSSaturationContribution(CellHandle cell);
......@@ -144,14 +144,14 @@ public:
Real exponentialDeviate(Real a, Real b);
Real weibullDeviate(Real lambda, Real k);
Real vanGenuchten(CellHandle& cell, Real pc);
void exposureRecursion(CellHandle cell, Real bndPressure);
void determineFracturePaths();
void createSphere(shared_ptr<Body>& body, Vector3r position, Real radius);
void insertMicroPores(const Real fracMicroPore);
bool findInscribedRadiusAndLocation(CellHandle& cell, std::vector<Real>& coordAndRad);
bool checkSphereContainedInTet(CellHandle& cell, std::vector<Real>& coordAndRad);
void setPorosityWithImageryGrid(string imageryFilePath, FlowSolver& flow);
void resetPoresVolumeSolids(FlowSolver& flow);
void exposureRecursion(CellHandle cell, Real bndPressure);
void determineFracturePaths();
void createSphere(shared_ptr<Body>& body, Vector3r position, Real radius);
void insertMicroPores(const Real fracMicroPore);
bool findInscribedRadiusAndLocation(CellHandle& cell, std::vector<Real>& coordAndRad);
bool checkSphereContainedInTet(CellHandle& cell, std::vector<Real>& coordAndRad);
void setPorosityWithImageryGrid(string imageryFilePath, FlowSolver& flow);
void resetPoresVolumeSolids(FlowSolver& flow);
void blockLowPoroRegions(FlowSolver& flow);
void blockMineralCellRecursion(CellHandle cell, std::vector<Body::id_t>& clumpIds);
......@@ -195,18 +195,20 @@ public:
virtual void buildTriangulation(Real pZero, Solver& flow);
virtual void initSolver(FlowSolver& flow);
virtual void action();
virtual void emulateAction(){
scene = Omega::instance().getScene().get();
emulatingAction=true;
virtual void emulateAction()
{
scene = Omega::instance().getScene().get();
emulatingAction = true;
action();
emulatingAction=false;}
emulatingAction = false;
}
void reloadSolver(FlowSolver& flow) { this->initSolver(flow); }
virtual ~PartialSatClayEngine();
Real getCrackArea() { return crackArea; }
Real getCrackVolume() { return crackVolume; }
void printPorosity(string file) { printPorosityToFile(file); }
Real getCrackArea() { return crackArea; }
Real getCrackVolume() { return crackVolume; }
void printPorosity(string file) { printPorosityToFile(file); }
Real getCellSaturation(Vector3r pos) { return solver->getCellSaturation(pos[0], pos[1], pos[2]); }
//Real getCellVelocity(Vector3r pos){return solver->getCellVelocity(pos[0], pos[1], pos[2]);}
std::vector<Real> getCellVelocity(Vector3r pos) { return solver->getCellVelocity(pos[0], pos[1], pos[2]); }
......@@ -215,7 +217,7 @@ public:
bool getCellCracked(Vector3r pos) { return solver->getCellCracked(pos[0], pos[1], pos[2]); }
Real getAverageSaturation() { return solver->getAverageSaturation(); }
Real getAverageSuction() { return solver->getAverageSuction(); }
Real getTotalSpecimenVolume() { return getTotalVolume(); }
Real getTotalSpecimenVolume() { return getTotalVolume(); }
CELL_SCALAR_GETTER(Real, .sat(), cellSaturation);
CELL_SCALAR_SETTER(Real, .sat(), setCellSaturation);
......@@ -224,7 +226,7 @@ public:
// PartialSatClayEngineT* flow;
void saveUnsatVtk(const char* folder, bool withBoundaries);
// clang-format off
// clang-format off
YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(PartialSatClayEngine,PartialSatClayEngineT,"Engine designed to simulate the partial saturation of clay and associated swelling.",
((Real,lmbda,0.2,,"Lambda parameter for Van Genuchten model. Free swelling 0.4. If porosity is distributed, this value becomes cell based."))
((Real,pAir,0,,"Air pressure for calculation of capillary pressure (Pair - Pwater)"))
......
......@@ -1752,7 +1752,8 @@ try {
.def("f",
&pyForceContainer::force_get,
(py::arg("id"), py::arg("sync") = false),
"Resultant force on body, excluding :yref:`gravity<NewtonIntegrator.gravity>`. For clumps in openMP, synchronize the force container with sync=True, else the value will be wrong.")
"Resultant force on body, excluding :yref:`gravity<NewtonIntegrator.gravity>`. For clumps in openMP, synchronize the force container with "
"sync=True, else the value will be wrong.")
.def("t",
&pyForceContainer::torque_get,
(py::arg("id"), py::arg("sync") = false),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment