[deal.II] deal.II Newsletter #211

2022-05-10 Thread 'Rene Gassmoeller' via deal.II User Group
Hello everyone!

This is deal.II newsletter #211.
It automatically reports recently merged features and discussions about the 
deal.II finite element library.


## Below you find a list of recently proposed or merged features:

#13711: Fix the nodal renumbering tests. (proposed by drwells) 
https://github.com/dealii/dealii/pull/13711

#13710: Restrict feinterface/stokes test (proposed by masterleinad; merged) 
https://github.com/dealii/dealii/pull/13710

#13709: Add two asserts in NonMatching::MeshClassifier. (proposed by 
simonsticko; merged) https://github.com/dealii/dealii/pull/13709

#13708: Add white space to fix exception message split over several lines. 
(proposed by simonsticko; merged) https://github.com/dealii/dealii/pull/13708

#13707: Add more tests. (proposed by bangerth; merged) 
https://github.com/dealii/dealii/pull/13707

#13706: Add ReferenceCell::get_midpoint_quadrature(). (proposed by bangerth; 
merged) https://github.com/dealii/dealii/pull/13706

#13705: Create coarse mesh out of a CGAL::Surface_mesh (proposed by fdrmrc) 
https://github.com/dealii/dealii/pull/13705

#13704: SolverFlexibleCG: Slightly improve documentation (proposed by 
kronbichler; merged) https://github.com/dealii/dealii/pull/13704

#13702: Adjust test output for new FE_RaviartThomasNodal (proposed by 
kronbichler; merged) https://github.com/dealii/dealii/pull/13702

#13701: Fix test failure: Close the right AffineConstraints object (proposed by 
kronbichler; merged) https://github.com/dealii/dealii/pull/13701

#13700: Correctly size CellData::vertices in GridTools. (proposed by drwells; 
merged) https://github.com/dealii/dealii/pull/13700

#13699: Skip default values in get_coarse_mesh_description(). (proposed by 
drwells; merged) https://github.com/dealii/dealii/pull/13699

#13698: Add a data-locality-optimized iteration scheme to SolverCG (proposed by 
kronbichler) https://github.com/dealii/dealii/pull/13698

#13697: Add changelog for MappingQ (proposed by kronbichler; merged) 
https://github.com/dealii/dealii/pull/13697

#13696: Add GenericDoFsPerObject::generate() (proposed by peterrum; merged) 
https://github.com/dealii/dealii/pull/13696

#13695: Fix format of table (proposed by peterrum; merged) 
https://github.com/dealii/dealii/pull/13695

#13694: Generalize do_interpolate_boundary_values() for pyramid and wedge 
(proposed by peterrum) https://github.com/dealii/dealii/pull/13694

#13693: unit_support_points and unit_face_support_points for wedges and 
pyramids (proposed by peterrum; merged) 
https://github.com/dealii/dealii/pull/13693

#13692: Implement ReferenceCell::face_to_cell_lines() for pyramids and wedges 
(proposed by peterrum; merged) https://github.com/dealii/dealii/pull/13692

#13691: Rename some face batches (proposed by peterrum; merged) 
https://github.com/dealii/dealii/pull/13691

#13690: Improve asserts in MF/FEEval regarding FENothing (proposed by peterrum; 
merged) https://github.com/dealii/dealii/pull/13690

#13689: Test that exposes bug in Triangulation::create_triangulation (proposed 
by luca-heltai) https://github.com/dealii/dealii/pull/13689

#13688: Fix FEEvaluation::gather_evaluate() for user-defined batches (proposed 
by peterrum; merged) https://github.com/dealii/dealii/pull/13688

#13685: Reduce number of instantiations of FEEvaluation template factory 
(proposed by kronbichler; merged) https://github.com/dealii/dealii/pull/13685

#13684: Fix a recently added test (proposed by kronbichler; merged) 
https://github.com/dealii/dealii/pull/13684

#13683: Implement flexible variant of conjugate gradient method (proposed by 
kronbichler; merged) https://github.com/dealii/dealii/pull/13683

#13682: SolverCG: Switch to more common variable names (proposed by 
kronbichler; merged) https://github.com/dealii/dealii/pull/13682

#13681: Add LinearAlgebra::distributed::BlockVector::set_ghost_state() 
(proposed by peterrum; merged) https://github.com/dealii/dealii/pull/13681

#13679: Fix tests. (proposed by bangerth; merged) 
https://github.com/dealii/dealii/pull/13679

#13678: Add ReferenceCell::volume() and ::barycenter(). (proposed by bangerth; 
merged) https://github.com/dealii/dealii/pull/13678

#13677: Petsc bddc preconditioner (proposed by nabw) 
https://github.com/dealii/dealii/pull/13677

#13676: Use simpler initialization of std::set (proposed by kronbichler; 
merged) https://github.com/dealii/dealii/pull/13676

#13675: Minor edits to the C++ namespace documentation. (proposed by bangerth; 
merged) https://github.com/dealii/dealii/pull/13675

