Comments (6)
I'm going through all my notifications, so I'm randomly commenting here, but I just wanted to mention to @mfmweerdesteijn that if you only use a minimum refinement function and set Time steps between mesh refinement = 0
, there will be no time-dependent mesh refinement, so you skip all that set up as well.
from aspect.
@tjhei When you say that it is easy to detect that the mesh didn't change, I assume that you want to loop over all cells and see whether any flags are actually set? And if the answer is no, just bail out of the mesh refinement function early?
from aspect.
In core.cc
, we already have this in refine_mesh()
:
exchange_refinement_flags();
triangulation.prepare_coarsening_and_refinement();
bool any_flags_set = false;
{
for (const auto &cell:dof_handler.active_cell_iterators())
{
if (cell->refine_flag_set() || cell->coarsen_flag_set())
{
any_flags_set = true;
break;
}
}
}
const bool mesh_changed = Utilities::MPI::max(any_flags_set?1:0,mpi_communicator) == 1 ? true : false;
if (!mesh_changed)
{
pcout << "Skipping mesh refinement, because the mesh did not change.\n" << std::endl;
return;
}
The only place where we do not have this check before execute_coarsening_and_refinement()
is in the pre-refinement:
template <int dim>
void Simulator<dim>::run ()
{
CitationInfo::print_info_block(pcout);
unsigned int max_refinement_level = parameters.initial_global_refinement +
parameters.initial_adaptive_refinement;
pre_refinement_step = 0;
// if we want to resume a computation from an earlier point
// then reload it from a snapshot. otherwise do the basic
// start-up
if (parameters.resume_computation == true)
{
resume_from_snapshot();
// we need to remove additional_refinement_times that are in the past
// and adjust max_refinement_level which is not written to file
while ((parameters.additional_refinement_times.size() > 0)
&&
(parameters.additional_refinement_times.front () < time+time_step))
{
++max_refinement_level;
parameters.additional_refinement_times
.erase (parameters.additional_refinement_times.begin());
}
}
else
{
time = parameters.start_time;
// Instead of calling global_refine(n) we flag all cells for
// refinement and then allow the mesh refinement plugins to unflag
// the cells if desired. This procedure is repeated n times. If there
// is no plugin that modifies the flags, it is equivalent to
// refine_global(n).
for (unsigned int n=0; n<parameters.initial_global_refinement; ++n)
{
for (const auto &cell : triangulation.active_cell_iterators())
if (cell->is_locally_owned())
cell->set_refine_flag ();
mesh_refinement_manager.tag_additional_cells ();
exchange_refinement_flags();
triangulation.execute_coarsening_and_refinement();
if (MappingQCache<dim> *map = dynamic_cast<MappingQCache<dim>*>(&(*mapping)))
map->initialize(MappingQGeneric<dim>(4), triangulation);
}
setup_dofs();
But here, we work only on the mesh. We haven't called setup_dofs()
yet.
So I'm not sure where you think we would save much time.
from aspect.
From the point of view of the GIA application: I don't have boundary traction at t=0, but have at the following step. When using a free surface, and adaptive mesh refinement with the 'strain rate' strategy, the mesh will refine for t=0 quite randomly. When then boundary traction is applied, the more refined mesh area will move towards the region where boundary traction is applied. This initial, sort of random, mesh refinement where it is not necessary, is a waste of resources.
from aspect.
Perhaps, but the mesh changes and so we have to set up data structures for the new mesh.
The issue with the random mesh is due to the fact that the solution is initially the solution is very smooth, and so there is no "obvious" area to refine. Only once you applied a load does the solution change in a way that makes it obvious where refinement is necessary. I get that the initial steps are a waste of resources, but it's hard to avoid: What I suspect you want is that the mesh is refinement where it will need to be fine in the future, but it's of course hard to predict where that is going to be :-)
from aspect.
This can be closed I think, as I implemented it in #5070.
from aspect.
Related Issues (20)
- Modify Stress limiter in VP? HOT 1
- Update to particle composition HOT 5
- An error and its solution "bash: /home/ubuntu/aspect/aspect: No such file or directory"
- Deformed cell for 3D mesh deformation in release mode HOT 4
- Test viscoplastic material model
- Warning: handling deprecated packages HOT 4
- deal.II-v9.5.2 missing bundled directory HOT 8
- Move FastScape restarting functionality into the ASPECT checkpointing framework
- Fixed compositional field (and temperature) boundary conditions on deforming boundaries HOT 1
- Continental extension cookbook fails with gmg solver HOT 4
- contrib/utilities/update_scripts/source_files out of date
- MPI error installation main HOT 3
- Build ASPECT in 'release mode only' causes external plugins to not compile HOT 2
- Document default boundary condition for Stokes solve HOT 1
- Fix spherical unit vectors documentation
- benchmarks/free_surface_tractions/viscoelastic out of date
- Stripping the restart.mesh.data file HOT 5
- add documentation about different docker images
- A lingering interuption issue running on our local sever at UC Davis
- Solution divergence between different combinations of linear and nonlinear solver schemes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspect.