Skip to content

Commit

Permalink
delete lots of unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmerson committed May 10, 2024
1 parent 1db468d commit 7c4e754
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 139 deletions.
5 changes: 0 additions & 5 deletions src/mumfim/macroscale/MultiscaleTissueAnalysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
#include "mumfim/exceptions.h"
namespace mumfim
{
void MultiscaleTissueIteration::iterate()
{
std::cerr<<"We shouldn't be calling the multiscale tissue iteration if code is working as expected\n";
std::abort();
}
MultiscaleTissueAnalysis::MultiscaleTissueAnalysis(
apf::Mesh * mesh,
std::unique_ptr<mt::CategoryNode> analysis_case,
Expand Down
15 changes: 0 additions & 15 deletions src/mumfim/macroscale/MultiscaleTissueAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@
#include "FEMAnalysis.h"
namespace mumfim
{
class MultiscaleTissueIteration : public amsi::Iteration
{
protected:
MultiscaleTissueStep * tssu;
amsi::LAS * las;
Iteration * fem_iter;

public:
MultiscaleTissueIteration(MultiscaleTissueStep * a, amsi::LAS * l)
: tssu(a), las(l), fem_iter(amsi::buildLinearFEMIteration(a, l))
{
}
~MultiscaleTissueIteration() { delete fem_iter; }
void iterate();
};
class MultiscaleTissueAnalysis : public FEMAnalysis
{
public:
Expand Down
1 change: 0 additions & 1 deletion src/mumfim/macroscale/MultiscaleTissueStep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ namespace mumfim
}
void MultiscaleTissueStep::recoverSecondaryVariables(int step)
{
NonlinearTissueStep::recoverSecondaryVariables(step);
fo_cplg.recvRVEStepData();
// loop over all mesh regions
apf::MeshIterator * it = apf_mesh->begin(analysis_dim);
Expand Down
107 changes: 0 additions & 107 deletions src/mumfim/macroscale/NonlinearTissueStep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,111 +249,4 @@ namespace mumfim
apf::synchronize(delta_u);
}

/**
* get the Neumann boundary condition value on the specified entity
* @param ent model entity to query
* @param frc will be filled with the value of the NeumannBCs
*/
void NonlinearTissueStep::getLoadOn(apf::ModelEntity * ent, double * frc)
{
auto model_dimension = apf_mesh->getModelType(ent);
auto model_tag = apf_mesh->getModelTag(ent);
auto * associated_traits =
problem_definition.associated->Find({model_dimension, model_tag});
if (associated_traits == nullptr)
{
std::cerr << "Attempting to get Neumann BC on [" << model_dimension << ","
<< model_tag << "].";
std::cerr << " No boundary conditions associated with that geometry.\n";
exit(1);
}
for (const auto & neumann_bc : neumann_bcs)
{
const mt::AssociatedCategoryNode * category_node = associated_traits;
for (const auto & category : neumann_bc.categories)
{
category_node = category_node->FindCategoryByType(category);
if (category_node == nullptr)
{
break;
}
}
if (category_node == nullptr)
{
std::cerr << "Invalid Neumann BC provided\n";
exit(1);
}
const auto * load_trait =
mt::GetCategoryModelTraitByType(category_node, neumann_bc.mt_name);
const auto * const_load_trait = mt::MTCast<mt::VectorMT>(load_trait);
const auto * time_function_load =
mt::MTCast<mt::VectorFunctionMT<1>>(load_trait);
if (const_load_trait != nullptr)
{
for (int i = 0; i < 3; ++i)
{
frc[i] = (*const_load_trait)(i);
}
}
else if (time_function_load != nullptr)
{
for (int i = 0; i < 3; ++i)
{
frc[i] = (*time_function_load)(i, T);
}
}
else
{
std::cerr << "Load must be either a scalar value, or function of time "
"only.\n";
exit(1);
}
}
}

void NonlinearTissueStep::recoverSecondaryVariables(int /* unused load_step */)
{
/*
//#ifdef SCOREC
int rnk = -1;
MPI_Comm_rank(AMSI_COMM_SCALE, &rnk);
std::stringstream fnm;
fnm << amsi::fs->getResultsDir() << "/qlty.stp_" << load_step << ".rnk_"
<< rnk << ".dat";
// analyze and print the quality of the elements
apf::Field* qfld = amsi::analyzeMeshQuality(apf_mesh, apf_primary_field);
std::ofstream file(fnm.str().c_str(), std::ofstream::out);
amsi::PrintField(qfld, file).run();
apf::destroyField(qfld);
*/
// #endif
}

void NonlinearTissueStep::storeStrain(apf::MeshElement * me, double * strain)
{
apf::MeshEntity * m_ent = apf::getMeshEntity(me);
apf::Matrix3x3 eps(strain[0], strain[3], strain[5], strain[3], strain[1],
strain[4], strain[5], strain[4], strain[2]);
apf::setMatrix(strn, m_ent, 0, eps);
}

void NonlinearTissueStep::storeStrain(apf::MeshElement * me, apf::Matrix3x3 eps)
{
apf::MeshEntity * m_ent = apf::getMeshEntity(me);
apf::setMatrix(strn, m_ent, 0, eps);
}

void NonlinearTissueStep::storeStress(apf::MeshElement * me, double * stress)
{
apf::MeshEntity * m_ent = apf::getMeshEntity(me);
apf::Matrix3x3 sigma(stress[0], stress[3], stress[5], stress[3], stress[1],
stress[4], stress[5], stress[4], stress[2]);
apf::setMatrix(strs, m_ent, 0, sigma);
}

void NonlinearTissueStep::storeStress(apf::MeshElement * me, apf::Matrix3x3 eps)
{
apf::MeshEntity * m_ent = apf::getMeshEntity(me);
apf::setMatrix(strs, m_ent, 0, eps);
}
} // namespace mumfim
13 changes: 2 additions & 11 deletions src/mumfim/macroscale/NonlinearTissueStep.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,19 @@ namespace mumfim
MPI_Comm cm = AMSI_COMM_SCALE);
virtual ~NonlinearTissueStep();
void computeInitGuess(amsi::LAS* las);
void getLoadOn(apf::ModelEntity* ent, double* frc);
void step();
void iter();
void Assemble(amsi::LAS* las) override;
void UpdateDOFs(const double* sol) override;
virtual void recoverSecondaryVariables(int);
virtual void preRun() {};
void AcceptDOFs(){
apf::copyData(accepted_displacements, getUField());
}
void storeStress(apf::MeshElement* me, double* stress);
void storeStress(apf::MeshElement* me, apf::Matrix3x3 eps);
void storeStrain(apf::MeshElement* me, double* strain);
void storeStrain(apf::MeshElement* me, apf::Matrix3x3 eps);

int getIteration() { return iteration; }
apf::Numbering* getNumbering() { return apf_primary_numbering; }
//apf::Field* getdUField() { return delta_u; }
[[nodiscard]] apf::Field* getUField() final { return apf_primary_field; }
[[nodiscard]] apf::Field* getUField() final { return apf_primary_field; }
apf::Mesh* getMesh() { return apf_mesh; }
// void logCnstrntParams(int ldstp, int iteration, int rnk);
// function to get mapping by summing reference coordinate with
// displacements
};
}
#endif

0 comments on commit 7c4e754

Please sign in to comment.