#13674: Use renumbering of DoFs for step-37 benchmark (proposed by kronbichler; 
merged) https://github.com/dealii/dealii/pull/13674

#13673: Upgrade write_vtu_in_parallel based on mpi large IO update (proposed by 
pengfej) https://github.com/dealii/dealii/pull/13673

#13672: Improve tutorial graph (proposed by drwells; merged) 
https://github.com/dealii/dealii/pull/13672

#13671: Hanging nodes support for matrix-free RT (proposed by NiklasWik) 
htt

Re: [deal.II] No printing of TimerOutput after catch of exception in MPI based code

2022-05-10 Thread 'maurice rohracker' via deal.II User Group
Thanks, Daniel that helped. Attached is the adapted mwe for others.

d.arnd...@gmail.com schrieb am Montag, 9. Mai 2022 um 12:37:35 UTC+2:

> Maurice,
>
> You could try to wrap the calls that might throw in a try-catch block to 
> deal with the exception yourself (including ignoring it).
>
> Best,
> Daniel
>
> On Mon, May 9, 2022 at 11:14 AM 'maurice rohracker' via deal.II User Group 
>  wrote:
>
>> Dear all,
>>
>> In the attached mwe we are facing the issue, that the TimerOutput object 
>> does not print the resulting table to the screen when an exception is 
>> thrown and caught within in a MPI based code.
>>
>> We are aware that some collective routine might be needed.
>>
>> However, is there a way which can handle this easily, such that 
>> TimerOutput object prints the resulting table to the screen even if an 
>> exception is thrown or are we missing something?
>>
>> We were already able to do so in the serial case.
>>
>> Thanks in advance.
>>
>> Best regards,
>> Maurice
>>
>> -- 
>> The deal.II project is located at http://www.dealii.org/
>> For mailing list/forum options, see 
>> https://groups.google.com/d/forum/dealii?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "deal.II User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to dealii+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/c68d2663-d1a7-4670-a632-9a51abae3d6fn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/53c7efae-5559-4fb4-b229-0db8c764bb59n%40googlegroups.com.
#include 
#include 
#include 
#include 
#include 

using UnsignedIntType = unsigned int;


class MyException : public dealii::ExceptionBase
{
public:
		MyException(const std::string &failureLocation)
		: failureLoc_(failureLocation)
		{
		if ((failureLoc_ != "pf") && (failureLoc_ != "disp") &&
		  (failureLoc_ != "outer"))
		Assert(false, dealii::ExcMessage("Invalid failure location string!"));
		}

		virtual ~MyException() noexcept = default;

		virtual void
		print_info(std::ostream &outStream) const
		{
			if (failureLoc_ == "pf")
			outStream << "Non convergence in the pf loop" << std::endl;
			else if (failureLoc_ == "disp")
			outStream << "Non convergence in the disp loop" << std::endl;
			else if (failureLoc_ == "outer")
			outStream << "Non convergence in the outer loop" << std::endl;
		}

std::string failureLoc_;
};

void Solve_timeStep(dealii::ConditionalOStream &outStream)
{
	static UnsignedIntType timeStepCtr = 0;
	
// do some nonlinear Newton iteration
	outStream << "local time-step counter: " << timeStepCtr << std::endl;

// the procedure fails for 4-th time-step
	if(timeStepCtr ==  4)
	{
		++timeStepCtr;
		AssertThrow(false, MyException("pf")); 
	}

	//if(timeStepCtr == 6)
	//	Assert(false, MyException("disp"));

	++timeStepCtr;
}

void Simulate(dealii::TimerOutput *timerOutput, dealii::ConditionalOStream &outStream)
{
	const UnsignedIntType nTimeSteps = 10;
	for(UnsignedIntType timeStepCtr=0; timeStepCtrenter_subsection("Solve Time-Step");
		Solve_timeStep(outStream);
		timerOutput->leave_subsection();
	}

}

int main(int argc, char *argv[])
{

	dealii::Utilities::MPI::MPI_InitFinalize mpiInitialization(argc, argv, 1);
MPI_Comm const & mpiCommunicator(MPI_COMM_WORLD);
UnsignedIntType  processorRank = dealii::Utilities::MPI::this_mpi_process(mpiCommunicator);
dealii::ConditionalOStream pCout(std::cout, processorRank == 0);
dealii::TimerOutput timerOutput(mpiCommunicator, pCout, dealii::TimerOutput::summary, dealii::TimerOutput::wall_times);
dealii::TimerOutput::Scope timer_section(timerOutput, "Simulation");
try
{
	Simulate(&timerOutput, pCout);
	}
	catch(dealii::ExceptionBase& exception)
	{
	pCout << "Exception thrown to main!!" << std::endl;
pCout << exception.what() << std::endl;
	pCout << "Stack trace should be printed below!" << std::endl;
exception.print_stack_trace(std::cout);
pCout << "End programm" << std::endl;
	}
	
	return 0;
}