Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element/Partial Assembly Discrete Upwind Option #37

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions remhos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,16 @@ int main(int argc, char *argv[])

ParBilinearForm k(&pfes);
ParBilinearForm K_HO(&pfes);
ConvectionIntegrator *conv_int = nullptr;
if (exec_mode == 0)
{
conv_int = new ConvectionIntegrator(velocity, -1.0);
k.AddDomainIntegrator(new ConvectionIntegrator(velocity, -1.0));
K_HO.AddDomainIntegrator(new ConvectionIntegrator(velocity, -1.0));
}
else if (exec_mode == 1)
{
conv_int = new ConvectionIntegrator(v_coef);
k.AddDomainIntegrator(new ConvectionIntegrator(v_coef));
K_HO.AddDomainIntegrator(new ConvectionIntegrator(v_coef));
}
Expand Down Expand Up @@ -612,9 +615,27 @@ int main(int argc, char *argv[])
const bool time_dep = (exec_mode == 0) ? false : true;
if (lo_type == LOSolverType::DiscrUpwind)
{
lo_smap = SparseMatrix_Build_smap(k.SpMat());
lo_solver = new DiscreteUpwind(pfes, k.SpMat(), lo_smap,
lumpedM, asmbl, time_dep);
if (pa)
{
lo_solver = new PADiscreteUpwind(pfes, conv_int,
lumpedM, asmbl, time_dep);
if (exec_mode == 0)
{
const PADiscreteUpwind *lo_ptr =
dynamic_cast<const PADiscreteUpwind*>(lo_solver);
lo_ptr->AssembleBlkOperators();
lo_ptr->SampleVelocity(FaceType::Interior);
lo_ptr->SampleVelocity(FaceType::Boundary);
lo_ptr->SetupPA(FaceType::Interior);
lo_ptr->SetupPA(FaceType::Boundary);
}
}
else
{
lo_smap = SparseMatrix_Build_smap(k.SpMat());
lo_solver = new DiscreteUpwind(pfes, k.SpMat(), lo_smap,
lumpedM, asmbl, time_dep);
}
}
else if (lo_type == LOSolverType::DiscrUpwindPrec)
{
Expand Down Expand Up @@ -1210,6 +1231,15 @@ void AdvectionOperator::Mult(const Vector &X, Vector &Y) const
RD_ptr->SetupPA(FaceType::Interior);
RD_ptr->SetupPA(FaceType::Boundary);
}
else if (auto lo_ptr = dynamic_cast<const PADiscreteUpwind*>(lo_solver))
{
//Construct K, D in K* = K + D
lo_ptr->AssembleBlkOperators();
lo_ptr->SampleVelocity(FaceType::Interior);
lo_ptr->SampleVelocity(FaceType::Boundary);
lo_ptr->SetupPA(FaceType::Interior);
lo_ptr->SetupPA(FaceType::Boundary);
}
else
{
for (int k = 0; k < ne; k++)
Expand Down
Loading