Skip to content

Commit

Permalink
Merge pull request #1010 from sandialabs/bartgol/set-field-bulk-data-…
Browse files Browse the repository at this point in the history
…cleanup

Cleaning up the set field/bulk data stage in the mesh structures
  • Loading branch information
bartgol authored Feb 22, 2024
2 parents 8ddb4b8 + d5367bb commit 93c7e76
Show file tree
Hide file tree
Showing 72 changed files with 1,107 additions and 2,339 deletions.
2 changes: 1 addition & 1 deletion src/Albany_Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3376,7 +3376,7 @@ Application::setScaleBCDofs(
// nodeset specified via the sideset discretization.
//
/*const auto &sdn =
disc->getMeshStruct()->getMeshSpecs()[0]->sideSetMeshNames;
disc->getMeshStruct()->meshSpecs[0]->sideSetMeshNames;
for (int isd = 0; isd < sdn.size(); ++isd) {
const auto &sd = disc->getSideSetDiscretizations().at(sdn[isd]);
for (auto iterator = sd->getNodeSets().begin();
Expand Down
4 changes: 3 additions & 1 deletion src/SolutionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ SolutionManager::SolutionManager(

// This call allocates the non-overlapped MV
current_soln = Thyra::createMembers(owned_vs,num_time_deriv+1);
disc_->getSolutionMV(*current_soln);
if (disc_->hasRestartSolution()) {
disc_->getSolutionMV(*current_soln);
}

// Create the CombineAndScatterManager for handling distributed memory linear
// algebra communications
Expand Down
5 changes: 0 additions & 5 deletions src/corePDEs/problems/Albany_PopulateMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ PopulateMesh::PopulateMesh (const Teuchos::RCP<Teuchos::ParameterList>& params_,
neq = 1;
}

PopulateMesh::~PopulateMesh()
{
// Nothing to be done here
}

void PopulateMesh::buildProblem (Teuchos::ArrayRCP<Teuchos::RCP<MeshSpecsStruct>> meshSpecs,
StateManager& stateMgr)
{
Expand Down
12 changes: 1 addition & 11 deletions src/corePDEs/problems/Albany_PopulateMesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PopulateMesh : public Albany::AbstractProblem
const Teuchos::RCP<ParamLib>& paramLib_);

//! Destructor
~PopulateMesh();
~PopulateMesh() = default;

//! Return number of spatial dimensions
virtual int spatialDimension() const { return 0; }
Expand All @@ -66,16 +66,6 @@ class PopulateMesh : public Albany::AbstractProblem

bool useSDBCs() const { return use_sdbcs_; }

private:

//! Private to prohibit copying
PopulateMesh(const PopulateMesh&);

//! Private to prohibit copying
PopulateMesh& operator=(const PopulateMesh&);

public:

//! Main problem setup routine. Not directly called, but indirectly by following functions
template <typename EvalT> Teuchos::RCP<const PHX::FieldTag>
constructEvaluators (PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
Expand Down
36 changes: 12 additions & 24 deletions src/disc/Albany_AbstractMeshStruct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,22 @@ struct AbstractMeshStruct {
//! Internal mesh specs type needed
virtual std::string meshType() const = 0;

virtual void setFieldData(
const Teuchos::RCP<const Teuchos_Comm>& commT,
const Teuchos::RCP<Albany::StateInfoStruct>& sis,
const unsigned int worksetSize,
const std::map<std::string,Teuchos::RCP<Albany::StateInfoStruct> >& side_set_sis = {}) = 0;

virtual void setBulkData(
const Teuchos::RCP<const Teuchos_Comm>& commT,
const Teuchos::RCP<Albany::StateInfoStruct>& sis,
const unsigned int worksetSize,
const std::map<std::string,Teuchos::RCP<Albany::StateInfoStruct> >& side_set_sis = {}) = 0;

void setFieldAndBulkData(
const Teuchos::RCP<const Teuchos_Comm>& commT,
const Teuchos::RCP<Albany::StateInfoStruct>& sis,
const unsigned int worksetSize,
const std::map<std::string,Teuchos::RCP<Albany::StateInfoStruct> >& side_set_sis = {})
{
setFieldData(commT, sis, worksetSize, side_set_sis);
setBulkData(commT, sis, worksetSize, side_set_sis);
}

virtual Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >& getMeshSpecs() = 0;
virtual const Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >& getMeshSpecs() const = 0;
virtual void setFieldData (const Teuchos::RCP<const Teuchos_Comm>& comm,
const Teuchos::RCP<StateInfoStruct>& sis) = 0;

virtual void setBulkData(const Teuchos::RCP<const Teuchos_Comm>& comm) = 0;

bool isBulkDataSet () const { return m_bulk_data_set; }

Teuchos::RCP<LayeredMeshNumbering<GO> > global_cell_layers_data;
Teuchos::RCP<LayeredMeshNumbering<LO> > local_cell_layers_data;
Teuchos::ArrayRCP<double> mesh_layers_ratio;

Teuchos::ArrayRCP<Teuchos::RCP<MeshSpecsStruct> > meshSpecs;
std::map<std::string, Teuchos::RCP<AbstractMeshStruct>> sideSetMeshStructs;
protected:

bool m_bulk_data_set = false;
};

} // Namespace Albany
Expand Down
Loading

0 comments on commit 93c7e76

Please sign in to comment.